Bug 1320320
| Summary: | [Beaker][BEAH]rhts-reboot no longer works in automated environment | ||
|---|---|---|---|
| Product: | [Retired] Beaker | Reporter: | Jeff Burke <jburke> |
| Component: | beah | Assignee: | Dan Callaghan <dcallagh> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Roman Joost <rjoost> |
| Severity: | urgent | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 22 | CC: | bpeck, dcallagh, jstancek, mjia, pbunyan, rjoost |
| Target Milestone: | 23.0 | Keywords: | Patch, Regression |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-03-23 06:28:15 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Jeff Burke
2016-03-22 20:26:18 UTC
commit 06015afd8a579859f3fe795cdf09d09225ae1164
Author: Dan Callaghan <dcallagh>
Date: Mon Jan 18 17:29:20 2016 +1000
rhts-reboot: don't invoke beahsh if we are not run inside a task
Bug: 1298934
Change-Id: I483e8a674e3a8645e8a3078fe3ffc97fb44eadd1
diff --git a/bin/rhts-reboot b/bin/rhts-reboot
index d75ca6d..5ce80a4 100755
--- a/bin/rhts-reboot
+++ b/bin/rhts-reboot
@@ -17,7 +17,7 @@
PATH=/sbin:/usr/sbin:$PATH
-if [ "$RESULT_SERVER+is_not_set" = "+is_not_set" ]; then
+if [ -n "$RESULT_SERVER" ] ; then
echo "RHTS test $TEST wants to reboot your system"
echo -n "Press Enter to reboot or hit CTRL-C to stop"
read Dummy
@@ -42,7 +42,9 @@ if efibootmgr &>/dev/null ; then
fi
fi
-beahsh rebooting "Rebooting from task"
+if [ -n "$RESULT_SERVER" ] ; then
+ beahsh rebooting "Rebooting from task"
+fi
/sbin/shutdown -r now
# Wait for the shutdown to kill us.. we don't want control to go back
Seems like backwards logic in the above commit which was for bug 1298934. The first conditional should be -z not -n. I think this also goes to show that we really can't keep patching beah and rhts without proper automated functional regression tests to prove that they actually do what they're supposed to do in a Beaker environment. As a workaround you can force rhts-test-env to be downgraded:
<ks_appends>
<ks_append><![CDATA[
%post
yum -y downgrade rhts-test-env-4.68 rhts-python-4.68
%end
]]></ks_append>
</ks_appends>
Tagged as rhts 4.70. Steps to verify: 1. Run a job containing /kernel/misc/reboot, or /distribution/utils/reboot or equivalent. Check that the system reboots properly and there is no prompt as per comment 0. 2. Run rhts-reboot outside a Beaker task (for example in a VM). It should prompt before rebooting. rhts 4.70 has been released. |