From 06f09b2335d7b5c812e02bb91f28a36fc7151332 Mon Sep 17 00:00:00 2001 From: Jakub Rusz Date: Fri, 3 Jan 2020 14:17:56 +0100 Subject: [PATCH] Add test for canceling a running compose This is a modification of an existing test for compose sanity. Cherry picked from 8c9f528cd42fd8dd61e64572eda89e6168c409a0 Related: rhbz#1789451 --- tests/cli/test_compose_sanity.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/cli/test_compose_sanity.sh b/tests/cli/test_compose_sanity.sh index bab94de6..d6dec2e2 100755 --- a/tests/cli/test_compose_sanity.sh +++ b/tests/cli/test_compose_sanity.sh @@ -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