#273 inventory: Include log output when VM fails to boot
Merged by astepano. Opened by stefw.
stefw/standard-test-roles log-output-when-no-boot  into  master

Download 273.patch

When the VM fails to boot, include PTY log output in the failure
message. This allows us to easily diagnose the problem without
looking through all the artifacts.

Example before:

 $ TEST_SUBJECTS=/data/src/cockpit/test_subject.qcow2 /data/src/standard-test-roles/inventory/standard-inventory-qcow2 --list 
 [ERROR] standard-inventory-qcow2: Could not access VM launched from qcow2 image: /data/src/cockpit/test_subject.qcow2

Example after:

$ TEST_SUBJECTS=/data/src/cockpit/test_subject.qcow2 /data/src/standard-test-roles/inventory/standard-inventory-qcow2 --list 
[ERROR] standard-inventory-qcow2: Could not access VM launched from qcow2 image: /data/src/cockpit/test_subject.qcow2
Last lines of test_subject.qcow2.guest.log:
             Starting Cleanup udevd DB...
[  OK  ] Started Cleanup udevd DB.
[  OK  ] Reached target Switch Root.
         Starting Switch Root...
[    1.862804] systemd-journald[221]: Received SIGTERM from PID 1 (systemd).
[    1.876696] systemd: 14 output lines suppressed due to ratelimiting
[    2.024293] audit: type=1404 audit(1541599093.990:2): enforcing=1 old_enforcing=0 auid=4294967295 ses=4294967295 enabled=1 old-enabled=1 lsm=selinux res=1
[    2.037514] systemd[1]: Failed to load SELinux policy.
[!!!!!!] Failed to load SELinux policy, freezing.
[    2.043585] systemd[1]: Freezing execution.

@mvadkert I'd like to add a test to standard-test-roles to cover my change. Where should I place that test so it would be run in this pull request?

@stefw: for PR to upstream source code we run only PEP8 checks: https://pagure.io/standard-test-roles/blob/master/f/tests/python-syntax.sh
Result for this PR you can find at: https://jenkins-fedora-atomic-process.apps.ci.centos.org/job/str_pr_test/227/
STI tests for STR are located at: https://src.fedoraproject.org/rpms/standard-test-roles/blob/master/f/tests there is no mechanism to trigger dist-git tests for PR to upstream code, as I know.

PR looks good, ACK to merge.

Commit 8fa1645d fixes this pull-request

Pull-Request has been merged by astepano

Pull-Request has been merged by astepano

Thank you for merging. I'll add a test for this once we get proper CI in this repo.

Metadata