Compare commits
12 Commits
qdev-array
...
without-de
Author | SHA1 | Date | |
---|---|---|---|
|
eab13108cd | ||
|
750400c56f | ||
|
f5ef199312 | ||
|
c789207417 | ||
|
3bf0b7dd7b | ||
|
3864d5e5c6 | ||
|
8a840ab4c2 | ||
|
d32f29f651 | ||
|
696cf0c1cd | ||
|
ef92be0914 | ||
|
f85bfa0bcb | ||
|
ecbd3f095e |
@@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
|
|||||||
_supported_fmt qcow2
|
_supported_fmt qcow2
|
||||||
_supported_proto file fuse
|
_supported_proto file fuse
|
||||||
_require_drivers null-co
|
_require_drivers null-co
|
||||||
|
_require_devices virtio-scsi-pci
|
||||||
|
|
||||||
if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then
|
if [ "$QEMU_DEFAULT_MACHINE" != "pc" ]; then
|
||||||
_notrun "Requires a PC machine"
|
_notrun "Requires a PC machine"
|
||||||
|
@@ -1008,6 +1008,12 @@ static void test_acpi_q35_multif_bridge(void)
|
|||||||
.machine = MACHINE_Q35,
|
.machine = MACHINE_Q35,
|
||||||
.variant = ".multi-bridge",
|
.variant = ".multi-bridge",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!qtest_has_device("pcie-root-port")) {
|
||||||
|
g_test_skip("Device pcie-root-port is not available");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
test_vm_prepare("-S"
|
test_vm_prepare("-S"
|
||||||
" -device virtio-balloon,id=balloon0,addr=0x4.0x2"
|
" -device virtio-balloon,id=balloon0,addr=0x4.0x2"
|
||||||
" -device pcie-root-port,id=rp0,multifunction=on,"
|
" -device pcie-root-port,id=rp0,multifunction=on,"
|
||||||
@@ -1043,6 +1049,7 @@ static void test_acpi_q35_multif_bridge(void)
|
|||||||
/* check that reboot/reset doesn't change any ACPI tables */
|
/* check that reboot/reset doesn't change any ACPI tables */
|
||||||
qtest_qmp_send(data.qts, "{'execute':'system_reset' }");
|
qtest_qmp_send(data.qts, "{'execute':'system_reset' }");
|
||||||
process_acpi_tables(&data);
|
process_acpi_tables(&data);
|
||||||
|
out:
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1396,6 +1403,11 @@ static void test_acpi_tcg_dimm_pxm(const char *machine)
|
|||||||
{
|
{
|
||||||
test_data data;
|
test_data data;
|
||||||
|
|
||||||
|
if (!qtest_has_device("nvdimm")) {
|
||||||
|
g_test_skip("Device nvdimm is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
memset(&data, 0, sizeof(data));
|
memset(&data, 0, sizeof(data));
|
||||||
data.machine = machine;
|
data.machine = machine;
|
||||||
data.variant = ".dimmpxm";
|
data.variant = ".dimmpxm";
|
||||||
@@ -1444,6 +1456,11 @@ static void test_acpi_virt_tcg_memhp(void)
|
|||||||
.scan_len = 256ULL * 1024 * 1024,
|
.scan_len = 256ULL * 1024 * 1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!qtest_has_device("nvdimm")) {
|
||||||
|
g_test_skip("Device nvdimm is not available");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
data.variant = ".memhp";
|
data.variant = ".memhp";
|
||||||
test_acpi_one(" -machine nvdimm=on"
|
test_acpi_one(" -machine nvdimm=on"
|
||||||
" -cpu cortex-a57"
|
" -cpu cortex-a57"
|
||||||
@@ -1457,7 +1474,7 @@ static void test_acpi_virt_tcg_memhp(void)
|
|||||||
" -device pc-dimm,id=dimm0,memdev=ram2,node=0"
|
" -device pc-dimm,id=dimm0,memdev=ram2,node=0"
|
||||||
" -device nvdimm,id=dimm1,memdev=nvm0,node=1",
|
" -device nvdimm,id=dimm1,memdev=nvm0,node=1",
|
||||||
&data);
|
&data);
|
||||||
|
out:
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1475,6 +1492,11 @@ static void test_acpi_microvm_tcg(void)
|
|||||||
{
|
{
|
||||||
test_data data;
|
test_data data;
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-blk-device")) {
|
||||||
|
g_test_skip("Device virtio-blk-device is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=off",
|
test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=off",
|
||||||
&data);
|
&data);
|
||||||
@@ -1485,6 +1507,11 @@ static void test_acpi_microvm_usb_tcg(void)
|
|||||||
{
|
{
|
||||||
test_data data;
|
test_data data;
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-blk-device")) {
|
||||||
|
g_test_skip("Device virtio-blk-device is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
data.variant = ".usb";
|
data.variant = ".usb";
|
||||||
test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,usb=on,rtc=off",
|
test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,usb=on,rtc=off",
|
||||||
@@ -1496,6 +1523,11 @@ static void test_acpi_microvm_rtc_tcg(void)
|
|||||||
{
|
{
|
||||||
test_data data;
|
test_data data;
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-blk-device")) {
|
||||||
|
g_test_skip("Device virtio-blk-device is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
data.variant = ".rtc";
|
data.variant = ".rtc";
|
||||||
test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=on",
|
test_acpi_one(" -machine microvm,acpi=on,ioapic2=off,rtc=on",
|
||||||
@@ -1507,6 +1539,11 @@ static void test_acpi_microvm_pcie_tcg(void)
|
|||||||
{
|
{
|
||||||
test_data data;
|
test_data data;
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-blk-device")) {
|
||||||
|
g_test_skip("Device virtio-blk-device is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
data.variant = ".pcie";
|
data.variant = ".pcie";
|
||||||
data.tcg_only = true; /* need constant host-phys-bits */
|
data.tcg_only = true; /* need constant host-phys-bits */
|
||||||
@@ -1519,6 +1556,11 @@ static void test_acpi_microvm_ioapic2_tcg(void)
|
|||||||
{
|
{
|
||||||
test_data data;
|
test_data data;
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-blk-device")) {
|
||||||
|
g_test_skip("Device virtio-blk-device is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
data.variant = ".ioapic2";
|
data.variant = ".ioapic2";
|
||||||
test_acpi_one(" -machine microvm,acpi=on,ioapic2=on,rtc=off",
|
test_acpi_one(" -machine microvm,acpi=on,ioapic2=on,rtc=off",
|
||||||
@@ -1558,6 +1600,12 @@ static void test_acpi_virt_tcg_pxb(void)
|
|||||||
.ram_start = 0x40000000ULL,
|
.ram_start = 0x40000000ULL,
|
||||||
.scan_len = 128ULL * 1024 * 1024,
|
.scan_len = 128ULL * 1024 * 1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!qtest_has_device("pcie-root-port")) {
|
||||||
|
g_test_skip("Device pcie-root-port is not available");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* While using -cdrom, the cdrom would auto plugged into pxb-pcie,
|
* While using -cdrom, the cdrom would auto plugged into pxb-pcie,
|
||||||
* the reason is the bus of pxb-pcie is also root bus, it would lead
|
* the reason is the bus of pxb-pcie is also root bus, it would lead
|
||||||
@@ -1576,7 +1624,7 @@ static void test_acpi_virt_tcg_pxb(void)
|
|||||||
" -cpu cortex-a57"
|
" -cpu cortex-a57"
|
||||||
" -device pxb-pcie,bus_nr=128",
|
" -device pxb-pcie,bus_nr=128",
|
||||||
&data);
|
&data);
|
||||||
|
out:
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1764,6 +1812,12 @@ static void test_acpi_microvm_acpi_erst(void)
|
|||||||
gchar *params;
|
gchar *params;
|
||||||
test_data data;
|
test_data data;
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-blk-device")) {
|
||||||
|
g_test_skip("Device virtio-blk-device is not available");
|
||||||
|
g_free(tmp_path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
data.variant = ".pcie";
|
data.variant = ".pcie";
|
||||||
data.tcg_only = true; /* need constant host-phys-bits */
|
data.tcg_only = true; /* need constant host-phys-bits */
|
||||||
@@ -1824,6 +1878,11 @@ static void test_acpi_q35_viot(void)
|
|||||||
.variant = ".viot",
|
.variant = ".viot",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-iommu")) {
|
||||||
|
g_test_skip("Device virtio-iommu is not available");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To keep things interesting, two buses bypass the IOMMU.
|
* To keep things interesting, two buses bypass the IOMMU.
|
||||||
* VIOT should only describes the other two buses.
|
* VIOT should only describes the other two buses.
|
||||||
@@ -1834,6 +1893,7 @@ static void test_acpi_q35_viot(void)
|
|||||||
"-device pxb-pcie,bus_nr=0x20,id=pcie.200,bus=pcie.0,bypass_iommu=on "
|
"-device pxb-pcie,bus_nr=0x20,id=pcie.200,bus=pcie.0,bypass_iommu=on "
|
||||||
"-device pxb-pcie,bus_nr=0x30,id=pcie.300,bus=pcie.0",
|
"-device pxb-pcie,bus_nr=0x30,id=pcie.300,bus=pcie.0",
|
||||||
&data);
|
&data);
|
||||||
|
out:
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1894,8 +1954,10 @@ static void test_acpi_virt_viot(void)
|
|||||||
.scan_len = 128ULL * 1024 * 1024,
|
.scan_len = 128ULL * 1024 * 1024,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (qtest_has_device("virtio-iommu")) {
|
||||||
test_acpi_one("-cpu cortex-a57 "
|
test_acpi_one("-cpu cortex-a57 "
|
||||||
"-device virtio-iommu-pci", &data);
|
"-device virtio-iommu-pci", &data);
|
||||||
|
}
|
||||||
free_test_data(&data);
|
free_test_data(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2004,6 +2066,11 @@ static void test_acpi_microvm_oem_fields(void)
|
|||||||
test_data data;
|
test_data data;
|
||||||
char *args;
|
char *args;
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-blk-device")) {
|
||||||
|
g_test_skip("Device virtio-blk-device is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
test_acpi_microvm_prepare(&data);
|
test_acpi_microvm_prepare(&data);
|
||||||
|
|
||||||
args = test_acpi_create_args(&data,
|
args = test_acpi_create_args(&data,
|
||||||
|
@@ -64,14 +64,20 @@ static void process_device_remove(QTestState *qtest, const char *id)
|
|||||||
|
|
||||||
static void test_pci_unplug_request(void)
|
static void test_pci_unplug_request(void)
|
||||||
{
|
{
|
||||||
|
QTestState *qtest;
|
||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
const char *machine_addition = "";
|
const char *machine_addition = "";
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-mouse-pci")) {
|
||||||
|
g_test_skip("Device virtio-mouse-pci not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
machine_addition = "-machine pc";
|
machine_addition = "-machine pc";
|
||||||
}
|
}
|
||||||
|
|
||||||
QTestState *qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0",
|
qtest = qtest_initf("%s -device virtio-mouse-pci,id=dev0",
|
||||||
machine_addition);
|
machine_addition);
|
||||||
|
|
||||||
process_device_remove(qtest, "dev0");
|
process_device_remove(qtest, "dev0");
|
||||||
@@ -81,8 +87,14 @@ static void test_pci_unplug_request(void)
|
|||||||
|
|
||||||
static void test_q35_pci_unplug_request(void)
|
static void test_q35_pci_unplug_request(void)
|
||||||
{
|
{
|
||||||
|
QTestState *qtest;
|
||||||
|
|
||||||
QTestState *qtest = qtest_initf("-machine q35 "
|
if (!qtest_has_device("virtio-mouse-pci")) {
|
||||||
|
g_test_skip("Device virtio-mouse-pci not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qtest = qtest_initf("-machine q35 "
|
||||||
"-device pcie-root-port,id=p1 "
|
"-device pcie-root-port,id=p1 "
|
||||||
"-device pcie-pci-bridge,bus=p1,id=b1 "
|
"-device pcie-pci-bridge,bus=p1,id=b1 "
|
||||||
"-device virtio-mouse-pci,bus=b1,id=dev0");
|
"-device virtio-mouse-pci,bus=b1,id=dev0");
|
||||||
@@ -94,14 +106,20 @@ static void test_q35_pci_unplug_request(void)
|
|||||||
|
|
||||||
static void test_pci_unplug_json_request(void)
|
static void test_pci_unplug_json_request(void)
|
||||||
{
|
{
|
||||||
|
QTestState *qtest;
|
||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
const char *machine_addition = "";
|
const char *machine_addition = "";
|
||||||
|
|
||||||
|
if (!qtest_has_device("virtio-mouse-pci")) {
|
||||||
|
g_test_skip("Device virtio-mouse-pci not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
machine_addition = "-machine pc";
|
machine_addition = "-machine pc";
|
||||||
}
|
}
|
||||||
|
|
||||||
QTestState *qtest = qtest_initf(
|
qtest = qtest_initf(
|
||||||
"%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"",
|
"%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"",
|
||||||
machine_addition);
|
machine_addition);
|
||||||
|
|
||||||
@@ -112,6 +130,7 @@ static void test_pci_unplug_json_request(void)
|
|||||||
|
|
||||||
static void test_q35_pci_unplug_json_request(void)
|
static void test_q35_pci_unplug_json_request(void)
|
||||||
{
|
{
|
||||||
|
QTestState *qtest;
|
||||||
const char *port = "-device \"{'driver': 'pcie-root-port', "
|
const char *port = "-device \"{'driver': 'pcie-root-port', "
|
||||||
"'id': 'p1'}\"";
|
"'id': 'p1'}\"";
|
||||||
|
|
||||||
@@ -123,8 +142,12 @@ static void test_q35_pci_unplug_json_request(void)
|
|||||||
"'bus': 'b1', "
|
"'bus': 'b1', "
|
||||||
"'id': 'dev0'}\"";
|
"'id': 'dev0'}\"";
|
||||||
|
|
||||||
QTestState *qtest = qtest_initf("-machine q35 %s %s %s",
|
if (!qtest_has_device("virtio-mouse-pci")) {
|
||||||
port, bridge, device);
|
g_test_skip("Device virtio-mouse-pci not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qtest = qtest_initf("-machine q35 %s %s %s", port, bridge, device);
|
||||||
|
|
||||||
process_device_remove(qtest, "dev0");
|
process_device_remove(qtest, "dev0");
|
||||||
|
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
#include "qapi/qmp/qdict.h"
|
#include "qapi/qmp/qdict.h"
|
||||||
#include "qapi/qmp/qlist.h"
|
#include "qapi/qmp/qlist.h"
|
||||||
|
|
||||||
|
static const char *qvirtio_get_dev_type(void);
|
||||||
|
|
||||||
static bool look_for_drive0(QTestState *qts, const char *command, const char *key)
|
static bool look_for_drive0(QTestState *qts, const char *command, const char *key)
|
||||||
{
|
{
|
||||||
QDict *response;
|
QDict *response;
|
||||||
@@ -40,6 +42,19 @@ static bool look_for_drive0(QTestState *qts, const char *command, const char *ke
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This covers the possible absence of a device due to QEMU build
|
||||||
|
* options.
|
||||||
|
*/
|
||||||
|
static bool has_device_builtin(const char *dev)
|
||||||
|
{
|
||||||
|
gchar *device = g_strdup_printf("%s-%s", dev, qvirtio_get_dev_type());
|
||||||
|
bool rc = qtest_has_device(device);
|
||||||
|
|
||||||
|
g_free(device);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
static bool has_drive(QTestState *qts)
|
static bool has_drive(QTestState *qts)
|
||||||
{
|
{
|
||||||
return look_for_drive0(qts, "query-block", "device");
|
return look_for_drive0(qts, "query-block", "device");
|
||||||
@@ -208,6 +223,11 @@ static void test_drive_del_device_del(void)
|
|||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-scsi")) {
|
||||||
|
g_test_skip("Device virtio-scsi is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Start with a drive used by a device that unplugs instantaneously */
|
/* Start with a drive used by a device that unplugs instantaneously */
|
||||||
qts = qtest_initf("-drive if=none,id=drive0,file=null-co://,"
|
qts = qtest_initf("-drive if=none,id=drive0,file=null-co://,"
|
||||||
"file.read-zeroes=on,format=raw"
|
"file.read-zeroes=on,format=raw"
|
||||||
@@ -232,6 +252,11 @@ static void test_cli_device_del(void)
|
|||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
const char *machine_addition = "";
|
const char *machine_addition = "";
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
machine_addition = "-machine pc";
|
machine_addition = "-machine pc";
|
||||||
}
|
}
|
||||||
@@ -256,6 +281,11 @@ static void test_cli_device_del_q35(void)
|
|||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* -drive/-device and device_del. Start with a drive used by a
|
* -drive/-device and device_del. Start with a drive used by a
|
||||||
* device that unplugs after reset.
|
* device that unplugs after reset.
|
||||||
@@ -277,6 +307,11 @@ static void test_empty_device_del(void)
|
|||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-scsi")) {
|
||||||
|
g_test_skip("Device virtio-scsi is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* device_del with no drive plugged. */
|
/* device_del with no drive plugged. */
|
||||||
qts = qtest_initf("-device virtio-scsi-%s -device scsi-cd,id=dev0",
|
qts = qtest_initf("-device virtio-scsi-%s -device scsi-cd,id=dev0",
|
||||||
qvirtio_get_dev_type());
|
qvirtio_get_dev_type());
|
||||||
@@ -291,6 +326,11 @@ static void test_device_add_and_del(void)
|
|||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
const char *machine_addition = "";
|
const char *machine_addition = "";
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
machine_addition = "-machine pc";
|
machine_addition = "-machine pc";
|
||||||
}
|
}
|
||||||
@@ -330,6 +370,11 @@ static void test_device_add_and_del_q35(void)
|
|||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* -drive/device_add and device_del. Start with a drive used by a
|
* -drive/device_add and device_del. Start with a drive used by a
|
||||||
* device that unplugs after reset.
|
* device that unplugs after reset.
|
||||||
@@ -352,6 +397,11 @@ static void test_drive_add_device_add_and_del(void)
|
|||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
const char *machine_addition = "";
|
const char *machine_addition = "";
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
machine_addition = "-machine pc";
|
machine_addition = "-machine pc";
|
||||||
}
|
}
|
||||||
@@ -374,6 +424,11 @@ static void test_drive_add_device_add_and_del_q35(void)
|
|||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qts = qtest_init("-machine q35 -device pcie-root-port,id=p1 "
|
qts = qtest_init("-machine q35 -device pcie-root-port,id=p1 "
|
||||||
"-device pcie-pci-bridge,bus=p1,id=b1");
|
"-device pcie-pci-bridge,bus=p1,id=b1");
|
||||||
|
|
||||||
@@ -395,6 +450,11 @@ static void test_blockdev_add_device_add_and_del(void)
|
|||||||
const char *arch = qtest_get_arch();
|
const char *arch = qtest_get_arch();
|
||||||
const char *machine_addition = "";
|
const char *machine_addition = "";
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
|
||||||
machine_addition = "-machine pc";
|
machine_addition = "-machine pc";
|
||||||
}
|
}
|
||||||
@@ -417,6 +477,11 @@ static void test_blockdev_add_device_add_and_del_q35(void)
|
|||||||
{
|
{
|
||||||
QTestState *qts;
|
QTestState *qts;
|
||||||
|
|
||||||
|
if (!has_device_builtin("virtio-blk")) {
|
||||||
|
g_test_skip("Device virtio-blk is not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
qts = qtest_init("-machine q35 -device pcie-root-port,id=p1 "
|
qts = qtest_init("-machine q35 -device pcie-root-port,id=p1 "
|
||||||
"-device pcie-pci-bridge,bus=p1,id=b1");
|
"-device pcie-pci-bridge,bus=p1,id=b1");
|
||||||
|
|
||||||
|
@@ -112,6 +112,10 @@ static void test_lsi_do_dma_empty_queue(void)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
if (!qtest_has_device("lsi53c895a")) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
g_test_init(&argc, &argv, NULL);
|
g_test_init(&argc, &argv, NULL);
|
||||||
|
|
||||||
qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
|
qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
|
||||||
|
@@ -1090,30 +1090,42 @@ int main(int argc, char **argv)
|
|||||||
qtest_add_func("hd-geo/override/ide", test_override_ide);
|
qtest_add_func("hd-geo/override/ide", test_override_ide);
|
||||||
if (qtest_has_device("lsi53c895a")) {
|
if (qtest_has_device("lsi53c895a")) {
|
||||||
qtest_add_func("hd-geo/override/scsi", test_override_scsi);
|
qtest_add_func("hd-geo/override/scsi", test_override_scsi);
|
||||||
|
if (qtest_has_device("virtio-scsi-pci")) {
|
||||||
qtest_add_func("hd-geo/override/scsi_2_controllers",
|
qtest_add_func("hd-geo/override/scsi_2_controllers",
|
||||||
test_override_scsi_2_controllers);
|
test_override_scsi_2_controllers);
|
||||||
}
|
}
|
||||||
qtest_add_func("hd-geo/override/virtio_blk", test_override_virtio_blk);
|
}
|
||||||
qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs);
|
qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs);
|
||||||
|
if (qtest_has_device("virtio-scsi-pci")) {
|
||||||
qtest_add_func("hd-geo/override/scsi_hot_unplug",
|
qtest_add_func("hd-geo/override/scsi_hot_unplug",
|
||||||
test_override_scsi_hot_unplug);
|
test_override_scsi_hot_unplug);
|
||||||
|
}
|
||||||
|
if (qtest_has_device("virtio-blk-pci")) {
|
||||||
qtest_add_func("hd-geo/override/virtio_hot_unplug",
|
qtest_add_func("hd-geo/override/virtio_hot_unplug",
|
||||||
test_override_virtio_hot_unplug);
|
test_override_virtio_hot_unplug);
|
||||||
|
qtest_add_func("hd-geo/override/virtio_blk",
|
||||||
|
test_override_virtio_blk);
|
||||||
|
}
|
||||||
|
|
||||||
if (qtest_has_machine("q35")) {
|
if (qtest_has_machine("q35")) {
|
||||||
qtest_add_func("hd-geo/override/sata", test_override_sata);
|
qtest_add_func("hd-geo/override/sata", test_override_sata);
|
||||||
qtest_add_func("hd-geo/override/virtio_blk_q35",
|
|
||||||
test_override_virtio_blk_q35);
|
|
||||||
qtest_add_func("hd-geo/override/zero_chs_q35",
|
qtest_add_func("hd-geo/override/zero_chs_q35",
|
||||||
test_override_zero_chs_q35);
|
test_override_zero_chs_q35);
|
||||||
if (qtest_has_device("lsi53c895a")) {
|
if (qtest_has_device("lsi53c895a")) {
|
||||||
qtest_add_func("hd-geo/override/scsi_q35",
|
qtest_add_func("hd-geo/override/scsi_q35",
|
||||||
test_override_scsi_q35);
|
test_override_scsi_q35);
|
||||||
}
|
}
|
||||||
|
if (qtest_has_device("virtio-scsi-pci")) {
|
||||||
qtest_add_func("hd-geo/override/scsi_hot_unplug_q35",
|
qtest_add_func("hd-geo/override/scsi_hot_unplug_q35",
|
||||||
test_override_scsi_hot_unplug_q35);
|
test_override_scsi_hot_unplug_q35);
|
||||||
|
}
|
||||||
|
if (qtest_has_device("virtio-blk-pci")) {
|
||||||
qtest_add_func("hd-geo/override/virtio_hot_unplug_q35",
|
qtest_add_func("hd-geo/override/virtio_hot_unplug_q35",
|
||||||
test_override_virtio_hot_unplug_q35);
|
test_override_virtio_hot_unplug_q35);
|
||||||
|
qtest_add_func("hd-geo/override/virtio_blk_q35",
|
||||||
|
test_override_virtio_blk_q35);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; "
|
g_test_message("QTEST_QEMU_IMG not set or qemu-img missing; "
|
||||||
|
@@ -73,11 +73,14 @@ qtests_i386 = \
|
|||||||
(config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
|
(config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
|
||||||
(config_host.has_key('CONFIG_POSIX') and \
|
(config_host.has_key('CONFIG_POSIX') and \
|
||||||
config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
|
config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
|
||||||
(config_all_devices.has_key('CONFIG_VIRTIO_NET') and \
|
(config_all_devices.has_key('CONFIG_PCIE_PORT') and \
|
||||||
|
config_all_devices.has_key('CONFIG_VIRTIO_NET') and \
|
||||||
config_all_devices.has_key('CONFIG_Q35') and \
|
config_all_devices.has_key('CONFIG_Q35') and \
|
||||||
config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
|
config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
|
||||||
slirp.found() ? ['virtio-net-failover'] : []) + \
|
slirp.found() ? ['virtio-net-failover'] : []) + \
|
||||||
(unpack_edk2_blobs ? ['bios-tables-test'] : []) + \
|
(unpack_edk2_blobs and \
|
||||||
|
config_all_devices.has_key('CONFIG_HPET') and \
|
||||||
|
config_all_devices.has_key('CONFIG_PARALLEL') ? ['bios-tables-test'] : []) + \
|
||||||
qtests_pci + \
|
qtests_pci + \
|
||||||
qtests_cxl + \
|
qtests_cxl + \
|
||||||
['fdc-test',
|
['fdc-test',
|
||||||
@@ -196,11 +199,11 @@ qtests_arm = \
|
|||||||
(config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
|
(config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \
|
||||||
(config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \
|
(config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \
|
||||||
(config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
|
(config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \
|
||||||
|
(config_all_devices.has_key('CONFIG_GENERIC_LOADER') ? ['hexloader-test'] : []) + \
|
||||||
['arm-cpu-features',
|
['arm-cpu-features',
|
||||||
'microbit-test',
|
'microbit-test',
|
||||||
'test-arm-mptimer',
|
'test-arm-mptimer',
|
||||||
'boot-serial-test',
|
'boot-serial-test']
|
||||||
'hexloader-test']
|
|
||||||
|
|
||||||
# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
|
# TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional
|
||||||
qtests_aarch64 = \
|
qtests_aarch64 = \
|
||||||
@@ -254,10 +257,14 @@ qos_test_ss.add(
|
|||||||
'virtio-net-test.c',
|
'virtio-net-test.c',
|
||||||
'virtio-rng-test.c',
|
'virtio-rng-test.c',
|
||||||
'virtio-scsi-test.c',
|
'virtio-scsi-test.c',
|
||||||
'virtio-serial-test.c',
|
|
||||||
'virtio-iommu-test.c',
|
'virtio-iommu-test.c',
|
||||||
'vmxnet3-test.c',
|
'vmxnet3-test.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if config_all_devices.has_key('CONFIG_VIRTIO_SERIAL')
|
||||||
|
qos_test_ss.add(files('virtio-serial-test.c'))
|
||||||
|
endif
|
||||||
|
|
||||||
if config_host.has_key('CONFIG_POSIX')
|
if config_host.has_key('CONFIG_POSIX')
|
||||||
qos_test_ss.add(files('e1000e-test.c'))
|
qos_test_ss.add(files('e1000e-test.c'))
|
||||||
endif
|
endif
|
||||||
|
@@ -108,6 +108,10 @@ static void test_batch(const testdef_t *tests, bool ipv6)
|
|||||||
const testdef_t *test = &tests[i];
|
const testdef_t *test = &tests[i];
|
||||||
char *testname;
|
char *testname;
|
||||||
|
|
||||||
|
if (!qtest_has_device(test->model)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
testname = g_strdup_printf("pxe/ipv4/%s/%s",
|
testname = g_strdup_printf("pxe/ipv4/%s/%s",
|
||||||
test->machine, test->model);
|
test->machine, test->model);
|
||||||
qtest_add_data_func(testname, test, test_pxe_ipv4);
|
qtest_add_data_func(testname, test, test_pxe_ipv4);
|
||||||
|
Reference in New Issue
Block a user