Bug 1320320 - [Beaker][BEAH]rhts-reboot no longer works in automated environment
Summary: [Beaker][BEAH]rhts-reboot no longer works in automated environment
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: beah
Version: 22
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: 23.0
Assignee: Dan Callaghan
QA Contact: Roman Joost
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-22 20:26 UTC by Jeff Burke
Modified: 2016-06-10 01:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-23 06:28:15 UTC
Embargoed:


Attachments (Terms of Use)

Description Jeff Burke 2016-03-22 20:26:18 UTC
Description of problem:
 Since the latest upgrade of Beaker 22.2. The side of Beaker (BEAH) hangs during automated testing when tasks calls rhts-reboot.

Version-Release number of selected component (if applicable):
================================================================================ 
 Package                   Arch      Version            Repository         Size 
================================================================================ 
Installing: 
 beah                      noarch    0.7.9-1.el6        beaker-harness    323 k 
 beakerlib                 noarch    1.11-1.el6         beaker-harness    130 k 
 rhts-test-env             noarch    4.69-1.el6         beaker-harness     46 k 
Installing for dependencies: 
 PyXML                     i686      0.8.4-19.el6       beaker-Server     892 k 
 SOAPpy                    noarch    0.11.6-11.el6      beaker-Server     207 k 
 python-fpconst            noarch    0.7.3-6.1.el6      beaker-Server      16 k 
 python-twisted-core       i686      8.2.0-4.el6        beaker-Server     2.0 M 
 python-twisted-web        i686      8.2.0-3.2.el6      beaker-Server     633 k 
 python-zope-filesystem    i686      1-5.el6            beaker-Server     4.9 k 
 python-zope-interface     i686      3.5.2-2.1.el6      beaker-Server     116 k 
 rhts-python               noarch    4.69-1.el6         beaker-harness     57 k 
================================================================================ 

How reproducible:
 Always

Steps to Reproduce:
1. Provision OS
2. run task /kernel/misc/reboot

Actual results:
 https://beaker.engineering.redhat.com/jobs/1276153

All recipes hit LWD/EWD

They are hung at:

RHTS test /distribution/kernelinstall wants to reboot your system  
Press Enter to reboot or hit CTRL-C to stop

Expected results:


Additional info:
I believe it has to do with this BZ: 
  https://bugzilla.redhat.com/show_bug.cgi?id=1298934

I tried to review the testing of this but the task in Comment#8[1] of BZ#1298934
But that job has been deleted.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1298934#c8

Note: this works with restraint. But fails with BEAH.

Comment 1 Jeff Burke 2016-03-22 20:26:56 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

Comment 2 Dan Callaghan 2016-03-23 01:03:48 UTC
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.

Comment 3 Dan Callaghan 2016-03-23 01:31:49 UTC
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>

Comment 4 Dan Callaghan 2016-03-23 02:01:03 UTC
http://gerrit.beaker-project.org/4760

Comment 5 Dan Callaghan 2016-03-23 04:25:33 UTC
Tagged as rhts 4.70.

Comment 7 Dan Callaghan 2016-03-23 05:16:42 UTC
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.

Comment 9 Dan Callaghan 2016-03-23 06:28:15 UTC
rhts 4.70 has been released.


Note You need to log in before you can comment on or make changes to this bug.