Add test for canceling a running compose

This is a modification of an existing test for compose sanity.
Cherry picked from 8c9f528cd4

Related: rhbz#1789451
This commit is contained in:
Jakub Rusz 2020-01-03 14:17:56 +01:00 committed by Alexander Todorov
parent 772e841a7f
commit 06f09b2335

View File

@ -16,6 +16,30 @@ rlJournalStart
rlPhaseEnd
rlPhaseStartTest "compose start"
UUID=`$CLI compose start example-http-server ami`
rlAssertEquals "exit code should be zero" $? 0
UUID=`echo $UUID | cut -f 2 -d' '`
if [ -n "$UUID" ]; then
until $CLI compose details $UUID | grep 'RUNNING'; do
sleep 20
rlLogInfo "Waiting for compose to start running..."
if $CLI compose info $UUID | grep 'FAILED'; then
rlFail "Compose FAILED!"
break
fi
done;
else
rlFail "Compose UUID is empty!"
fi
rlPhaseEnd
rlPhaseStartTest "cancel compose"
rlRun -t -c "$CLI compose cancel $UUID"
rlRun -t -c "$CLI compose details $UUID" 1 "compose is canceled"
rlPhaseEnd
rlPhaseStartTest "compose start again"
UUID=`$CLI --test=2 compose start example-http-server tar`
rlAssertEquals "exit code should be zero" $? 0