diff --git a/t/t0029-redfish.t b/t/t0029-redfish.t index fc78d245..2b68b6f0 100755 --- a/t/t0029-redfish.t +++ b/t/t0029-redfish.t @@ -107,6 +107,378 @@ test_expect_success 'stop powerman daemon' ' wait ' +# +# redfishpower hpe cray supercomputing ex chassis test +# + +test_expect_success 'create powerman.conf for chassis w/ 16 redfish nodes (crayex)' ' + cat >powerman_hpe_cray_supercomputing_ex_chassis.conf <<-EOT + listen "$testaddr" + include "$devicesdir/redfishpower-hpe-cray-supercomputing-ex-chassis.dev" + device "d0" "redfishpower-CrayEX" "$redfishdir/redfishpower -h cmm0,t[0-15] --test-mode |&" + node "cmm0,perif[0-7],blade[0-7],t[0-15]" "d0" + EOT +' +test_expect_success 'start powerman daemon and wait for it to start (crayex)' ' + $powermand -Y -c powerman_hpe_cray_supercomputing_ex_chassis.conf & + echo $! >powermand.pid && + $powerman --retry-connect=100 --server-host=$testaddr -d +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayex_query1.out && + makeoutput "" "blade[0-7],cmm0,perif[0-7],t[0-15]" "" >test_crayex_query1.exp && + test_cmp test_crayex_query1.exp test_crayex_query1.out +' +# powering on descendants with cmm off, nothing turns on +test_expect_success 'powerman -1 blade[0-7] doesnt work' ' + test_must_fail $powerman -h $testaddr --diag -1 blade[0-7] >test_crayex_on1.out && + echo blade[0-7]: ancestor off >test_crayex_on1.exp && + echo Command completed with errors >>test_crayex_on1.exp && + test_cmp test_crayex_on1.exp test_crayex_on1.out +' +test_expect_success 'powerman -1 perif[0-7] doesnt work' ' + test_must_fail $powerman -h $testaddr --diag -1 perif[0-7] >test_crayex_on2.out && + echo perif[0-7]: ancestor off >test_crayex_on2.exp && + echo Command completed with errors >>test_crayex_on2.exp && + test_cmp test_crayex_on2.exp test_crayex_on2.out +' +test_expect_success 'powerman -1 t[0-15] doesnt work' ' + test_must_fail $powerman -h $testaddr --diag -1 t[0-15] >test_crayex_on3.out && + echo t[0-15]: ancestor off >test_crayex_on3.exp && + echo Command completed with errors >>test_crayex_on3.exp && + test_cmp test_crayex_on3.exp test_crayex_on3.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayex_query2.out && + makeoutput "" "blade[0-7],cmm0,perif[0-7],t[0-15]" "" >test_crayex_query2.exp && + test_cmp test_crayex_query2.exp test_crayex_query2.out +' +# turn on cmm works +test_expect_success 'powerman -1 cmm0 completes' ' + $powerman -h $testaddr -1 cmm0 >test_crayex_on4.out && + echo Command completed successfully >test_crayex_on4.exp && + test_cmp test_crayex_on4.exp test_crayex_on4.out +' +test_expect_success 'powerman -q shows cmm0 on' ' + $powerman -h $testaddr -q >test_crayex_query3.out && + makeoutput "cmm0" "blade[0-7],perif[0-7],t[0-15]" "" >test_crayex_query3.exp && + test_cmp test_crayex_query3.exp test_crayex_query3.out +' +# turn on children of blades does not work +test_expect_success 'powerman -1 t[0-15] doesnt work' ' + test_must_fail $powerman -h $testaddr --diag -1 t[0-15] >test_crayex_on5.out && + echo t[0-15]: ancestor off >test_crayex_on5.exp && + echo Command completed with errors >>test_crayex_on5.exp && + test_cmp test_crayex_on5.exp test_crayex_on5.out +' +test_expect_success 'powerman -q shows cmm0 on' ' + $powerman -h $testaddr -q >test_crayex_query4.out && + makeoutput "cmm0" "blade[0-7],perif[0-7],t[0-15]" "" >test_crayex_query4.exp && + test_cmp test_crayex_query4.exp test_crayex_query4.out +' +# turn on some blades, allows some nodes to be turned on +test_expect_success 'powerman -1 blade[4-7] completes' ' + $powerman -h $testaddr -1 blade[4-7] >test_crayex_on6.out && + echo Command completed successfully >test_crayex_on6.exp && + test_cmp test_crayex_on6.exp test_crayex_on6.out +' +test_expect_success 'powerman -1 t[0-15] doesnt work, some succeed' ' + test_must_fail $powerman -h $testaddr --diag -1 t[0-15] >test_crayex_on7.out && + echo t[0-7]: ancestor off >test_crayex_on7.exp && + echo Command completed with errors >>test_crayex_on7.exp && + test_cmp test_crayex_on7.exp test_crayex_on7.out +' +test_expect_success 'powerman -q shows blade[4-7],cmm0,t[8-15] on' ' + $powerman -h $testaddr -q >test_crayex_query5.out && + makeoutput "blade[4-7],cmm0,t[8-15]" "blade[0-3],perif[0-7],t[0-7]" "" >test_crayex_query5.exp && + test_cmp test_crayex_query5.exp test_crayex_query5.out +' +# turn on blades and perif and then nodes +test_expect_success 'powerman -1 blade[0-3],perif[0-7] completes' ' + $powerman -h $testaddr -1 blade[0-3],perif[0-7] >test_crayex_on8.out && + echo Command completed successfully >test_crayex_on8.exp && + test_cmp test_crayex_on8.exp test_crayex_on8.out +' +test_expect_success 'powerman -q shows blade[0-7],cmm0,perif[0-7] on' ' + $powerman -h $testaddr -q >test_crayex_query6.out && + makeoutput "blade[0-7],cmm0,perif[0-7],t[8-15]" "t[0-7]" "" >test_crayex_query6.exp && + test_cmp test_crayex_query6.exp test_crayex_query6.out +' +test_expect_success 'powerman -1 t[0-15] completes' ' + $powerman -h $testaddr -1 t[0-15] >test_crayex_on6.out && + echo Command completed successfully >test_crayex_on6.exp && + test_cmp test_crayex_on6.exp test_crayex_on6.out +' +test_expect_success 'powerman -q shows blade[0-7],cmm0,t[0-15] on' ' + $powerman -h $testaddr -q >test_crayex_query7.out && + makeoutput "blade[0-7],cmm0,perif[0-7],t[0-15]" "" "" >test_crayex_query7.exp && + test_cmp test_crayex_query7.exp test_crayex_query7.out +' +# turn off leaves works +test_expect_success 'powerman -0 t[8-15] completes' ' + $powerman -h $testaddr -0 t[8-15] >test_crayex_off1.out && + echo Command completed successfully >test_crayex_off1.exp && + test_cmp test_crayex_off1.exp test_crayex_off1.out +' +test_expect_success 'powerman -q shows blade[0-7],cmm0,t[0-7] on' ' + $powerman -h $testaddr -q >test_crayex_query8.out && + makeoutput "blade[0-7],cmm0,perif[0-7],t[0-7]" "t[8-15]" "" >test_crayex_query8.exp && + test_cmp test_crayex_query8.exp test_crayex_query8.out +' +# turn off level 2 perif & blades, remaining leaves are now off +test_expect_success 'powerman -0 blade[0-7],perif[0-7] completes' ' + $powerman -h $testaddr -0 blade[0-7],perif[0-7] >test_crayex_off2.out && + echo Command completed successfully >test_crayex_off2.exp && + test_cmp test_crayex_off2.exp test_crayex_off2.out +' +test_expect_success 'powerman -q shows cmm0 on' ' + $powerman -h $testaddr -q >test_crayex_query9.out && + makeoutput "cmm0" "blade[0-7],perif[0-7],t[0-15]" "" >test_crayex_query9.exp && + test_cmp test_crayex_query9.exp test_crayex_query9.out +' +# turn off cmm works +test_expect_success 'powerman -0 cmm0 completes' ' + $powerman -h $testaddr -0 cmm0 >test_crayex_off3.out && + echo Command completed successfully >test_crayex_off3.exp && + test_cmp test_crayex_off3.exp test_crayex_off3.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayex_query10.out && + makeoutput "" "blade[0-7],cmm0,perif[0-7],t[0-15]" "" >test_crayex_query10.exp && + test_cmp test_crayex_query10.exp test_crayex_query10.out +' +# turn on everything doesn't work +test_expect_success 'powerman -1 blade[0-7],cmm0,perif[0-7],t[0-15] doesnt work' ' + test_must_fail $powerman -h $testaddr --diag -1 blade[0-7],cmm0,perif[0-7],t[0-15] >test_crayex_on9.out && + echo blade[0-7],cmm0,perif[0-7],t[0-15]: cannot turn on parent and child >test_crayex_on9.exp && + echo Command completed with errors >>test_crayex_on9.exp && + test_cmp test_crayex_on9.exp test_crayex_on9.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayex_query11.out && + makeoutput "" "blade[0-7],cmm0,perif[0-7],t[0-15]" "" >test_crayex_query11.exp && + test_cmp test_crayex_query11.exp test_crayex_query11.out +' +# turn everything on +test_expect_success 'powerman turn on everything' ' + $powerman -h $testaddr -1 cmm0 >test_crayex_on9A.out && + echo Command completed successfully >test_crayex_on9A.exp && + test_cmp test_crayex_on9A.exp test_crayex_on9A.out && + $powerman -h $testaddr -1 blade[0-7],perif[0-7] >test_crayex_on9B.out && + echo Command completed successfully >test_crayex_on9B.exp && + test_cmp test_crayex_on9B.exp test_crayex_on9B.out && + $powerman -h $testaddr -1 t[0-15] >test_crayex_on9C.out && + echo Command completed successfully >test_crayex_on9C.exp && + test_cmp test_crayex_on9C.exp test_crayex_on9C.out +' +test_expect_success 'powerman -q shows all on' ' + $powerman -h $testaddr -q >test_crayex_query12.out && + makeoutput "blade[0-7],cmm0,perif[0-7],t[0-15]" "" "" >test_crayex_query12.exp && + test_cmp test_crayex_query12.exp test_crayex_query12.out +' +# turn off everything works +test_expect_success 'powerman -0 blade[0-3],cmm0,perif[0-7],t[0-15] completes' ' + $powerman -h $testaddr -0 blade[0-3],cmm0,perif[0-7],t[0-15] >test_crayex_off4.out && + echo Command completed successfully >test_crayex_off4.exp && + test_cmp test_crayex_off4.exp test_crayex_off4.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayex_query13.out && + makeoutput "" "blade[0-7],cmm0,perif[0-7],t[0-15]" "" >test_crayex_query13.exp && + test_cmp test_crayex_query13.exp test_crayex_query13.out +' +test_expect_success 'stop powerman daemon (crayex)' ' + kill -15 $(cat powermand.pid) && + wait +' + +# +# redfishpower hpe cray supercomputing ex chassis test - some unpopulated +# +# assume perif[4-7] and blade[4-7] do not exist +# as a result t[8-15] do not exist +# + +test_expect_success 'create powerman.conf for chassis w/ 16 redfish nodes (crayexU)' ' + cat >powerman_hpe_cray_supercomputing_ex_chassis_U.conf <<-EOT + listen "$testaddr" + include "$devicesdir/redfishpower-hpe-cray-supercomputing-ex-chassis.dev" + device "d0" "redfishpower-CrayEX" "$redfishdir/redfishpower -h cmm0,t[0-7],unused[0-7] --test-mode |&" + node "cmm0,perif[0-3],blade[0-3],t[0-7]" "d0" "Enclosure,Perif[0-3],Blade[0-3],Node[0-7]" + EOT +' +test_expect_success 'start powerman daemon and wait for it to start (crayexU)' ' + $powermand -Y -c powerman_hpe_cray_supercomputing_ex_chassis_U.conf & + echo $! >powermand.pid && + $powerman --retry-connect=100 --server-host=$testaddr -d +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayexU_query1.out && + makeoutput "" "blade[0-3],cmm0,perif[0-3],t[0-7]" "" >test_crayexU_query1.exp && + test_cmp test_crayexU_query1.exp test_crayexU_query1.out +' +# turn on undefined stuff leads to errors +test_expect_success 'powerman fails on unpopulated targets' ' + test_must_fail $powerman -h $testaddr -1 blade4 && + test_must_fail $powerman -h $testaddr -1 perif5 && + test_must_fail $powerman -h $testaddr -1 t8 +' +# turn on everything works +test_expect_success 'powerman turn on everything' ' + $powerman -h $testaddr -1 cmm0 >test_crayexU_on9A.out && + echo Command completed successfully >test_crayexU_on9A.exp && + test_cmp test_crayexU_on9A.exp test_crayexU_on9A.out && + $powerman -h $testaddr -1 blade[0-3],perif[0-3] >test_crayexU_on9B.out && + echo Command completed successfully >test_crayexU_on9B.exp && + test_cmp test_crayexU_on9B.exp test_crayexU_on9B.out && + $powerman -h $testaddr -1 t[0-7] >test_crayexU_on9C.out && + echo Command completed successfully >test_crayexU_on9C.exp && + test_cmp test_crayexU_on9C.exp test_crayexU_on9C.out +' +test_expect_success 'powerman -q shows all on' ' + $powerman -h $testaddr -q >test_crayexU_query2.out && + makeoutput "blade[0-3],cmm0,perif[0-3],t[0-7]" "" "" >test_crayexU_query2.exp && + test_cmp test_crayexU_query2.exp test_crayexU_query2.out +' +# turn off everything works +test_expect_success 'powerman -0 blade[0-3],cmm0,perif[0-3],t[0-7] completes' ' + $powerman -h $testaddr -0 blade[0-3],cmm0,perif[0-3],t[0-7] >test_crayexU_off1.out && + echo Command completed successfully >test_crayexU_off1.exp && + test_cmp test_crayexU_off1.exp test_crayexU_off1.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayexU_query3.out && + makeoutput "" "blade[0-3],cmm0,perif[0-3],t[0-7]" "" >test_crayexU_query3.exp && + test_cmp test_crayexU_query3.exp test_crayexU_query3.out +' +test_expect_success 'stop powerman daemon (crayexU)' ' + kill -15 $(cat powermand.pid) && + wait +' + +# +# redfishpower hpe cray supercomputing ex chassis test - rabbit +# +# rabbit is descendant of perif 7 +# + +test_expect_success 'create powerman.conf for chassis w/ 16 redfish nodes (crayexR)' ' + cat >powerman_hpe_cray_supercomputing_ex_chassis_U.conf <<-EOT + listen "$testaddr" + include "$devicesdir/redfishpower-hpe-cray-supercomputing-ex-chassis.dev" + device "d0" "redfishpower-CrayEX-rabbit-s4s7" "$redfishdir/redfishpower -h cmm0,t[0-15],rabbit --test-mode |&" + node "cmm0,perif[0-4,7],blade[0-7],t[0-15],rabbit" "d0" "Enclosure,Perif[0-4,7],Blade[0-7],Node[0-16]" + EOT +' +test_expect_success 'start powerman daemon and wait for it to start (crayexR)' ' + $powermand -Y -c powerman_hpe_cray_supercomputing_ex_chassis_U.conf & + echo $! >powermand.pid && + $powerman --retry-connect=100 --server-host=$testaddr -d +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayexR_query1.out && + makeoutput "" "blade[0-7],cmm0,perif[0-4,7],rabbit,t[0-15]" "" >test_crayexR_query1.exp && + test_cmp test_crayexR_query1.exp test_crayexR_query1.out +' +# powering on rabbit with cmm and perif7 off +test_expect_success 'powerman -1 rabbit doesnt work' ' + test_must_fail $powerman -h $testaddr --diag -1 rabbit >test_crayexR_on1.out && + echo rabbit: ancestor off >test_crayexR_on1.exp && + echo Command completed with errors >>test_crayexR_on1.exp && + test_cmp test_crayexR_on1.exp test_crayexR_on1.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayexR_query2.out && + makeoutput "" "blade[0-7],cmm0,perif[0-4,7],rabbit,t[0-15]" "" >test_crayexR_query2.exp && + test_cmp test_crayexR_query2.exp test_crayexR_query2.out +' +# turn on cmm works, can't turn on rabbit +test_expect_success 'powerman -1 cmm0 completes' ' + $powerman -h $testaddr -1 cmm0 >test_crayexR_on2.out && + echo Command completed successfully >test_crayexR_on2.exp && + test_cmp test_crayexR_on2.exp test_crayexR_on2.out +' +test_expect_success 'powerman -1 rabbit doesnt work' ' + test_must_fail $powerman -h $testaddr --diag -1 rabbit >test_crayexR_on3.out && + echo rabbit: ancestor off >test_crayexR_on3.exp && + echo Command completed with errors >>test_crayexR_on3.exp && + test_cmp test_crayexR_on3.exp test_crayexR_on3.out +' +test_expect_success 'powerman -q shows cmm0 on' ' + $powerman -h $testaddr -q >test_crayexR_query3.out && + makeoutput "cmm0" "blade[0-7],perif[0-4,7],rabbit,t[0-15]" "" >test_crayexR_query3.exp && + test_cmp test_crayexR_query3.exp test_crayexR_query3.out +' +# turn on perif7 works, can turn on rabbit now +test_expect_success 'powerman -1 perif7 completes' ' + $powerman -h $testaddr -1 perif7 >test_crayexR_on4.out && + echo Command completed successfully >test_crayexR_on4.exp && + test_cmp test_crayexR_on4.exp test_crayexR_on4.out +' +test_expect_success 'powerman -1 rabbit completes' ' + $powerman -h $testaddr -1 rabbit >test_crayexR_on5.out && + echo Command completed successfully >test_crayexR_on5.exp && + test_cmp test_crayexR_on5.exp test_crayexR_on5.out +' +test_expect_success 'powerman -q shows cmm0,perif7,rabbit on' ' + $powerman -h $testaddr -q >test_crayexR_query4.out && + makeoutput "cmm0,perif7,rabbit" "blade[0-7],perif[0-4],t[0-15]" "" >test_crayexR_query4.exp && + test_cmp test_crayexR_query4.exp test_crayexR_query4.out +' +# turn off rabbit, perif7, cmm0 +test_expect_success 'powerman -0 rabbit completes' ' + $powerman -h $testaddr -0 rabbit >test_crayexR_off1.out && + echo Command completed successfully >test_crayexR_off1.exp && + test_cmp test_crayexR_off1.exp test_crayexR_off1.out +' +test_expect_success 'powerman -0 perif7 completes' ' + $powerman -h $testaddr -0 perif7 >test_crayexR_off2.out && + echo Command completed successfully >test_crayexR_off2.exp && + test_cmp test_crayexR_off2.exp test_crayexR_off2.out +' +test_expect_success 'powerman -0 cmm0 completes' ' + $powerman -h $testaddr -0 cmm0 >test_crayexR_off3.out && + echo Command completed successfully >test_crayexR_off3.exp && + test_cmp test_crayexR_off3.exp test_crayexR_off3.out +' +test_expect_success 'powerman -q shows everything off' ' + $powerman -h $testaddr -q >test_crayexR_query5.out && + makeoutput "" "blade[0-7],cmm0,perif[0-4,7],rabbit,t[0-15]" "" >test_crayexR_query5.exp && + test_cmp test_crayexR_query5.exp test_crayexR_query5.out +' +# turn on everything +test_expect_success 'powerman turn on everything' ' + $powerman -h $testaddr -1 cmm0 >test_crayexR_on6A.out && + echo Command completed successfully >test_crayexR_on6A.exp && + test_cmp test_crayexR_on6A.exp test_crayexR_on6A.out && + $powerman -h $testaddr -1 blade[0-7],perif[0-4,7] >test_crayexR_on6B.out && + echo Command completed successfully >test_crayexR_on6B.exp && + test_cmp test_crayexR_on6B.exp test_crayexR_on6B.out && + $powerman -h $testaddr -1 t[0-15],rabbit >test_crayexR_on6C.out && + echo Command completed successfully >test_crayexR_on6C.exp && + test_cmp test_crayexR_on6C.exp test_crayexR_on6C.out +' +test_expect_success 'powerman -q shows all on' ' + $powerman -h $testaddr -q >test_crayexR_query6.out && + makeoutput "blade[0-7],cmm0,perif[0-4,7],rabbit,t[0-15]" "" "" >test_crayexR_query6.exp && + test_cmp test_crayexR_query6.exp test_crayexR_query6.out +' +# turn off everything works +test_expect_success 'powerman -0 blade[0-7],cmm0,perif[0-4,7],rabbit,t[0-15] completes' ' + $powerman -h $testaddr -0 blade[0-7],cmm0,perif[0-4,7],rabbit,t[0-15] >test_crayexR_off4.out && + echo Command completed successfully >test_crayexR_off4.exp && + test_cmp test_crayexR_off4.exp test_crayexR_off4.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >test_crayexR_query7.out && + makeoutput "" "blade[0-7],cmm0,perif[0-4,7],rabbit,t[0-15]" "" >test_crayexR_query7.exp && + test_cmp test_crayexR_query7.exp test_crayexR_query7.out +' +test_expect_success 'stop powerman daemon (crayexR)' ' + kill -15 $(cat powermand.pid) && + wait +' + test_done # vi: set ft=sh