Bug 481127 - [RFE] provide rlBundleLogsIfPhaseFails
Summary: [RFE] provide rlBundleLogsIfPhaseFails
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Petr Muller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-22 09:45 UTC by Jan Hutař
Modified: 2016-09-20 02:05 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-03-06 17:09:19 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jan Hutař 2009-01-22 09:45:41 UTC
Description of problem:
function like rlBundleLogsIfPhaseFails would be great for me:

  rlPhaseStartSetup "Preparing things"
  rlBundleLogsIfPhaseFails /var/log/rhn/*.log
  rlRun "<install RHN Satellite>"
  rlPhaseEnd

Things to consider:

  * once we will include real *abort* functionality in the Setup phases,
    this should still work (we have to possibilities: abort when failed
    assert is detected, or abort when ending phase which contains failed
    asserts)
  * in case of the failure, logs should be colected at the *end* of the phase
    (or when we are leaving it - see previous point)


Additional info:
What do you think about this? We do not have any way how to determine if some assert before failed right?

Comment 1 Ales Zelinka 2009-01-22 10:04:02 UTC
Why not just put rlBundleLogs /var/log/rhn/*.log right before rlPhaseEnd?

My guess is those logs are huge and you want to save rhts's disk space by not sending them when things work? 

ad> We do not have any way how to determine if some
assert before failed right?

true (afaik). I briefly checked the code and it seems all asserts return non-0 when they fail, so there is at least the possibility to store current state (although very clumsy).

Something like "rlSoFarSoGood" seems useful but I've not yet needed it in any of my tests.

Comment 2 Jan Hutař 2009-01-22 13:37:54 UTC
Exactly, rlSoFarSoGood works for me as well.

Comment 3 Petr Šplíchal 2009-01-22 15:56:04 UTC
What about implementing an optional parameter for rlPhaseEnd?

rlPhaseStartSetup "Preparing things"
    rlRun "<install RHN Satellite>"
rlPhaseEnd [command-on-failure] [command-on-success]

Comment 4 Jan Hutař 2009-01-23 13:03:53 UTC
That could be enough, but what about we will decide later that failing assert in an abort phase causes immediate abort?

Comment 5 Petr Muller 2009-03-03 19:18:45 UTC
Aborting should occur at rlPhaseEnd, if we ever implement it, so that shouldn't be a problem :)

Comment 7 Petr Muller 2013-03-06 17:09:19 UTC
There's rl{Phase,Test}State which allows conditionals on the state of the test execution. Closing this.


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