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?
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.
Exactly, rlSoFarSoGood works for me as well.
What about implementing an optional parameter for rlPhaseEnd? rlPhaseStartSetup "Preparing things" rlRun "<install RHN Satellite>" rlPhaseEnd [command-on-failure] [command-on-success]
That could be enough, but what about we will decide later that failing assert in an abort phase causes immediate abort?
Aborting should occur at rlPhaseEnd, if we ever implement it, so that shouldn't be a problem :)
There's rl{Phase,Test}State which allows conditionals on the state of the test execution. Closing this.