tests: Add check to make sure the compose actually finished
Previously it was looping, waiting for FINISHED|FAILED but was not actually failing the test if the compose failed to build. This adds a function to check the status of the compose and calls it after each compose.
This commit is contained in:
parent
197c326530
commit
d0e947fe3b
@ -64,3 +64,12 @@ check_kernel_cmdline() {
|
||||
rlRun -t -c "ssh $SSH_OPTS ${SSH_USER}@${SSH_MACHINE} 'grep custom_cmdline_arg /proc/cmdline'" 0 \
|
||||
"System booted from the image contains specified parameter on kernel command line"
|
||||
}
|
||||
|
||||
# Fail if the compose failed, only call after checking for FINISHED|FAILED
|
||||
check_compose_status() {
|
||||
UUID="$1"
|
||||
if "$CLI" compose info "$UUID" | grep FAILED; then
|
||||
rlFail "compose $UUID FAILED"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ rlJournalStart
|
||||
sleep 10
|
||||
rlLogInfo "Waiting for compose to finish ..."
|
||||
done;
|
||||
check_compose_status "$UUID"
|
||||
else
|
||||
rlFail "Compose UUID is empty!"
|
||||
fi
|
||||
|
@ -28,6 +28,7 @@ rlJournalStart
|
||||
sleep 10
|
||||
rlLogInfo "Waiting for compose to finish..."
|
||||
done
|
||||
check_compose_status "$UUID"
|
||||
else
|
||||
flFail "Compose UUID is empty!"
|
||||
fi
|
||||
|
@ -37,6 +37,7 @@ rlJournalStart
|
||||
sleep 20
|
||||
rlLogInfo "Waiting for compose to finish ..."
|
||||
done;
|
||||
check_compose_status "$UUID"
|
||||
else
|
||||
rlFail "Compose UUID is empty!"
|
||||
fi
|
||||
|
@ -32,6 +32,7 @@ rlJournalStart
|
||||
sleep 10
|
||||
rlLogInfo "Waiting for compose to finish ..."
|
||||
done;
|
||||
check_compose_status "$UUID"
|
||||
else
|
||||
rlFail "Compose UUID is empty!"
|
||||
fi
|
||||
|
@ -65,6 +65,7 @@ __EOF__
|
||||
sleep 20
|
||||
rlLogInfo "Waiting for compose to finish ..."
|
||||
done;
|
||||
check_compose_status "$UUID"
|
||||
else
|
||||
rlFail "Compose UUID is empty!"
|
||||
fi
|
||||
|
@ -36,6 +36,7 @@ rlJournalStart
|
||||
sleep 5
|
||||
rlLogInfo "Waiting for compose to finish ..."
|
||||
done;
|
||||
check_compose_status "$UUID"
|
||||
|
||||
rlRun -t -c "$CLI compose image $UUID"
|
||||
rlAssertExists "$UUID-root.tar.xz"
|
||||
|
@ -34,6 +34,7 @@ rlJournalStart
|
||||
sleep 10
|
||||
rlLogInfo "Waiting for compose to finish ..."
|
||||
done;
|
||||
check_compose_status "$UUID"
|
||||
else
|
||||
rlFail "Compose UUID is empty!"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user