Hide Forgot
Description of problem: Some lines of v7 fv_tests execute successful but return Exception. Job link: https://beaker.engineering.redhat.com/jobs/58847 Example 1: --------------------------- Error log: ... virt-install --name v7x86_64 --ram 512 --disk path=/var/lib/libvirt/images/v7x86_64.img --disk path=/var/lib/libvirt/images/v7data.img --network network:default --vnc --import --noreboot --noautoconsole Error: could not generate guest config file. ... The command run successful, and the guest have started already. Run manually: # virt-install --name v7x86_64 --ram 512 --disk path=/var/lib/libvirt/images/v7x86_64.img --disk path=/var/lib/libvirt/images/v7data.img --network network:default --vnc --import --noreboot --noautoconsole Starting install... Creating domain... | 0 B 00:00 Domain creation completed. You can restart your domain by running: virsh --connect qemu:///system start v7x86_64 # virsh list Id Name State ---------------------------------- 1 v7x86_64 running # virsh start v7x86_64 error: Domain is already active Example 2: --------------------------------------------- Error log: ... Using loopback device /dev/loop0 for guest data image Error: could not mount data image "kpartx -av /dev/loop0" has output on stderr ... The command "kpartx -av /dev/loop0" run successful: # kpartx -l /dev/loop0 loop0p1 : 0 192717 /dev/loop0 63 In above cases, v7 test run abort and fail. But the guest can start manally by "virsh start v7x86_64"and pass. Version-Release number of selected component (if applicable): RHEL6.1 v7-1.3-10 How reproducible: always Steps to Reproduce: 1. install v7 and run one of fv_tests. 2. 3. Actual results: FAIL Expected results: PASS Additional info:
*** Bug 678946 has been marked as a duplicate of this bug. ***
Run manually : # losetup /dev/loop0 /var/lib/libvirt/images/v7x86_64.img # kpartx -av /dev/loop0 add map loop0p1 (253:3): 0 208782 linear /dev/loop0 63 add map loop0p2 (253:4): 0 12370050 linear /dev/loop0 208845 /dev/mapper/loop0p1: mknod for loop0p1 failed: File exists # echo $? 0 Although the failure exists, the execution of command "kpartx -av /dev/loop0" also pass. But when run command "Command("kpartx -av " + self.loopBackDevice).echo()", function _checkErrors() of command.py capture the failure and raise exception. Then v7 abort. The same issue happened in execution of "Command(virtInstall).echo()". I think it necessary to have a modification to function _run() and _checkErrors() of command.py.
Created attachment 484175 [details] fvtest.py with some added debug output
Please try the above patch.
I've reproduced this on a RHEL 6.1 system. Note the redirect of stderr: [root@hp-xw8400-01 ~]# virt-install --name v7x86_64 --ram 512 --disk path=/var/lib/libvirt/images/v7x86_64.img --disk path=/var/lib/libvirt/images/v7data.img --network network:default --vnc --import --noreboot --noautoconsole 2>stderr.txt Starting install... Domain creation completed. You can restart your domain by running: virsh --connect qemu:///system start v7x86_64 [root@hp-xw8400-01 ~]# more stderr.txt Creating domain... | 0 B 00:00 [root@hp-xw8400-01 ~]# So, it looks like virsh is putting some status messages on stderr now in 6.1. Not that this is a change (regression?) from 6.0.
Sorry, I meant that virtinstall was putting output on stderr, not virsh.
I've also reproduced the kpartx error: Guest has shutdown Using loopback device /dev/loop0 for guest data image Error: could not mount data image "kpartx -av /dev/loop0" has output on stderr /dev/mapper/loop0p1: mknod for loop0p1 failed: File exists As noted above, re-issuing this command manually works fine. This error looks more real than the virtinstall one.
Created attachment 485594 [details] fv test patch to work around spurious stderr output in virt-install and kpartx This patch uses some new V7CommandException subclasses to selectively ignore stderr output in these two cases.
Created attachment 485595 [details] command.py adding new V7CommandException subclasses.
This bug does not need a Tech Note because of: 1. A Red Hatter reported it 2. It only happened in an intermediate version.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: In v7 1.2, fv_* tests reported error while the tests finished successfully because of stderr output seen. This issue has been fixed in v7 1.3, now fv_* tests returns zero when tests finished successfully.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0497.html