tests: Allow skipping image build in compose sanity test
when $SKIP_IMAGE_BUILD is set the test skips 2 phases: - start the compose again (after it has been cancelled) and - waiting for it to finish & downloading the resulting image This will allow to enable this test script in downstream gating jobs.
This commit is contained in:
parent
8966c675ee
commit
556fdf3020
@ -76,6 +76,7 @@ rlJournalStart
|
|||||||
fi
|
fi
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
|
if [ -z "$SKIP_IMAGE_BUILD" ]; then
|
||||||
rlPhaseStartTest "compose start again"
|
rlPhaseStartTest "compose start again"
|
||||||
UUID=`$CLI compose start test-http-server qcow2`
|
UUID=`$CLI compose start test-http-server qcow2`
|
||||||
rlAssertEquals "exit code should be zero" $? 0
|
rlAssertEquals "exit code should be zero" $? 0
|
||||||
@ -83,14 +84,6 @@ rlJournalStart
|
|||||||
UUID=`echo $UUID | cut -f 2 -d' '`
|
UUID=`echo $UUID | cut -f 2 -d' '`
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseStartTest "compose info"
|
|
||||||
if [ -n "$UUID" ]; then
|
|
||||||
rlRun -t -c "$CLI compose info $UUID | egrep 'RUNNING|WAITING'"
|
|
||||||
else
|
|
||||||
rlFail "Compose UUID is empty!"
|
|
||||||
fi
|
|
||||||
rlPhaseEnd
|
|
||||||
|
|
||||||
rlPhaseStartTest "compose image"
|
rlPhaseStartTest "compose image"
|
||||||
wait_for_compose $UUID
|
wait_for_compose $UUID
|
||||||
if [ -n "$UUID" ]; then
|
if [ -n "$UUID" ]; then
|
||||||
@ -107,9 +100,14 @@ rlJournalStart
|
|||||||
rlAssertNotDiffer "/var/lib/lorax/composer/results/$UUID/disk.qcow2" "$UUID-disk.qcow2"
|
rlAssertNotDiffer "/var/lib/lorax/composer/results/$UUID/disk.qcow2" "$UUID-disk.qcow2"
|
||||||
fi
|
fi
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
else
|
||||||
|
rlLogInfo "Skipping image build phases"
|
||||||
|
fi
|
||||||
|
|
||||||
rlPhaseStartCleanup
|
rlPhaseStartCleanup
|
||||||
|
if [ "$($CLI compose list | grep -c $UUID)" == "1" ]; then
|
||||||
rlRun -t -c "$CLI compose delete $UUID"
|
rlRun -t -c "$CLI compose delete $UUID"
|
||||||
|
fi
|
||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlJournalEnd
|
rlJournalEnd
|
||||||
|
Loading…
Reference in New Issue
Block a user