Improve and simplify post_fail_hook existence checks
ClosedPublic

Authored by adamwill on Oct 28 2016, 1:36 AM.

Details

Summary

The current installedtest post_fail_hook assumes /var/tmp/abrt
exists at all, and dies if it doesn't, leading to no /var/log
upload. We can also avoid using openQA script_output - which
is annoyingly indirect and slow - by using this neat test -n
trick I found on SO. Let's also use it in the anacondatest
post_fail_hook to avoid uploading /var/tmp when it's empty
(which we currently do). This also drops the 0 arg from a few
more script_run calls, because it's safe to wait for the run
to complete and we should probably do so to avoid later typing
errors if the commands are slow.

Test Plan

Cause both anaconda and installed tests to fail and
check the hooks work as intended. Maybe twiddle the failures to
ensure directories do and don't exist and/or have contents and
make sure things work OK. I've tested this to some degree and
I'm pretty sure it works right.

Diff Detail

Repository
rOPENQATESTS os-autoinst-distri-fedora
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
adamwill retitled this revision from to Improve and simplify post_fail_hook existence checks.Oct 28 2016, 1:36 AM
adamwill updated this object.
adamwill edited the test plan for this revision. (Show Details)
adamwill added reviewers: jskladan, garretraziel.
garretraziel accepted this revision.Oct 31 2016, 12:24 PM

I've tested it in anacondatest and it looks OK.

This revision is now accepted and ready to land.Oct 31 2016, 12:24 PM
This revision was automatically updated to reflect the committed changes.