Bug 999518 - Enable qemu-sanity-check in %check section of qemu.spec
Enable qemu-sanity-check in %check section of qemu.spec
Product: Fedora
Classification: Fedora
Component: qemu (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Virtualization Maintainers
Fedora Extras Quality Assurance
Depends On: 999108 1002189
  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:
Last Closed: 2013-08-28 13:08:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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.


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


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:
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:


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

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.

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:
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.



(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
%ifarch %{ix86}
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.