This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 682115 - RHEL 6.1 fv tests fail on spurious stderr output of virt-install and kpartx
RHEL 6.1 fv tests fail on spurious stderr output of virt-install and kpartx
Status: CLOSED ERRATA
Product: Red Hat Hardware Certification Program
Classification: Red Hat
Component: Test Suite (tests) (Show other bugs)
1.2
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Greg Nichols
Guangze Bai
:
: 678946 (view as bug list)
Depends On: 687526
Blocks: 865546
  Show dependency treegraph
 
Reported: 2011-03-04 02:57 EST by chen yuwen
Modified: 2015-02-08 16:36 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of:
: 865546 (view as bug list)
Environment:
Last Closed: 2011-05-09 12:15:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
fvtest.py with some added debug output (636 bytes, patch)
2011-03-14 09:17 EDT, Greg Nichols
no flags Details | Diff
fv test patch to work around spurious stderr output in virt-install and kpartx (22.88 KB, application/octet-stream)
2011-03-15 15:52 EDT, Greg Nichols
no flags Details
command.py adding new V7CommandException subclasses. (14.04 KB, patch)
2011-03-15 15:53 EDT, Greg Nichols
no flags Details | Diff

  None (edit)
Description chen yuwen 2011-03-04 02:57:29 EST
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:
Comment 1 chen yuwen 2011-03-04 03:01:15 EST
*** Bug 678946 has been marked as a duplicate of this bug. ***
Comment 3 chen yuwen 2011-03-14 02:52:00 EDT
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.
Comment 5 Greg Nichols 2011-03-14 09:17:52 EDT
Created attachment 484175 [details]
fvtest.py with some added debug output
Comment 6 Greg Nichols 2011-03-14 09:18:56 EDT
Please try the above patch.
Comment 7 Greg Nichols 2011-03-14 11:59:59 EDT
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.
Comment 8 Greg Nichols 2011-03-14 12:02:07 EDT
Sorry, I meant that virtinstall was putting output on stderr, not virsh.
Comment 9 Greg Nichols 2011-03-14 16:56:21 EDT
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.
Comment 12 Greg Nichols 2011-03-15 15:52:59 EDT
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.
Comment 13 Greg Nichols 2011-03-15 15:53:54 EDT
Created attachment 485595 [details]
command.py adding new V7CommandException subclasses.
Comment 17 Caspar Zhang 2011-05-01 05:58:17 EDT
This bug does not need a Tech Note because of:

1. A Red Hatter reported it
2. It only happened in an intermediate version.
Comment 18 Caspar Zhang 2011-05-01 05:58:17 EDT
    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.
Comment 19 errata-xmlrpc 2011-05-09 12:15:04 EDT
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

Note You need to log in before you can comment on or make changes to this bug.