Bug 968381 - "rlRun -s" design leads to /dev/null removal
"rlRun -s" design leads to /dev/null removal
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: beakerlib (Show other bugs)
rawhide
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Petr Muller
Fedora Extras Quality Assurance
: Reopened
Depends On: 968300
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-29 11:10 EDT by Ales Zelinka
Modified: 2016-09-19 22:10 EDT (History)
5 users (show)

See Also:
Fixed In Version: beakerlib-1.8-1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 968300
: 971868 (view as bug list)
Environment:
Last Closed: 2013-06-29 14:04:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ales Zelinka 2013-05-29 11:10:05 EDT
+++ This bug was initially created as a clone of Bug #968300 +++

7 RHEL5 TIP runes were killed by one of these tests, please investigate and fix the culprit as soon as possible. 

Switch both tests to a CONFIRMED state in TCMS once they're no longer destructive.


list of test runs affected by this (see test-run notes for IDs of the killed recipes):
TR#64754, TR#64614, TR#64476, TR#64370, TR#64247, TR#64173, TR#64124

--- Additional comment from Robin Hack on 2013-05-29 08:28:14 EDT ---

I think, that is very nasty beakerlib implementation...

From documentation:
-s
    Store stdout and stderr to a file (mixed together, as the user would see it on a terminal) and set $rlRun_LOG variable to name of the file. !!!Caller is responsible for removing the file!!!. When -t option is used, the content of the file becomes tagged too. 

If the -s option is not used, $rlRun_LOG is not modified and keeps its content from the last "rlRun -s". 

From test:
rlRun -s "grep localhost:/usr /etc/mtab" 0 "Grep content of /etc/mtap"

This command has no output!

Test output:
:: [   FAIL   ] :: File '/dev/null' should contain 'noacl' 

From test:
rlRun "rm -r $rlRun_LOG" 0 "Removing $rlRun_LOG"

Test output:
:: [   PASS   ] :: Removing /dev/null

Yeah!!!

--- Additional comment from Robin Hack on 2013-05-29 08:41:00 EDT ---

I wrote little workaround.
But this construction is still very dangerous.
Comment 1 Petr Muller 2013-06-07 06:59:50 EDT

*** This bug has been marked as a duplicate of bug 971783 ***
Comment 2 Petr Muller 2013-06-07 07:57:36 EDT
Sorry, got a bit confused. This is not a dup.
Comment 3 Petr Muller 2013-06-07 09:06:15 EDT
It is not a dup, but it is related. /dev/null should never be propagated to rlLog_LOG: when rlLog_LOG is set, it implies that DO_KEEP was set earlier, and that code should create a temporary logfile.

But the check for logfile creation was missing, /dev/null was used instead and was propagated in rlLog_LOG (in some cases rlRun even deleted it itself :)

I have modified rlRun so that /dev/null is only used in basic mode (no removal or propagation). With switches, when the temporary logfile creation fails, it is reported and switched to basic mode.

https://git.fedorahosted.org/cgit/beakerlib.git/commit/?id=13af1c5d7be9c3d40f5b74ea3c3e15419edf9c98
Comment 4 Fedora Update System 2013-06-10 08:25:21 EDT
beakerlib-1.8-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/beakerlib-1.8-1.fc19
Comment 5 Fedora Update System 2013-06-10 10:39:28 EDT
Package beakerlib-1.8-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.8-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-10465/beakerlib-1.8-1.fc19
then log in and leave karma (feedback).
Comment 6 Fedora Update System 2013-06-29 14:04:01 EDT
beakerlib-1.8-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

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