Bug 968381 - "rlRun -s" design leads to /dev/null removal
Summary: "rlRun -s" design leads to /dev/null removal
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Petr Muller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 968300
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-29 15:10 UTC by Ales Zelinka
Modified: 2016-09-20 02:10 UTC (History)
5 users (show)

Fixed In Version: beakerlib-1.8-1.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of: 968300
: 971868 (view as bug list)
Environment:
Last Closed: 2013-06-29 18:04:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ales Zelinka 2013-05-29 15:10:05 UTC
+++ 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 10:59:50 UTC

*** This bug has been marked as a duplicate of bug 971783 ***

Comment 2 Petr Muller 2013-06-07 11:57:36 UTC
Sorry, got a bit confused. This is not a dup.

Comment 3 Petr Muller 2013-06-07 13:06:15 UTC
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 12:25:21 UTC
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 14:39:28 UTC
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 18:04:01 UTC
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.