Bug 999518 - Enable qemu-sanity-check in %check section of qemu.spec
Enable qemu-sanity-check in %check section of qemu.spec
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
:
Depends On: 999108 1002189
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-21 09:15 EDT by Richard W.M. Jones
Modified: 2013-08-28 13:08 EDT (History)
9 users (show)

See Also:
Fixed In Version: qemu-1.6.0-5.fc21
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-28 13:08:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to qemu.spec (1.04 KB, patch)
2013-08-21 09:15 EDT, Richard W.M. Jones
no flags Details | Diff

  None (edit)
Description Richard W.M. Jones 2013-08-21 09:15:56 EDT
Created attachment 788871 [details]
Patch to qemu.spec

Description of problem:

About a year ago I wrote a small qemu/kernel "sanity checker".  It
simply checks that a given kernel boots on a given qemu.  It works
by having a small initramfs which prints a "hello world"-style message,
and we check the serial port output of the qemu process to ensure
the message is eventually printed.  It's a sanity check, not a full
test of functionality.

http://people.redhat.com/~rjones/qemu-sanity-check/

I'm now trying to get this packaged in Fedora.  See:

https://bugzilla.redhat.com/show_bug.cgi?id=999108

Once it's packaged in Fedora, I think qemu should use it, to start
with as an advisory test, but eventually as a mandatory test (the
difference is the advisory test just prints a message but does not
stop the build).

Version-Release number of selected component (if applicable):

qemu 1.6.0-4.fc21

Additional info:

See attachment, which is the suggested change to qemu.spec.
Comment 1 Richard W.M. Jones 2013-08-21 09:22:13 EDT
Scratch build with the patch:
http://koji.fedoraproject.org/koji/taskinfo?taskID=5836862
Comment 2 Richard W.M. Jones 2013-08-21 09:22:46 EDT
(In reply to Richard W.M. Jones from comment #1)
> Scratch build with the patch:
> http://koji.fedoraproject.org/koji/taskinfo?taskID=5836862

Of course, ignore that, qemu-sanity-checker isn't in Fedora yet :-(
Comment 3 Richard W.M. Jones 2013-08-22 16:50:24 EDT
Scratch build:

http://koji.fedoraproject.org/koji/taskinfo?taskID=5842962

If you search through the build log for the string "qemu-sanity-check"
you should see the test running (successfully):

http://kojipkgs.fedoraproject.org//work/tasks/2964/5842964/build.log
Comment 4 Richard W.M. Jones 2013-08-28 10:26:07 EDT
I have pushed this to Rawhide only (qemu-1.6.0-5.fc21).
It's an advisory test only.

http://koji.fedoraproject.org/koji/taskinfo?taskID=5864749
Comment 5 Richard W.M. Jones 2013-08-28 11:04:38 EDT
Lucky it's advisory because the test is failing for some
reason with:

+ qemu-sanity-check --qemu=x86_64-softmmu/qemu-system-x86_64
ls: cannot access /boot/vmlinuz-*.x86_64: No such file or directory
/usr/bin/qemu-sanity-check: cannot find a Linux kernel in /boot
Choose a kernel to test using --kernel=/path/to/vmlinuz
+ :
+ exit 0

I'll leave this bug open while I work out what's wrong.
Comment 6 Richard W.M. Jones 2013-08-28 11:17:37 EDT
It turns out that 'BuildRequires: kernel' picks 'kernel-debug'
(both 'kernel' and 'kernel-debug' provide the 'kernel' dependency,
although why yum picks the -debug one is anyone's guess).

Anyway, kernel-debug has a file:
/boot/vmlinuz-3.11.0-0.rc7.git0.1.fc21.x86_64+debug
which does not match what qemu-sanity-check is expecting
(/boot/vmlinuz-*.x86_64).  This is a bug in qemu-sanity-check
since the +debug kernel would be a reasonable choice (bug 1002189).
Comment 7 Richard W.M. Jones 2013-08-28 13:08:08 EDT
I've fixed bug 1002189 and done a scratch-build of qemu
against the new qemu-sanity-check-1.1.4-2.fc21, and it passed.

http://koji.fedoraproject.org/koji/taskinfo?taskID=5865652

Notes:

(1) The output:

+ qemu-sanity-check --qemu=x86_64-softmmu/qemu-system-x86_64
Could not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
+ exit 0

is *correct*!  KVM just prints this spew when it falls back
to using TCG.

(2) Only x86-64 runs the test.

We could enable it on i686 too, but I didn't do that because
it would require a big conditional to find the right
qemu-system-* binary to run, something like:

%ifarch x86_64
qemu=x86_64-softmmu/qemu-system-x86_64
%else
%ifarch %{ix86}
qemu=i386-softmmu/qemu-system-i386
%endif
%endif
qemu-sanity-check --qemu=$qemu || :

(3) It's known to fail on ARM.

(4) I checked and qemu will automatically locate its BIOS
files in a directory relative to the location of the binary.
So we don't need to pass the -L option to qemu, and as we
can see from the scratch build it evidently does work.

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