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.
(cherry picked from commit d0e947fe3b
)
Related: rhbz#1724073
This commit is contained in:
parent
dcb4c1a0e5
commit
ecc1ab705b
@ -64,3 +64,12 @@ check_kernel_cmdline() {
|
|||||||
rlRun -t -c "ssh $SSH_OPTS ${SSH_USER}@${SSH_MACHINE} 'grep custom_cmdline_arg /proc/cmdline'" 0 \
|
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"
|
"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
|
sleep 10
|
||||||
rlLogInfo "Waiting for compose to finish ..."
|
rlLogInfo "Waiting for compose to finish ..."
|
||||||
done;
|
done;
|
||||||
|
check_compose_status "$UUID"
|
||||||
else
|
else
|
||||||
rlFail "Compose UUID is empty!"
|
rlFail "Compose UUID is empty!"
|
||||||
fi
|
fi
|
||||||
|
@ -28,6 +28,7 @@ rlJournalStart
|
|||||||
sleep 10
|
sleep 10
|
||||||
rlLogInfo "Waiting for compose to finish..."
|
rlLogInfo "Waiting for compose to finish..."
|
||||||
done
|
done
|
||||||
|
check_compose_status "$UUID"
|
||||||
else
|
else
|
||||||
flFail "Compose UUID is empty!"
|
flFail "Compose UUID is empty!"
|
||||||
fi
|
fi
|
||||||
|
@ -36,6 +36,7 @@ rlJournalStart
|
|||||||
sleep 20
|
sleep 20
|
||||||
rlLogInfo "Waiting for compose to finish ..."
|
rlLogInfo "Waiting for compose to finish ..."
|
||||||
done;
|
done;
|
||||||
|
check_compose_status "$UUID"
|
||||||
else
|
else
|
||||||
rlFail "Compose UUID is empty!"
|
rlFail "Compose UUID is empty!"
|
||||||
fi
|
fi
|
||||||
|
@ -32,6 +32,7 @@ rlJournalStart
|
|||||||
sleep 10
|
sleep 10
|
||||||
rlLogInfo "Waiting for compose to finish ..."
|
rlLogInfo "Waiting for compose to finish ..."
|
||||||
done;
|
done;
|
||||||
|
check_compose_status "$UUID"
|
||||||
else
|
else
|
||||||
rlFail "Compose UUID is empty!"
|
rlFail "Compose UUID is empty!"
|
||||||
fi
|
fi
|
||||||
|
@ -64,6 +64,7 @@ __EOF__
|
|||||||
sleep 20
|
sleep 20
|
||||||
rlLogInfo "Waiting for compose to finish ..."
|
rlLogInfo "Waiting for compose to finish ..."
|
||||||
done;
|
done;
|
||||||
|
check_compose_status "$UUID"
|
||||||
else
|
else
|
||||||
rlFail "Compose UUID is empty!"
|
rlFail "Compose UUID is empty!"
|
||||||
fi
|
fi
|
||||||
|
@ -36,6 +36,7 @@ rlJournalStart
|
|||||||
sleep 5
|
sleep 5
|
||||||
rlLogInfo "Waiting for compose to finish ..."
|
rlLogInfo "Waiting for compose to finish ..."
|
||||||
done;
|
done;
|
||||||
|
check_compose_status "$UUID"
|
||||||
|
|
||||||
rlRun -t -c "$CLI compose image $UUID"
|
rlRun -t -c "$CLI compose image $UUID"
|
||||||
rlAssertExists "$UUID-root.tar.xz"
|
rlAssertExists "$UUID-root.tar.xz"
|
||||||
|
@ -34,6 +34,7 @@ rlJournalStart
|
|||||||
sleep 10
|
sleep 10
|
||||||
rlLogInfo "Waiting for compose to finish ..."
|
rlLogInfo "Waiting for compose to finish ..."
|
||||||
done;
|
done;
|
||||||
|
check_compose_status "$UUID"
|
||||||
else
|
else
|
||||||
rlFail "Compose UUID is empty!"
|
rlFail "Compose UUID is empty!"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user