summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell2017-08-313-5/+87
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging # gpg: Signature made Thu 31 Aug 2017 09:21:49 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: qcow2: allocate cluster_cache/cluster_data on demand qemu-doc: Add UUID support in initiator name tests: migration/guestperf Python 2.6 argparse compatibility docker.py: Python 2.6 argparse compatibility scripts: add argparse module for Python 2.6 compatibility misc: Remove unused Error variables oslib-posix: Print errors before aborting on qemu_alloc_stack() throttle: Test the valid range of config values throttle: Make burst_length 64bit and add range checks throttle: Make LeakyBucket.avg and LeakyBucket.max integer types throttle: Remove throttle_fix_bucket() / throttle_unfix_bucket() throttle: Make throttle_is_valid() a bit less verbose throttle: Update the throttle_fix_bucket() documentation throttle: Fix wrong variable name in the header documentation nvme: Fix get/set number of queues feature, again Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tests: migration/guestperf Python 2.6 argparse compatibilityStefan Hajnoczi2017-08-301-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Add the scripts/ directory to sys.path so Python 2.6 will be able to import argparse. Cc: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: John Snow <jsnow@redhat.com> Acked-by: Fam Zheng <famz@redhat.com> Message-id: 20170825155732.15665-4-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * docker.py: Python 2.6 argparse compatibilityStefan Hajnoczi2017-08-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add the scripts/ directory to sys.path so Python 2.6 will be able to import argparse. Cc: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: John Snow <jsnow@redhat.com> Acked-by: Fam Zheng <famz@redhat.com> Message-id: 20170825155732.15665-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * throttle: Test the valid range of config valuesAlberto Garcia2017-08-291-0/+77
| | | | | | | | | | | | Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: a57dd6274e1b6dc9c28769fec4c7ea543be5c5e3.1503580370.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * throttle: Make LeakyBucket.avg and LeakyBucket.max integer typesAlberto Garcia2017-08-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both the throttling limits set with the throttling.iops-* and throttling.bps-* options and their QMP equivalents defined in the BlockIOThrottle struct are integer values. Those limits are also reported in the BlockDeviceInfo struct and they are integers there as well. Therefore there's no reason to store them internally as double and do the conversion everytime we're setting or querying them, so this patch uses uint64_t for those types. Let's also use an unsigned type because we don't allow negative values anyway. LeakyBucket.level and LeakyBucket.burst_level do however remain double because their value changes depending on the fraction of time elapsed since the previous I/O operation. Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: f29b840422767b5be2c41c2dfdbbbf6c5f8fedf8.1503580370.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-08-30' into ↵Peter Maydell2017-08-316-82/+245
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging nbd patches for 2017-08-30 - Kashyap Chamarthy: qemu-iotests: Extend non-shared storage migration test (194) - Stefan Hajnaczi: 0/3 nbd-client: enter read_reply_co during init to avoid crash - Vladimir Sementsov-Ogievskiy: portions of 0/17 nbd client refactoring and fixing # gpg: Signature made Wed 30 Aug 2017 19:03:46 BST # gpg: using RSA key 0xA7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" # gpg: aka "[jpeg image of size 6874]" # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-nbd-2017-08-30: block/nbd-client: refactor request send/receive block/nbd-client: rename nbd_recv_coroutines_enter_all block/nbd-client: get rid of ssize_t nbd/client: fix nbd_send_request to return int nbd/client: refactor nbd_receive_reply nbd/client: refactor nbd_read_eof nbd/client: fix nbd_opt_go qemu-iotests: test NBD over UNIX domain sockets in 083 qemu-iotests: improve nbd-fault-injector.py startup protocol nbd-client: avoid read_reply_co entry if send failed qemu-iotests: Extend non-shared storage migration test (194) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | nbd/client: refactor nbd_read_eofVladimir Sementsov-Ogievskiy2017-08-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor nbd_read_eof to return 1 on success, 0 on eof, when no data was read and <0 for other cases, because returned size of read data is not actually used. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20170804151440.320927-3-vsementsov@virtuozzo.com> [eblake: tweak function comments, rebase to test 083 enhancements] Signed-off-by: Eric Blake <eblake@redhat.com>
| * | qemu-iotests: test NBD over UNIX domain sockets in 083Stefan Hajnoczi2017-08-303-71/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 083 only tests TCP. Some failures might be specific to UNIX domain sockets. A few adjustments are necessary: 1. Generating a port number and waiting for server startup is TCP-specific. Use the new nbd-fault-injector.py startup protocol to fetch the address. This is a little more elegant because we don't need netstat anymore. 2. The NBD filter does not work for the UNIX domain sockets URIs we generate and must be extended. 3. Run all tests twice: once for TCP and once for UNIX domain sockets. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20170829122745.14309-4-stefanha@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
| * | qemu-iotests: improve nbd-fault-injector.py startup protocolStefan Hajnoczi2017-08-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently 083 waits for the nbd-fault-injector.py server to start up by looping until netstat shows the TCP listen socket. The startup protocol can be simplified by passing a 0 port number to nbd-fault-injector.py. The kernel will allocate a port in bind(2) and the final port number can be printed by nbd-fault-injector.py. This should make it slightly nicer and less TCP-specific to wait for server startup. This patch changes nbd-fault-injector.py, the next one will rewrite server startup in 083. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20170829122745.14309-3-stefanha@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
| * | qemu-iotests: Extend non-shared storage migration test (194)Kashyap Chamarthy2017-08-302-9/+25
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the follow-up patch that was discussed[*] as part of feedback to qemu-iotest 194. Changes in this patch: - Supply 'job-id' parameter to `drive-mirror` invocation. - Once migration completes, issue QMP `block-job-cancel` command on the source QEMU to gracefully complete `drive-mirror` operation. - Once the BLOCK_JOB_COMPLETED event is emitted, stop the NBD server on the destination QEMU. - Check for both the events: MIGRATION and BLOCK_JOB_COMPLETED. With the above, the test will also be (almost) in sync with the procedure outlined in the document 'live-block-operations.rst'[+] (section: "QMP invocation for live storage migration with ``drive-mirror`` + NBD"). [*] https://lists.nongnu.org/archive/html/qemu-devel/2017-08/msg04820.html -- qemu-iotests: add 194 non-shared storage migration test [+] https://git.qemu.org/gitweb.cgi?p=qemu.git;a=blob;f=docs/interop/live-block-operations.rst Signed-off-by: Kashyap Chamarthy <kchamart@redhat.com> Message-Id: <20170829165058.8229-1-kchamart@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* | tests: Add network filter tests to the check-qtest-s390x listThomas Huth2017-08-304-9/+36
| | | | | | | | | | | | | | | | | | | | | | With some small modifications, we can also use the the netfilter, the filter-mirror and the filter-redirector tests on s390x. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <1502951113-4246-3-git-send-email-thuth@redhat.com> Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* | tests: Run filter-redirector and -mirror test only on POSIX systemsThomas Huth2017-08-303-19/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | This way we can get rid of the ugly #ifdefs in the code which makes it easier to extend later. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <1502951113-4246-2-git-send-email-thuth@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* | tests/pxe: Check virtio-net-ccw on s390xThomas Huth2017-08-303-0/+28
| | | | | | | | | | | | | | | | | | | | | | Now that we've got a firmware that can do TFTP booting on s390x (i.e. the pc-bios/s390-netboot.img), we can enable the PXE tester for this architecture, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <1502431076-22849-3-git-send-email-thuth@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* | tests/boot-sector: Do not overwrite the x86 buffer on other architecturesThomas Huth2017-08-301-15/+26
|/ | | | | | | | | | | | | | | Re-using the boot_sector code buffer from x86 for other architectures is not very nice, especially if we add more architectures later. It's also ugly that the test uses a huge pre-initialized array at all - the size of the executable is very huge due to this array. So let's use a separate buffer for each architecture instead, allocated from the heap, so that we really just use the memory that we need. Suggested-by: Michael Tsirkin <mst@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <1502431076-22849-2-git-send-email-thuth@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* qemu-iotests: add 194 non-shared storage migration testStefan Hajnoczi2017-08-234-0/+100
| | | | | | | | | | | | Non-shared storage migration with NBD and drive-mirror is currently not tested by qemu-iotests. This test case covers the basic migration scenario. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Based-on: <20170823134242.12080-1-famz@redhat.com> Message-Id: <20170823140506.28723-1-stefanha@redhat.com> Tested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* boot-serial-test: prefer tcg acceleratorCornelia Huck2017-08-221-1/+5
| | | | | | | | | | Prefer to use the tcg accelarator if it is available: This is our only real smoke test for tcg, and fast enough to use it for that. Fixes: 480bc11e6 ("boot-serial-test: fallback to kvm accelerator") Reported-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
* iotests: Add non-shared storage migration case 192Fam Zheng2017-08-153-0/+71
| | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170815130740.31229-5-famz@redhat.com> Tested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* qemu-iotests: step clock after each test iterationStefan Hajnoczi2017-08-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 093 throttling test submits twice as many requests as the throttle limit in order to ensure that we reach the limit. The remaining requests are left in-flight at the end of each test iteration. Commit 452589b6b47e8dc6353df257fc803dfc1383bed8 ("vl.c/exit: pause cpus before closing block devices") exposed a hang in 093. This happens because requests are still in flight when QEMU terminates but QEMU_CLOCK_VIRTUAL time is frozen. bdrv_drain_all() hangs forever since throttled requests cannot complete. Step the clock at the end of each test iteration so in-flight requests actually finish. This solves the hang and is cleaner than leaving tests in-flight. Note that this could also be "fixed" by disabling throttling when drives are closed in QEMU. That approach has two issues: 1. We must drain requests before disabling throttling, so the hang cannot be easily avoided! 2. Any time QEMU disables throttling internally there is a chance that malicious users can abuse the code path to bypass throttling limits. Therefore it makes more sense to fix the test case than to modify QEMU. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20170815130502.8736-1-stefanha@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
* docker: add centos7 imagePhilippe Mathieu-Daudé2017-08-151-0/+31
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170728233316.13352-5-f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: install more packages on CentOS to extend code coveragePhilippe Mathieu-Daudé2017-08-151-0/+10
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170728233316.13352-4-f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: add Xen libs to centos6 imagePhilippe Mathieu-Daudé2017-08-151-1/+2
| | | | | | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170728233316.13352-3-f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* docker: use one package per line in CentOS configPhilippe Mathieu-Daudé2017-08-151-4/+14
| | | | | | | | | This ease rebase/cherry-pick, also it is faster to visually find if a package is here. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20170728233316.13352-2-f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* Makefile: Let "make check-help" work without running ./configureFam Zheng2017-08-151-21/+25
| | | | | | | | | | | | | | | | | | | | | | Currently if you do "make check-help" in a fresh checkout, only an error is printed which is not nice: $ make check-help V=1 cc -nostdlib -o check-help.mo cc: fatal error: no input files compilation terminated. rules.mak:115: recipe for target 'check-help.mo' failed make: *** [check-help.mo] Error 1 Move the config-host.mak condition into the body of tests/Makefile.include and always include the rule for check-help. Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170810085025.14076-1-famz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
* Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into ↵Peter Maydell2017-08-143-21/+5Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging trivial patches for 2017-08-14 # gpg: Signature made Mon 14 Aug 2017 12:07:03 BST # gpg: using RSA key 0x701B4F6B1A693E59 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59 * remotes/mjt/tags/trivial-patches-fetch: hw/misc/mmio_interface: Return after error_setg() to avoid crash qemu-iotests: remove comment about root privileges requirement qemu-iotests: remove commented out variables qemu-iotests: get rid of _full_imgproto_details() qemu-doc: Fix "-net van" typo libqtest: Fix typo in comments unicore32: abort when entering "x 0" on the monitor Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * qemu-iotests: remove comment about root privileges requirementCleber Rosa2017-08-141-6/+0Star
| | | | | | | | | | | | | | | | | | | | The check script contains a commented out root user requirement, probably because of its xfstests heritage. This requirement doesn't apply to qemu-iotests, so it better be gone. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * qemu-iotests: remove commented out variablesCleber Rosa2017-08-141-4/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | The variables FULL_MKFS_OPTIONS and FULL_MOUNT_OPTIONS are commented out, never used, and even refer to functions that do exist. The last time these were touched was around 8 years ago, so I guess it's safe to assume outputting such information on test execution is still on the radar. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * qemu-iotests: get rid of _full_imgproto_details()Cleber Rosa2017-08-142-7/+1Star
| | | | | | | | | | | | | | | | | | | | Although this function is used, its implementation does nothing besides echoing a variable name. There's no need to wrap this functionality in a function, and based on the one usage it has, it's not even required to adhere to a convention or code style. Signed-off-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
| * libqtest: Fix typo in commentsEric Blake2017-08-141-4/+4
| | | | | | | | | | | | | | | | s/continuosly/continuously/ Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | Merge remote-tracking branch ↵Peter Maydell2017-08-141-2/+3
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/cohuck/tags/boot-serial-no-tcg-20170811' into staging Fix the boot-serial test to work with the new --disable-tcg. # gpg: Signature made Fri 11 Aug 2017 14:55:15 BST # gpg: using RSA key 0xDECF6B93C6F02FAF # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" # gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" # gpg: aka "Cornelia Huck <cohuck@kernel.org>" # gpg: aka "Cornelia Huck <cohuck@redhat.com>" # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck/tags/boot-serial-no-tcg-20170811: boot-serial-test: fallback to kvm accelerator Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * boot-serial-test: fallback to kvm acceleratorCornelia Huck2017-08-111-2/+3
| | | | | | | | | | | | | | | | | | | | Currently, at least x86_64 and s390x support building with --disable-tcg. Instead of forcing tcg (which causes the test to fail on such builds), allow to use kvm as well. Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
* | qemu-iotests: fix 185Vladimir Sementsov-Ogievskiy2017-08-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 185 can sometimes produce wrong output like this: 185 2s ... - output mismatch (see 185.out.bad) --- /work/src/qemu/master/tests/qemu-iotests/185.out 2017-07-14 \ 15:14:29.520343805 +0300 +++ 185.out.bad 2017-08-07 16:51:02.231922900 +0300 @@ -37,7 +37,7 @@ {"return": {}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, \ "event": "SHUTDOWN", "data": {"guest": false}} -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, \ "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", \ "len": 4194304, "offset": 4194304, "speed": 65536, "type": \ "mirror"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, \ "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", \ "len": 0, "offset": 0, "speed": 65536, "type": "mirror"}} === Start backup job and exit qemu === Failures: 185 Failed 1 of 1 tests This is because, under heavy load, the quit can happen before the first iteration of the mirror request has occurred. To make sure we've had time to iterate, let's just add a sleep for 0.5 seconds before quitting. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | tests/multiboot: Fix whitespace failureEric Blake2017-08-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b43671f8 accidentally broke run_test.sh within tests/multiboot; due to a subtle change in whitespace. These two commands produce theh same output (at least, for sane $IFS of space-tab-newline): echo -e "...$@..." echo -e "...$*..." But that's only because echo inserts spaces between multiple arguments (the $@ case), while the $* form gives a single argument to echo with the spaces already present. But when converting to printf %b, there are no automatic spaces between multiple arguments, so we HAVE to use $*. It doesn't help that run_test.sh isn't part of 'make check'. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | IDE: test flush on empty CDROMKevin Wolf2017-08-101-0/+19
|/ | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20170809160212.29976-3-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* libqtest: always set up signal handler for SIGABRTJens Freimann2017-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently abort handlers only work for the first test function in a testcase, because the list of abort handlers is not properly cleared when qtest_quit() is called. qtest_quit() only deletes the kill_qemu_hook but doesn't completely clear the abrt_hooks list. The effect is that abrt_hooks.is_setup is never set to false and in a following test the abrt_hooks list is not initialized and setup_sigabrt_handler() is not called. One way to solve this is to clear the list in qtest_quit(), but that means only asserts between qtest_start and qtest_quit will be catched by the abort handler. We can make abort handlers work in all cases if we always setup the signal handler for SIGABRT in qtest_init. Signed-off-by: Jens Freimann <jfreimann@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* acpi-test: update expected DSDT filesMichael S. Tsirkin2017-08-095-0/+0
| | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* qemu-iotests: Test reopen between read-only and read-writeKevin Wolf2017-08-083-0/+88
| | | | | | | | | | This serves as a regression test for the bugs that were just fixed for bdrv_reopen() between read-only and read-write mode. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
* block/null: Remove 'filename' optionKevin Wolf2017-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | This option was only added to allow 'null-co://' and 'null-aio://' as filenames, its value never served any actual purpose and was ignored. Nevertheless it was accepted as '-drive driver=null,filename=foo'. The correct way to enable the protocol prefixes (and that without adding a useless -drive option) is implementing .bdrv_parse_filename. This is what this patch does. Technically, this is an incompatible change, but the null block driver is only used for benchmarking, testing and debugging, and an option without effect isn't likely to be used by anyone anyway, so no bad effects are to be expected. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests/109: Fix lock race conditionCleber Rosa2017-08-082-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | A race condition is currently present between the clean up attempt of the QEMU process and the execution of qemu-img. The actual (bad) output is: -Warning: Image size mismatch! -Images are identical. +qemu-img: Could not open '<build_dir>/tests/qemu-iotests/scratch/t.raw': Failed to get "consistent read" lock +Is another process using the image? A KILL signal is sent to the QEMU process, but qemu-img may begin to run before the QEMU process is really gone. qemu-img will then attempt to open the TEST_IMG file before it can secure a lock on it. This attempts a more graceful shutdown, and waits for the QEMU process to exit. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* build-sys: add --disable-vhost-userMarc-André Lureau2017-08-031-3/+3
| | | | | | | | | | | | | | | | | | | | Learn to compile out vhost-user (net, scsi & upcoming users). Keep it enabled by default on non-win32, that is assumed to be POSIX. Fail if trying to enable it on win32. When trying to make a vhost-user netdev, it gives the following error: -netdev vhost-user,id=foo,chardev=chr-test: Parameter 'type' expects a netdev backend type And similar error with the HMP/QMP monitors. While at it, rename CONFIG_VHOST_NET_TEST CONFIG_VHOST_USER_NET_TEST since it's a vhost-user specific variable. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* tests/hmp: Fix typo in the 'chardev-send-break' testThomas Huth2017-08-021-1/+1
| | | | | | | | | | | | | testchardev2 is not a valid chardev id here. Use testchardev1 instead which has been created with chardev-add right before the 'chardev-send-break' line. And while we're at it, add the test-hmp.c file to the MAINTAINERS file, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-id: 1501149097-19071-1-git-send-email-thuth@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2017-08-023-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pc, acpi, virtio: fixes, test speedup for rc1 Some fixes all over the place. Notably vhost-user gained a new message to set endian-ness. Borderline for 2.10 but seems to be the only way to fix legacy guests. Also pc tests are run on kvm now. Not a fix at all but doesn't touch qemu itself, so I merged it since I had to run these a lot and I just got tired of waiting for these to finish. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Tue 01 Aug 2017 22:36:47 BST # gpg: using RSA key 0x281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: pc: acpi: force FADT rev1 for 440fx based machine types pc: make 'pc.rom' readonly when machine has PCI enabled vhost-user: fix watcher need be removed when vhost-user hotplug tests/bios-tables-test: Compiler warning fix accel: cleanup error output intel_iommu: use access_flags for iotlb intel_iommu: fix iova for pt vhost-user: fix legacy cross-endian configurations vhost: fix a memory leak tests: switch pxe and vm gen id tests to use kvm Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * tests/bios-tables-test: Compiler warning fixDr. David Alan Gilbert2017-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc 7.1.1 in fedora 26 moans about the: tables = g_new0(uint32_t, tables_nr) because it can't convince itself that tables_nr is positive. This is fallout from g_assert_cmpint no longer necessarily being no-return; replace it with a plain g_assert. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
| * tests: switch pxe and vm gen id tests to use kvmMichael S. Tsirkin2017-08-012-2/+2
| | | | | | | | | | | | | | | | | | | | Speed up tests on host systems with kvm support. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Thomas Huth <thuth@redhat.com> Cc: Laurent Vivier <lvivier@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell2017-08-011-30/+126
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Xen fix (Anthony) * chardev fixes (Anton, Marc-André) * small dead code removal (Zhongyi) * documentation (Dan) * bugfixes (David) * decrease migration downtime (Jay) * improved error output (Laurent) * RTC tests and bugfix (me) * Bluetooth clang analyzer fix (me) * KVM CPU hotplug race (Peng Hao) * Two other patches from Philippe's clang analyzer series # gpg: Signature made Tue 01 Aug 2017 16:56:21 BST # gpg: using RSA key 0xBFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: mc146818rtc: implement UIP latching as intended mc146818rtc: simplify check_update_timer rtc-test: introduce more update tests rtc-test: cleanup register_b_set_flag test hw/scsi/vmw_pvscsi: Convert to realize hw/scsi/vmw_pvscsi: Remove the dead error handling migration: optimize the downtime qemu-options: document existance of versioned machine types bt: stop the sdp memory allocation craziness exec: Add lock parameter to qemu_ram_ptr_length target-i386: kvm_get/put_vcpu_events don't handle sipi_vector docs: document deprecation policy & deprecated features in appendix char: don't exit on hmp 'chardev-add help' char-fd: remove useless chr pointer accel: cleanup error output cpu_physical_memory_sync_dirty_bitmap: Fix alignment check vl.c/exit: pause cpus before closing block devices Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | rtc-test: introduce more update testsPaolo Bonzini2017-08-011-1/+81
| | | | | | | | | | | | | | | | | | Test divider reset and UIP behavior. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| * | rtc-test: cleanup register_b_set_flag testPaolo Bonzini2017-08-011-30/+46
| |/ | | | | | | | | | | | | Introduce set_datetime_bcd/assert_datetime_bcd, and handle UIP correctly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | qemu-iotests/059: Fix leaked image filesKevin Wolf2017-08-013-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qemu-iotests 059 left a whole lot of image files behind in the scratch directory because VMDK creates additional files for extents and cleaning them up requires the original image intact (it parses qemu-img info output to find all extent files), but the image overwrote it many times like it works for all other image formats. In addition, _use_sample_img overwrites the TEST_IMG variable, causing new images created afterwards to reuse the name of the sample file rather than the usual t.IMGFMT. This patch adds an intermediate _cleanup_test_img after each subtest that created an image file with additional extent files, and also after each use of a sample image. _cleanup_test_img is also changed so that it resets TEST_IMG after a sample image is cleaned up. Note that this test was failing before this commit and continues to do so after it. This failure was introduced in commit 9877860 ('block/vmdk: Report failures in vmdk_read_cid()') and needs to be dealt with separately. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* | qemu-iotests/063: Fix leaked imageKevin Wolf2017-08-011-3/+1Star
| | | | | | | | | | | | | | | | | | | | qemu-iotests 063 left t.raw.raw1 behind in the scratch directory because it used the wrong suffix. Make sure to clean it up after completing the test. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* | qemu-iotests/162: Fix leaked temporary filesKevin Wolf2017-08-011-0/+7
| | | | | | | | | | | | | | | | | | | | qemu-iotests 162 left qemu-nbd.pid behind in the scratch directory, and potentially a file called '42' in the current directory. Make sure to clean it up after completing the tests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
* | qemu-iotests/153: Fix leaked scratch imagesKevin Wolf2017-08-011-0/+1
| | | | | | | | | | | | | | | | | | qemu-iotests 153 left t.qcow2.c behind in the scratch directory. Make sure to clean it up after completing the tests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>