qtest: Add hard disk geometry test
So far covers only IDE and tests only CMOS contents.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Merge remote-tracking branch 'mjt/mjt-iov2' into staging
qtest: Tidy up temporary files properly
Each test litters /tmp with several files: a pid file and twosockets. Tidy up.
fdc_test: update media_change test
After rewrite DSKCHG bit handling the test has to be updated. Nowis needed to seek to different track to clear DSKCHG bit.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc_test: introduce test_sense_interrupt
Calling sense interrupt status while there is no interrupt shouldreturn invalid command (0x80).
Read command should always returns in st0 seek_end bit set to 1.
qtest: fix infinite loop when QEMU aborts abruptly
From Markus:
Makes "make check" hang:
QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64 gtester -k --verbose -m=quick tests/crash-test tests/rtc-test TEST: tests/crash-test... (pid=972) qemu-system-x86_64: Device needs media, but drive is empty...
libqtest: Fix socket_accept() to pass address_len
accept() expects address_len to point to the length of the sockaddr oninput. Initialize it accordingly.
Resolves an assertion due to EFAULT on illumos.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
qtest: add a fuzz test to fdc-test
Add a simple register fuzzing test to floppy controller tests.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qemu-iotests: add qcow2.py set-feature-bit command
This new command sets feature bits in the image file header:
qcow2.py set-feature-bit incompatible|compatible|autoclear <bit>
The bit number must be in the range [0, 64).
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
qemu-iotests: add 036 autoclear feature bit test
This new test validates the autoclear feature bit behavior. When QEMUopens a qcow2v3 image file with an unknown autoclear feature bit the bitshould be cleared in the image file header.
qemu-iotests: fill streaming test image with data
The TestStreamStop test case is racy; if the job completes before we cancancel it, it fails. If we remove the sleep the job will be canceledbefore it has even started, and the test succeeds but it is also not...
qemu-iotests: start vms in qtest mode
This way, they will not execute any VM code at all. However, right nowthe cancellation test is "relying" on being slowed down by TCG executingBIOS code. So, change the timeouts.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qemu-iotests: Some backing file COW tests
Looks like we're still missing these very basic tests for backing filehandling.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
qemu-iotests: COW with many AIO requests on the same cluster
This one is a bit more interesting. The COW operation isn't performedcompletely synchronously, and therefore dependencies must be handledcorrectly when multiple requests write to the same unallocated cluster....
fdc-test: introduced qtest read_without_media
If you try to read from a floppy drive without a media, you should getan abnormal termination error.
rewrite iov_send_recv() and move it to iov.c
Make it much more understandable, add a missingiov_cnt argument (number of iovs in the iov), andadd comments to it.
The new implementation has been extensively testedby splitting a large buffer into many small...
Merge remote-tracking branch 'afaerber-or/qom-next-1' into staging
target-xtensa: add MMU pagewalking tests
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qapi: Unit tests for visitor-based serialization
Currently we test our visitors individually, and seperately for inputvs. output. This is useful for validating internal representationsagainst the native C types and vice-versa, and other visitor-specific...
qapi: String visitor, use %f representation for floats
Currently string-output-visitor formats floats as %g, which is nice inthat trailing 0's are automatically truncated, but otherwise this causessome issues:
- it uses 6 significant figures instead of 6 decimal places, which...
qapi: Add String visitor coverage to serialization unit tests
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
rewrite iov_* functions
This changes implementations of all iov_*functions, completing the previous step.
All iov_* functions now ensure that this offsetargument is within the iovec (using assertion),but lets to specify `bytes' value larger thanactual length of the iovec - in this case they...
build: do not sprinkle around GENERATED_HEADERS dependencies
Keeping GENERATED_HEADERS dependencies up-to-date everywhere is complex.We can simply make the Makefile depend on them, and they will be builtbefore all other targets.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
fdc-test: introduced qtest no_media_on_start and cmos qtest for floppy
As default a guest has always one floppy drive so 0x10 byte in CMOShas to have 0x40 value. Higher 4 bits means that the first floppy driveis 1.44 Mb 3"5 drive and lower 4 bits means the second drive is not present....
qemu-iotests: mark 035 qcow2-only
The 035 parallel aio write test relies on knowledge of qcow2 metadatalayout to stress parallel L2 table accesses. This only works for qcow2unless we add additional calculations for qed or other formats.
Mark this test as qcow2-only....
tests: Add rtc-test (fix test regression)
Commit 93e9eb6808c886f5f1c903b7ced1eed65de2ba39 added fdc-test,but accidentally removed rtc-test because check-qtest-i386-y wasnot enhanced but set twice.
This patch adds rtc-test again (and sorts both tests alphabetically)....
tests: Fix linker failure for fdc-test
When QEMU was built with the simple trace backend, linking failed:
LINK tests/fdc-testoslib-posix.o: In function `trace_qemu_memalign':qemu/bin/debug/x86/./trace.h:31: undefined reference to `trace3'oslib-posix.o: In function `trace_qemu_vmalloc':...
Merge remote-tracking branch 'sweil/for-1.1' into staging
fix some common typos
These were identified using: http://github.com/lyda/misspell-checkand run like this to create a bourne shell script using GNU sed's-i option:
git ls-files|grep -vF .bin | misspellings -f - |grep -v '^ERROR:' |perl \-pe 's/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/sed -i '\''${2}s!$3!$4!'\'' $1/'...
stream: do not copy unallocated sectors from the base
Unallocated sectors should really never be accessed by the guest,so there's no need to copy them during the streaming process.If they are read by the guest during streaming, guest-initiatedcopy-on-read will copy them (we're in the base == NULL case, which...
tests/Makefile: Add missing $(EXESUF)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
stream: add testcase for partial streaming
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
stream: fix sectors not allocated test
The test on sectors not allocated can fail if the L1/L2 tables arenot on disk yet. Allow tests to shutdown the VM early.
qtest: Add floppy test
Let's start with testing media change.
qemu-io: correctly print non-integer values as decimals
qemu-io's cvtstr function sometimes will incorrectly omit thedecimal part of the number, and sometimes will incorrectly includeit. This patch fixes both. The former is more serious, and canbe seen in the patches to 027.out and 033.out....
qemu-iotests: strip spaces from qemu-img/qemu-io/qemu command lines
A trailing space is left when qemu-img has no arguments, for example if-nocache is not used. This becomes an empty argument after split()and causes qemu-io to fail.
qtest: Add function to send QMP commands
qemu-iotests: ignore fragmentation information for qed
We added image fragmentation statistics functions to qemu-img several daysago, those patches will cause "./check -qed" failed. This patch will ignorefragmentation statistics information of qed format, and then "./check -qed"...
qemu-iotests: Many parallel allocating I/O requests
This test case manages to let qcow2 abort because its cache is used upand it can't find free cache entries for new requests any more.
qemu-iotests: add block-stream speed value test case
Add tests to exercise the InvalidParameter 'speed' error code path, aswell as the regular success case for setting the speed. Theblock-stream 'speed' parameter allows the speed limit of the job to be...
qtest: Fix more format errors with qtest_sendf
After adding GCC_FMT_ATTR to qtest_sendf, more format errors are reportedby the compiler. These are fixed here.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'origin/master' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
qtest: fix memread and memwrite on 32 bit hosts
Use PRIx64 to print 64 bit values to avoid truncationon 32 bit hosts.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'kwolf/for-anthony' into staging
qmp: make block job command naming consistent
The block streaming and job commands used '_' instead of '-' for reasonsof compatibility with libvirt, which already included support for the'_' naming. However, the semantics of block_job_cancel have changed and...
target-xtensa: add tests for LOOPNEZ and LOOPGTZ
qtest: add m48t59 tests for Sparc
Add simple m48t59 qtests, enable test only for Sparc32and Sparc64. On PPC, the device is behind PCI bus.
qemu-iotests: add a simple test for write_zeroes
qemu-iotests: Test backing file COW with zero clusters
qemu-iotests: Add -o and make v3 the default for qcow2
This adds an -o option to qemu-iotests, which is an option string thatis passed through to qemu-img create -o... This allows testing differentsubformat with a command like './check -qcow2 -o compat=0.10'....
qemu-iotests: Fix test 031 for qcow2 v3 support
qcow2.py must be updated to work with version 3 images at all, theoutput has changed since the feature table extension has been added, andversion 2 and version 3 images can't possibly have the same test output....
Add .gitignore for tests/
The new autotests in tests/ generate a number of files, bothexecutable and source, which are not caught by the existing .gitignorefiles. This patch adds a new .gitignore in tests/ which covers these.
[Changed 'rtc-test' to '*-test' so future tests do not need to be added...
iotests: Resolve test failures caused by hostname
`hostname -s` may output an errror:hostname: Name or service not knownThis causes all tests to fail for `make check-block`.
Suppress such error messages, letting the tests succeed.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
qtest: add register fuzzing to RTC test
qemu-iotests: Always filter cluster_size out in _make_test_img
Some image formats do have a cluster size, others don't, but there aretests that work with both sets of images and currently we get failuresbecause the qemu-img create output doesn't mention the cluster size for...
qemu-iotests: Test bdrv_close while AIO is in flight
If the BlockDriverState is closed/freed without draining the AIOrequests first, the request coroutines may work on invalid data and filedescriptors or have some dangling pointers that cause segfaults....
iotests: fix error in 005
According comment, we should not read again, we will write.
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests: remove .SECONDARY special target
The special target should not be needed anymore, and caused (perhapsdue to a Make bug) a failure with "make -j2". In any case, themain makefile is a better place for such special targets ratherthan an included makefile....
target-xtensa: add tests for LBEG/LEND invalidation
target-xtensa: add test for IBREAK invalidation
target-xtensa: improve unit tests debugging
- add testcase announcement;- add global symbols for individual tests;- add host-debug-* makefile target.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
qemu-iotests: Fix call syntax for qemu-io
qemu-io requires options first, then fixed parameters.
GNU getopt also allows options at the end, but POSIX getoptdoesn't. Try "export POSIXLY_CORRECT=y" to get the POSIXbehaviour with GNU getopt, too.
Cc: Kevin Wolf <kwolf@redhat.com>...
qemu-iotests: Fix call syntax for qemu-img
qemu-img requires first options, then file name, then size.
qemu-iotests: qcow2.py
This adds a tool that is meant to inspect and edit qcow2 files in alow-level way, that wouldn't be possible with qemu-img/io, for exampleby adding yet unknown extensions or flags. This way we can test whetherqemu deals properly with future backwards compatible extensions....
qemu-iotests: Test unknown qcow2 header extensions
The immportant thing here is that header extensions don't get silentlydropped when the header is rewritten, e.g. during a rebase.
tests: fix out-of-tree building for lm32 target
Signed-off-by: Michael Walle <michael@walle.cc>
qtest: avoid a warning with RTC test
Avoid this warning on OpenBSD: CC tests/rtc-test.o/src/qemu/tests/rtc-test.c: In function 'check_time':/src/qemu/tests/rtc-test.c:171: warning: format '%ld' expects type 'long int', but argument 2 has type 'time_t'...
qtest: fix out of tree build
Trace objects are also needed if tracing is enabled.
qtest: add rtc-test test-case
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
test makefile overhaul
This introduces new test reporting infrastructure based ongtester and gtester-report.
Also, all existing tests are moved to tests/, and tests/Makefileis reorganized to factor out the commonalities in the rules.
Signed-off-by: Anthony Liguori <aliguori@linux.vnet.ibm.com>...
qtest: add C version of test infrastructure
This also includes a qtest wrapper script to make it easier to launch qtesttests directly.
qapi: add strict mode to input visitor
While QMP in general is designed so that it is possible to ignoreunknown arguments, in the case of the QMP server it is better toreject them to detect bad clients. In fact, we're already doingthis at the top level in the argument checker. To extend this to...
test: add test-qmp-commands to make check
All the deps are here but the test was never added to the list of testsfor make check
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
test: remove qemu-ga reference
This was added by mistake a while back.
qemu-iotests: Mark some tests as quick
This creates a new test group 'quick' for some test case that take atmost a couple of seconds each, so that the group can be run during aquick 'make check'
make check: Add qemu-iotests subset
Run the 'quick' group from qemu-iotests during 'make check'.
Add 'make check-block'
Runs the full qemu-iotests suite for various image formats.
Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa
qemu-iotests: export TEST_DIR for non-bash tests
Since qemu-iotests may need to create large image files it is possibleto specify the test directory. The TEST_DIR variable needs to beexported so non-bash tests can make use of it.
qemu-iotests: add iotests Python module
Block layer tests that involve QMP commands rather than qemu-img orqemu-io are not well-suited for shell scripting. This patch adds aPython module which allows tests to be written in Python instead.
The basic API is:...
test: add image streaming tests
This patch adds a test suite for the image streaming feature. Itexercises the 'block_stream', 'block_job_cancel', 'block_job_set_speed',and 'query-block-jobs' QMP commands.
qemu-iotests: Filter out DOS line endings
This one makes it possible to run qemu-iotests on a Windows build using Wineand get somewhat meaningful results.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qemu-iotests: 026: Reduce output changes for cache=none qcow2
qemu-iotests supports the -nocache option which makes the tests run withcache=none. For blkdebug tests with qcow2 this means that we may seetest results that differ from cache=writethrough. This patch makes the...
qemu-iotests: Test rebase with short backing file
This tests that qemu-img rebase doesn't assume that the backing file hasthe same size as the image, but considers that it can be smaller.
Merge qemu-iotests into for-anthony
qemu-iotests: only run 016 for file and sheepdog protocols
016 writes past EOF which isn't support by most protocols, so limitit to file and sheepdog, which explicitly support it.
Pointed out by Josh Durgin <josh.durgin@dreamhost.com>.
Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: common.config: Fix no $TEST_DIR directory
mkdir $TEST_DIR on common.config first run
Signed-off-by: Mitnick Lyu <mitnick.lyu@gmail.com>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: Update rbd support
rbd implements bdrv_truncate, so test 025 will work.
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: add qed support to 025 image resize test
QED now supports the truncate (aka resize) operation for growing images.Update test 025 so it runs for QED.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: Update filter for default cluster size
Until recently, qemu-img create displayed cluster_size=0 for the defaultcluster size. It is changed to display the real cluster size now, which resultsin the cluster size not being filtered out any more....
qemu-iotests: test loading internal snapshots
Test loading internal snapshots where the L1 table of the snapshotis smaller than the current L1 table.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: check: print relevant path information
Print the paths of the programs under test(qemu, qemu-img and qemu-io).
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: common.config: Allow use of arbitrary qemu* paths
Since we might want to test arbitrary qemu, qemu-img andqemu-io paths, allow users to specify environment variablevalues for QEMU_PROG, QEMU_IMG_PROG and QEMU_IO_PROG sothe testsuite will use those values rather than find them...
qemu-iotests: add support for qed format
qemu-iotests: README: Fix spelling
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: filter IMGFMT correctly in 019
Test 019 can be run with qcow2 and qed image formats. Replace thespecific image format value with "IMGFMT" so the golden output does nothardcode qcow2 or qed.
This patch also includes a typo fix for "occurrences"....
qemu-iotests: add support for rbd and sheepdog protocols
This patch introduces tests for protocols other than file, andinitially supports rbd and sheepdog.
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: Use zero-based offsets for IO patterns
The io_pattern style functions have the following loop:
for i in `seq 1 $count`; do echo ... $(( start + i * step )) ... done
Offsets are 1-based so start=1024, step=512, count=4 yields:1536, 2048, 2560, 3072...