aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest/hd-geo-test.c
AgeCommit message (Collapse)AuthorFilesLines
2024-12-12tests/qtest: Use qtest_system_reset() instead of open-coded versionsPeter Maydell1-8/+1
Use the qtest_system_reset() function in various tests that were previously open-coding the system-reset. Note that in several cases this fixes a bug where the test did not wait for the RESET QMP event before continuing. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Fabiano Rosas <farosas@suse.de>
2024-09-17tests/qtest/hd-geo-test: Check for availability of "pc" machine before using itThomas Huth1-33/+38
In case QEMU has been configured with "--without-default-devices", the "pc" machine type might be missing in the binary. We should check for its availability before using it. Message-ID: <20240905191434.694440-5-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-07-10tests/qtest/hd-geo-test: fix incorrect pcie-root-port usage and simplify testAni Sinha1-10/+8
The test attaches a SCSI controller to a non-zero slot and a pcie-to-pci bridge on slot 0 on the same pcie-root-port. Since a downstream device can be attached to a pcie-root-port only on slot 0, the above test configuration is not allowed. Additionally using pcie.0 as id for pcie-to-pci bridge is incorrect as that id is reserved only for the root bus. In the test scenario, there is no need to attach a pcie-root-port to the root complex. A SCSI controller can be attached to a pcie-to-pci bridge which can then be directly attached to the root bus (pcie.0). Fix the test and simplify it. CC: mst@redhat.com CC: imammedo@redhat.com CC: Michael Labiuk <michael.labiuk@virtuozzo.com> Acked-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Ani Sinha <anisinha@redhat.com> Message-Id: <20230705115925.5339-5-anisinha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-02-14tests/qtest: hd-geo-test: Check for missing devicesFabiano Rosas1-13/+25
Don't include tests that require devices not available in the QEMU binary. Signed-off-by: Fabiano Rosas <farosas@suse.de> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230208194700.11035-6-farosas@suse.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-10-11tests/x86: Add 'q35' machine type to hotplug hd-geo-testMichael Labiuk1-1/+75
Add pci bridge setting to test hotplug. Duplicate tests for plugging scsi and virtio devices for q35 machine type. Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com> Message-Id: <20220929223547.1429580-6-michael.labiuk@virtuozzo.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-10-11tests/x86: Add 'q35' machine type to override-tests in hd-geo-testMichael Labiuk1-0/+97
Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com> Message-Id: <20220929223547.1429580-5-michael.labiuk@virtuozzo.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-10-11tests/x86: Refactor hot unplug hd-geo-testMichael Labiuk1-70/+40
Moving common code to function. Signed-off-by: Michael Labiuk <michael.labiuk@virtuozzo.com> Message-Id: <20220929223547.1429580-4-michael.labiuk@virtuozzo.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-09-27tests/qtest: hd-geo-test: Avoid using hardcoded /tmpBin Meng1-13/+11
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng <bin.meng@windriver.com> Message-Id: <20220927110632.1973965-13-bmeng.cn@gmail.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-05-03tests: move libqtest.h back under qtest/Marc-André Lureau1-1/+1
Since commit a2ce7dbd917 ("meson: convert tests/qtest to meson"), libqtest.h is under libqos/ directory, while libqtest.c is still in qtest/. Move back to its original location to avoid mixing with libqos/. Suggested-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
2022-04-06Remove qemu-common.h include from most unitsMarc-André Lureau1-1/+0
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-33-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-02-21tests/x86: Use 'pc' machine type for hotplug testsDr. David Alan Gilbert1-2/+2
Hotplug tests need a bridge setting up on q35, for now keep them on 'pc'. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20220215162537.605030-3-dgilbert@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-02-21tests/x86: Use 'pc' machine type for old hardware testsDr. David Alan Gilbert1-3/+9
For tests that rely on old hardware, e.g. floppies or IDE drives, explicitly select the 'pc' machine type. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20220215162537.605030-2-dgilbert@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-01-05tests/qtest/hd-geo-test: Check for the lsi53c895a controller before using itThomas Huth1-3/+5
The lsi53c895a SCSI controller might have been disabled in the target binary, so let's check for its availability first before using it. Message-Id: <20211222153600.976588-1-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-06-03tests/qtest/hd-geo-test: Fix checks on mkstemp() return valuePeter Maydell1-2/+2
Coverity notices that the checks against mkstemp() failing in create_qcow2_with_mbr() are wrong: mkstemp returns -1 on failure but the check is just "g_assert(fd)". Fix to use "g_assert(fd >= 0)", matching the correct check in create_test_img(). Fixes: Coverity CID 1432274 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-id: 20210525134458.6675-4-peter.maydell@linaro.org
2020-08-21meson: convert tests/qtest to mesonPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-03-17hd-geo-test: Clean up use of buf[] in create_qcow2_with_mbr()Markus Armbruster1-3/+3
valgrind reports write unitialized bytes from buf[]. Clear them. ASan reports we store to misaligned address in buf[]. Use stl_le_p() for that. Cc: Sam Eiderman <shmuel.eiderman@oracle.com> Cc: John Snow <jsnow@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20200317092354.31831-1-armbru@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
2020-01-12test: Move qtests to a separate directoryThomas Huth1-0/+988
The tests directory itself is pretty overcrowded, and it's hard to see which test belongs to which test subsystem (unit, qtest, ...). Let's move the qtests to a separate folder for more clarity. Message-Id: <20191218103059.11729-6-thuth@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>