diff --git a/t/t0029-redfish.t b/t/t0029-redfish.t index fc9ce71b..ce7c371a 100755 --- a/t/t0029-redfish.t +++ b/t/t0029-redfish.t @@ -102,6 +102,41 @@ test_expect_success 'stop powerman daemon' ' kill -15 $(cat powermand.pid) && wait ' + +# Usage: genconfig num_chassis slots_per_chassis +genconfig() { + echo "listen \"$testaddr\"" + echo "include \"$devicesdir/redfishpower-cray-r272z30.dev\"" + for i in $(seq 0 $(($1-1))); do + lo=$(($i*$2)) + hi=$((${lo}+$2-1)) + echo "device \"chassis$i\" \"redfishpower-cray-r272z30\" \"$simdir/redfishpower -h blade[$lo-$hi] |&\"" + done + for i in $(seq 0 $(($1-1))); do + lo=$(($i*$2)) + hi=$((${lo}+$2-1)) + echo "node \"blade[$lo-$hi]\" \"chassis$i\"" + done +} +test_expect_success 'create powerman.conf for 2048 8-slot chassis' ' + genconfig 2048 8 >powerman2.conf + +' +test_expect_success 'start powerman daemon and wait for it to start' ' + ulimit -n 4096 && + $powermand -c powerman2.conf -f 2>powerman2.err & + echo $! >powermand2.pid && + $powerman --retry-connect=100 --server-host=$testaddr -d >device2.out +' +test_expect_success 'powerman -q shows all off' ' + $powerman -h $testaddr -q >query7.out && + makeoutput "" "blade[0-16383]" "" >query7.exp && + test_cmp query7.exp query7.out +' +test_expect_success 'stop powerman daemon' ' + kill -15 $(cat powermand2.pid) && + wait +' test_done # vi: set ft=sh