diff options
author | 2016-04-07 22:18:24 +0000 | |
---|---|---|
committer | 2016-04-07 22:18:24 +0000 | |
commit | e94b6360fc11a8edb1eed2cf73fe8605155e3a87 (patch) | |
tree | a509c699017fbf1a8614d1110c758974cadf52e5 | |
parent | 373b65cb05edd555edf20fe6243e911bdc08c6ed (diff) | |
parent | 529a79163366a7f82675ab70eb02727ab15f96a8 (diff) |
Merge "Improve success/fail test" into stable/brahmaputra
-rw-r--r-- | tests/adhoc/dmz01.sh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/adhoc/dmz01.sh b/tests/adhoc/dmz01.sh index 7ca2b9c..11d657a 100644 --- a/tests/adhoc/dmz01.sh +++ b/tests/adhoc/dmz01.sh @@ -119,15 +119,18 @@ test_cirros1_ID=$(openstack server list | awk "/ cirros1 / { print \$2 }") echo "Get cirros2 instance ID" test_cirros2_ID=$(openstack server list | awk "/ cirros2 / { print \$2 }") -echo "Check for presence of cirros1 ID in Congress policy 'test' table 'dmz_server'" -dmz_cirros1=$(openstack congress policy row list test dmz_server | awk "/ $test_cirros1_ID / { print \$2 }") - -echo "Check for presence of cirros1 ID in Congress policy 'test' table 'dmz_server'" -dmz_cirros2=$(openstack congress policy row list test dmz_server | awk "/ $test_cirros2_ID / { print \$2 }") - echo "Verify cirros1 and cirros2 IDs are in the Congress policy 'test' table 'dmz_server'" -if [ "$dmz_cirros1" == "$test_cirros1_ID" ] && [ "$dmz_cirros2" == "$test_cirros2_ID" ]; then echo "Test Success!" -else echo "Test Failed!" -fi +COUNTER=5 +RESULT="Test Failed!" +until [[ $COUNTER -eq 0 || $RESULT == "Test Success!" ]]; do + echo "Check for presence of cirros1 ID in Congress policy 'test' table 'dmz_server'" + dmz_cirros1=$(openstack congress policy row list test dmz_server | awk "/ $test_cirros1_ID / { print \$2 }") + echo "Check for presence of cirros2 ID in Congress policy 'test' table 'dmz_server'" + dmz_cirros2=$(openstack congress policy row list test dmz_server | awk "/ $test_cirros2_ID / { print \$2 }") + if [ "$dmz_cirros1" == "$test_cirros1_ID" ] && [ "$dmz_cirros2" == "$test_cirros2_ID" ]; then RESULT="Test Success!" + fi + let COUNTER-=1 +done +echo $RESULT set +x #echo off |