Description of problem: As rlRun now have -l option, it would be nice to have it's variant, something like -c (conditionaly) to include output only when command executed by rlRun fails. Version-Release number of selected component (if applicable): beaker-lib-0.4.64-0.el5.noarch Steps to Reproduce: 1. rlRun -c "blablabla" Expected results: If command failed, include output as with -l. Additional info: This will not add so big amount of data to journal as -l.
Created attachment 378483 [details] Added -c option for rlRun and tests for that
Fixing bug state.
I like the idea (it's a pity this was overlooked for so long), but the patch no longer applies. I've removed "Patch" keyword, I'll implement this in the next iteration if anything applying is not submitted again.
Created attachment 513599 [details] Series of patches to implement bug 547665
Created attachment 513601 [details] Add -c option to rlRun and unit-tests for it
Re-implemented against current git and added nice tests.
Reviewed and tested a bit, good to go. Thanks! I've did some follow-up work when testing this change: I've imposed a 50 line limit on the outputs (last 50 lines are logged) to avoid having huge logs in the journal: large logs should be analysed in separated files. The size of the limit is open to discussion, the existence of it is not :) Additionally, I've changed the way how the lines are logged, and cleaned some tests up. Previous result: rlRun -c 'notexists', during execution: gcc: error: notexists: No such file or directory gcc: fatal error: no input files compilation terminated. :: [18:56:48] :: [ INFO ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0 :: [18:56:48] :: gcc notexists gcc: error: notexists: No such file or directory gcc: fatal error: no input files compilation terminated. :: [ FAIL ] :: Running 'gcc notexists' (Expected 0, got 4) rlRun -c 'notexists', in rlJournalPrintText: :: [ INFO ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0 :: [ LOG ] :: gcc notexists\ngcc: error: notexists: No such file or directory :: [ LOG ] :: gcc: fatal error: no input files :: [ LOG ] :: compilation terminated. :: [ FAIL ] :: Running 'gcc notexists' (Expected 0, got 4) New result: rlRun -c 'notexists', during execution: gcc: error: notexists: No such file or directory gcc: fatal error: no input files compilation terminated. :: [18:58:25] :: [ INFO ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0 :: [18:58:26] :: Output of 'gcc notexists': :: [18:58:26] :: --------------- OUTPUT START --------------- :: [18:58:26] :: gcc: error: notexists: No such file or directory :: [18:58:26] :: gcc: fatal error: no input files :: [18:58:26] :: compilation terminated. :: [18:58:26] :: --------------- OUTPUT END --------------- :: [ FAIL ] :: Running 'gcc notexists' (Expected 0, got 4) rlRun -c 'notexists', in rlJournalPrintText: :: [ INFO ] :: rlRun: command = 'gcc notexists'; exitcode = 4; expected = 0 :: [ LOG ] :: Output of 'gcc notexists': :: [ LOG ] :: --------------- OUTPUT START --------------- :: [ LOG ] :: gcc: error: notexists: No such file or directory :: [ LOG ] :: gcc: fatal error: no input files :: [ LOG ] :: compilation terminated. :: [ LOG ] :: --------------- OUTPUT END --------------- :: [ FAIL ] :: Running 'gcc notexists' (Expected 0, got 4)
Created attachment 514744 [details] rlRun logging limit, improvements and test cleanup
Pushed it all, please scream at me if you do not like comment 7 stuff :) http://git.fedorahosted.org/git?p=beakerlib.git;a=commit;h=a5b171a8542eb8c8685e249ceeda673773d67583 http://git.fedorahosted.org/git?p=beakerlib.git;a=commit;h=f225d2427a7f48a82ff95033f9149ba55cf117e8 http://git.fedorahosted.org/git?p=beakerlib.git;a=commit;h=93ee584965c50b205cdd966e404b080b3e45b3ae http://git.fedorahosted.org/git?p=beakerlib.git;a=commit;h=5d421592e4d1c2869a4003452fec76eb53c284e7 http://git.fedorahosted.org/git?p=beakerlib.git;a=commit;h=ee5b22bf7701b3aef9ee5f6fdfada889450b902a http://git.fedorahosted.org/git?p=beakerlib.git;a=commit;h=463e45859cb154f9a5ab04b0ecd0ae43adcadf78 http://git.fedorahosted.org/git?p=beakerlib.git;a=commit;h=9ddfe6b6e5952bfd3122cf8fee6636d24f66b574
beakerlib-1.6-1 is already in fedora