summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-10-31 11:37:59 +0100
committerGuido Günther <agx@sigxcpu.org>2015-10-31 11:37:59 +0100
commit42946f7ca4765eec26f2b8aeb3f70944d728b0e0 (patch)
tree71c539389b1a24183371affa658b6fa19a7f9208 /tests
parenta4989de47670012933ab6a4119796d7469a90bfb (diff)
New upstream version 1.2.21~rc1
Diffstat (limited to 'tests')
-rw-r--r--tests/commandtest.c10
-rw-r--r--tests/eventtest.c55
-rw-r--r--tests/nodeinfodata/linux-f21-mustang/cpu/modalias1
-rw-r--r--tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver1
-rw-r--r--tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro1
-rw-r--r--tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias1
-rw-r--r--tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver1
-rw-r--r--tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro1
-rw-r--r--tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings1
-rw-r--r--tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings1
-rw-r--r--tests/qemuhotplugtest.c3
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml30
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args7
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml32
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.args17
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.xml48
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.args15
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.xml43
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args1
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args6
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args2
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-iothreads-nocap.xml37
-rw-r--r--tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml3
-rw-r--r--tests/qemuxml2argvtest.c19
-rw-r--r--tests/qemuxml2xmltest.c3
-rw-r--r--tests/seclabeltest.c2
-rw-r--r--tests/securityselinuxlabeltest.c6
-rw-r--r--tests/securityselinuxtest.c4
-rw-r--r--tests/storagebackendsheepdogtest.c63
-rw-r--r--tests/test-lib.sh4
-rw-r--r--tests/testutils.c58
-rw-r--r--tests/testutils.h2
-rw-r--r--tests/virauthconfigtest.c2
-rw-r--r--tests/virbitmaptest.c12
-rw-r--r--tests/vircgrouptest.c2
-rw-r--r--tests/virkeyfiletest.c8
-rw-r--r--tests/virnetsockettest.c2
-rw-r--r--tests/virtypedparamtest.c2
-rw-r--r--tests/viruritest.c16
39 files changed, 395 insertions, 127 deletions
diff --git a/tests/commandtest.c b/tests/commandtest.c
index f001a3971..cf5f44a16 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -516,7 +516,7 @@ static int test13(const void *unused ATTRIBUTE_UNUSED)
virCommandFree(cmd);
cmd = NULL;
- if (!STREQ(outactual, outexpect)) {
+ if (STRNEQ(outactual, outexpect)) {
virtTestDifference(stderr, outexpect, outactual);
goto cleanup;
}
@@ -580,15 +580,15 @@ static int test14(const void *unused ATTRIBUTE_UNUSED)
if (!jointactual)
goto cleanup;
- if (!STREQ(outactual, outexpect)) {
+ if (STRNEQ(outactual, outexpect)) {
virtTestDifference(stderr, outexpect, outactual);
goto cleanup;
}
- if (!STREQ(erractual, errexpect)) {
+ if (STRNEQ(erractual, errexpect)) {
virtTestDifference(stderr, errexpect, erractual);
goto cleanup;
}
- if (!STREQ(jointactual, jointexpect)) {
+ if (STRNEQ(jointactual, jointexpect)) {
virtTestDifference(stderr, jointexpect, jointactual);
goto cleanup;
}
@@ -666,7 +666,7 @@ static int test16(const void *unused ATTRIBUTE_UNUSED)
goto cleanup;
}
- if (!STREQ(outactual, outexpect)) {
+ if (STRNEQ(outactual, outexpect)) {
virtTestDifference(stderr, outexpect, outactual);
goto cleanup;
}
diff --git a/tests/eventtest.c b/tests/eventtest.c
index 13adbf672..c4be6060d 100644
--- a/tests/eventtest.c
+++ b/tests/eventtest.c
@@ -63,6 +63,41 @@ enum {
EV_ERROR_DATA,
};
+struct testEventResultData {
+ bool failed;
+ const char *msg;
+};
+
+static int
+testEventResultCallback(const void *opaque)
+{
+ const struct testEventResultData *data = opaque;
+
+ if (data->failed && data->msg)
+ fprintf(stderr, "%s", data->msg);
+ return data->failed;
+}
+
+static void
+ATTRIBUTE_FMT_PRINTF(3, 4)
+testEventReport(const char *name, bool failed, const char *msg, ...)
+{
+ va_list vargs;
+ va_start(vargs, msg);
+ char *str = NULL;
+ struct testEventResultData data;
+
+ if (msg && virVasprintfQuiet(&str, msg, vargs) != 0)
+ failed = true;
+
+ data.failed = failed;
+ data.msg = str;
+ ignore_value(virtTestRun(name, testEventResultCallback, &data));
+
+ va_end(vargs);
+ VIR_FREE(str);
+}
+
static void
testPipeReader(int watch, int fd, int events, void *data)
{
@@ -148,13 +183,13 @@ verifyFired(const char *name, int handle, int timer)
for (i = 0; i < NUM_FDS; i++) {
if (handles[i].fired) {
if (i != handle) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Handle %zu fired, but expected %d\n", i,
handle);
return EXIT_FAILURE;
} else {
if (handles[i].error != EV_ERROR_NONE) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Handle %zu fired, but had error %d\n", i,
handles[i].error);
return EXIT_FAILURE;
@@ -163,7 +198,7 @@ verifyFired(const char *name, int handle, int timer)
}
} else {
if (i == handle) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Handle %d should have fired, but didn't\n",
handle);
return EXIT_FAILURE;
@@ -171,7 +206,7 @@ verifyFired(const char *name, int handle, int timer)
}
}
if (handleFired != 1 && handle != -1) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Something weird happened, expecting handle %d\n",
handle);
return EXIT_FAILURE;
@@ -181,12 +216,12 @@ verifyFired(const char *name, int handle, int timer)
for (i = 0; i < NUM_TIME; i++) {
if (timers[i].fired) {
if (i != timer) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Timer %zu fired, but expected %d\n", i, timer);
return EXIT_FAILURE;
} else {
if (timers[i].error != EV_ERROR_NONE) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Timer %zu fired, but had error %d\n", i,
timers[i].error);
return EXIT_FAILURE;
@@ -195,7 +230,7 @@ verifyFired(const char *name, int handle, int timer)
}
} else {
if (i == timer) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Timer %d should have fired, but didn't\n",
timer);
return EXIT_FAILURE;
@@ -203,7 +238,7 @@ verifyFired(const char *name, int handle, int timer)
}
}
if (timerFired != 1 && timer != -1) {
- virtTestResult(name, 1,
+ testEventReport(name, 1,
"Something weird happened, expecting timer %d\n",
timer);
return EXIT_FAILURE;
@@ -234,14 +269,14 @@ finishJob(const char *name, int handle, int timer)
rc = pthread_cond_timedwait(&eventThreadJobCond, &eventThreadMutex,
&waitTime);
if (rc != 0) {
- virtTestResult(name, 1, "Timed out waiting for pipe event\n");
+ testEventReport(name, 1, "Timed out waiting for pipe event\n");
return EXIT_FAILURE;
}
if (verifyFired(name, handle, timer) != EXIT_SUCCESS)
return EXIT_FAILURE;
- virtTestResult(name, 0, NULL);
+ testEventReport(name, 0, NULL);
return EXIT_SUCCESS;
}
diff --git a/tests/nodeinfodata/linux-f21-mustang/cpu/modalias b/tests/nodeinfodata/linux-f21-mustang/cpu/modalias
deleted file mode 100644
index 18bb0b619..000000000
--- a/tests/nodeinfodata/linux-f21-mustang/cpu/modalias
+++ /dev/null
@@ -1 +0,0 @@
-cpu:type:aarch64:feature:,0000,0001,0002
diff --git a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver b/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver
deleted file mode 100644
index 621e94f0e..000000000
--- a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_driver
+++ /dev/null
@@ -1 +0,0 @@
-none
diff --git a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro b/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro
deleted file mode 100644
index c35a724b3..000000000
--- a/tests/nodeinfodata/linux-raspberrypi/cpu/cpuidle/current_governor_ro
+++ /dev/null
@@ -1 +0,0 @@
-menu
diff --git a/tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias b/tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias
deleted file mode 100644
index 18bb0b619..000000000
--- a/tests/nodeinfodata/linux-rhelsa-3.19.0-mustang/cpu/modalias
+++ /dev/null
@@ -1 +0,0 @@
-cpu:type:aarch64:feature:,0000,0001,0002
diff --git a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver b/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver
deleted file mode 100644
index 57d5dd37c..000000000
--- a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_driver
+++ /dev/null
@@ -1 +0,0 @@
-acpi_idle
diff --git a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro b/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro
deleted file mode 100644
index c35a724b3..000000000
--- a/tests/nodeinfodata/linux-test8/cpu/cpuidle/current_governor_ro
+++ /dev/null
@@ -1 +0,0 @@
-menu
diff --git a/tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings b/tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings
deleted file mode 100644
index 573541ac9..000000000
--- a/tests/nodeinfodata/linux-test8/cpu/sched_mc_power_savings
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings b/tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings
deleted file mode 100644
index 573541ac9..000000000
--- a/tests/nodeinfodata/linux-test8/cpu/sched_smt_power_savings
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 2135b5a9c..2c5c48f57 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -364,7 +364,8 @@ mymain(void)
if (!driver.lockManager)
return EXIT_FAILURE;
- if (!(mgr = virSecurityManagerNew("none", "qemu", false, false, false, true)))
+ if (!(mgr = virSecurityManagerNew("none", "qemu",
+ VIR_SECURITY_MANAGER_PRIVILEGED)))
return EXIT_FAILURE;
if (!(driver.securityManager = virSecurityManagerNewStack(mgr)))
return EXIT_FAILURE;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml
index 08d3d714b..cb595e4a7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic.xml
@@ -1,26 +1,32 @@
-<domain type="qemu">
+<domain type='qemu'>
<name>aarch64test</name>
<uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
- <memory>1048576</memory>
- <currentMemory>1048576</currentMemory>
- <vcpu>1</vcpu>
- <features>
- <acpi/>
- <gic version='2'/>
- </features>
- <cpu match='exact'>
- <model>cortex-a53</model>
- </cpu>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
<os>
- <type arch="aarch64" machine="virt">hvm</type>
+ <type arch='aarch64' machine='virt'>hvm</type>
<kernel>/aarch64.kernel</kernel>
<initrd>/aarch64.initrd</initrd>
<cmdline>console=ttyAMA0</cmdline>
+ <boot dev='hd'/>
</os>
+ <features>
+ <acpi/>
+ <gic version='2'/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>cortex-a53</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-aarch64</emulator>
<interface type='user'>
<mac address='52:54:00:09:a4:37'/>
+ <model type='virtio'/>
</interface>
</devices>
</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args
new file mode 100644
index 000000000..3d8732fa3
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.args
@@ -0,0 +1,7 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-aarch64 -S -machine virt,accel=tcg,gic-version=3 \
+-cpu cortex-a53 -m 1024 -smp 1 \
+-nographic -nodefaults -monitor unix:/tmp/test-monitor,server,nowait -boot c \
+-kernel /aarch64.kernel -initrd /aarch64.initrd -append console=ttyAMA0 -usb \
+-net nic,macaddr=52:54:00:09:a4:37,vlan=0,model=virtio,name=net0 \
+-net user,vlan=0,name=hostnet0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml
new file mode 100644
index 000000000..72aaaf7fe
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-gicv3.xml
@@ -0,0 +1,32 @@
+<domain type='qemu'>
+ <name>aarch64test</name>
+ <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ <kernel>/aarch64.kernel</kernel>
+ <initrd>/aarch64.initrd</initrd>
+ <cmdline>console=ttyAMA0</cmdline>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <gic version='3'/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>cortex-a53</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='virtio'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.args
new file mode 100644
index 000000000..97209366e
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.args
@@ -0,0 +1,17 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-aarch64 -S -M virt -cpu cortex-a53 -m 1024 -smp 1 \
+-nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -boot c \
+-kernel /aarch64.kernel -initrd /aarch64.initrd \
+-append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
+-dtb /aarch64.dtb -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
+-device virtio-serial-device,id=virtio-serial0 -usb \
+-drive file=/aarch64.raw,if=none,id=drive-virtio-disk0 \
+-device virtio-blk-device,drive=drive-virtio-disk0,id=virtio-disk0 \
+-device virtio-net-device,vlan=0,id=net0,mac=52:54:00:09:a4:37 \
+-net user,vlan=0,name=hostnet0 -serial pty -chardev pty,id=charconsole1 \
+-device virtconsole,chardev=charconsole1,id=console1 \
+-device virtio-balloon-device,id=balloon0 \
+-object rng-random,id=objrng0,filename=/dev/random \
+-device virtio-rng-device,rng=objrng0,id=rng0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.xml
new file mode 100644
index 000000000..ad3461512
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-mmio-default-pci.xml
@@ -0,0 +1,48 @@
+<domain type="qemu">
+ <name>aarch64test</name>
+ <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
+ <memory>1048576</memory>
+ <currentMemory>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch="aarch64" machine="virt">hvm</type>
+ <kernel>/aarch64.kernel</kernel>
+ <initrd>/aarch64.initrd</initrd>
+ <dtb>/aarch64.dtb</dtb>
+ <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <cpu match='exact'>
+ <model>cortex-a53</model>
+ </cpu>
+ <clock offset="utc"/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <disk type='file' device='disk'>
+ <source file='/aarch64.raw'/>
+ <target dev='vda' bus='virtio'/>
+ </disk>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='virtio'/>
+ </interface>
+ <console type='pty'/>
+ <console type='pty'>
+ <target type='virtio' port='0'/>
+ </console>
+ <memballoon model='virtio'/>
+ <!--
+ This actually doesn't work in practice because vexpress only has
+ 4 virtio slots available, rng makes 5 -->
+ <rng model='virtio'>
+ <backend model='random'>/dev/random</backend>
+ </rng>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.args b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.args
new file mode 100644
index 000000000..3ae6e3434
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.args
@@ -0,0 +1,15 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-aarch64 -S -M virt -cpu cortex-a53 -m 1024 -smp 1 \
+-nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -boot c \
+-kernel /aarch64.kernel -initrd /aarch64.initrd \
+-append 'earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait' \
+-dtb /aarch64.dtb -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1 \
+-device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \
+-device virtio-scsi-pci,id=scsi0,bus=pcie.0,addr=0x3 \
+-usb -drive file=/aarch64.raw,if=none,id=drive-scsi0-0-0-0 \
+-device scsi-disk,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
+drive=drive-scsi0-0-0-0,id=scsi0-0-0-0 \
+-device virtio-net-pci,vlan=0,id=net0,\
+mac=52:54:00:09:a4:37,bus=pcie.0,addr=0x2 \
+-net user,vlan=0,name=hostnet0
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.xml b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.xml
new file mode 100644
index 000000000..6a44f19ef
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-aarch64-virtio-pci.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>aarch64test</name>
+ <uuid>496d7ea8-9739-544b-4ebd-ef08be936e8b</uuid>
+ <memory unit='KiB'>1048576</memory>
+ <currentMemory unit='KiB'>1048576</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ <kernel>/aarch64.kernel</kernel>
+ <initrd>/aarch64.initrd</initrd>
+ <cmdline>earlyprintk console=ttyAMA0,115200n8 rw root=/dev/vda rootwait</cmdline>
+ <dtb>/aarch64.dtb</dtb>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <cpu mode='custom' match='exact'>
+ <model fallback='allow'>cortex-a53</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <disk type='file' device='disk'>
+ <source file='/aarch64.raw'/>
+ <target dev='sda' bus='scsi'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </controller>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args
index 481f72ffd..affe64808 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cputune-numatune.args
@@ -1,5 +1,6 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
/usr/bin/qemu-system-x86_64 -S -M pc-q35-2.3 -m 128 \
-smp 2,maxcpus=6,sockets=6,cores=1,threads=1 \
+-object iothread,id=iothread1 -object iothread,id=iothread2 \
-nographic -monitor unix:/tmp/test-monitor,server,nowait -no-acpi \
-boot c -net none -serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
index 37511b109..3496cf1a7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args
@@ -4,9 +4,9 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \
-M pc-i440fx-2.3 \
-m size=1048576k,slots=16,maxmem=1099511627776k \
-smp 2 \
--object memory-backend-file,id=ram-node0,prealloc=yes,\
-mem-path=/dev/hugepages2M/libvirt/qemu,size=1073741824 \
--numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
+-mem-prealloc \
+-mem-path /dev/hugepages2M/libvirt/qemu \
+-numa node,nodeid=0,cpus=0-1,mem=1024 \
-object memory-backend-file,id=memdimm0,prealloc=yes,\
mem-path=/dev/hugepages1G/libvirt/qemu,size=1073741824,host-nodes=1-3,policy=bind \
-device pc-dimm,node=0,memdev=memdimm0,id=dimm0 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args
index 4eccb86e9..a3a4e5732 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages6.args
@@ -1,4 +1,4 @@
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
-/usr/bin/qemu -S -M pc -m 1024 -mem-prealloc -smp 2 -nographic \
+/usr/bin/qemu -S -M pc -m 1024 -smp 2 -nographic \
-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
-hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-iothreads-nocap.xml b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-nocap.xml
new file mode 100644
index 000000000..61871e7b6
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-iothreads-nocap.xml
@@ -0,0 +1,37 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <iothreads>4</iothreads>
+ <iothreadids>
+ <iothread id='5'/>
+ <iothread id='6'/>
+ </iothreadids>
+ <cputune>
+ <iothreadpin iothread='5' cpuset='2'/>
+ <iothreadpin iothread='6' cpuset='1'/>
+ </cputune>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml b/tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml
index 13fb44963..2143faac0 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-metadata-duplicate.xml
@@ -24,6 +24,9 @@
</devices>
<!-- intentional mis-indentation -->
<metadata>
+ <herp2erp xmlns:foobar="http://foo.bar3/"/>
+ <herp2erp xmlns:foobar="http://foo.bar3/"/>
+ <herp2erp xmlns:foobar="http://foo.bar3/"/>
<app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
<app3:foo xmlns:app3="http://foo.org/">fooish</app3:foo>
<app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index ae6777931..53580e3d6 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1285,6 +1285,7 @@ mymain(void)
DO_TEST("iothreads", QEMU_CAPS_OBJECT_IOTHREAD);
DO_TEST("iothreads-ids", QEMU_CAPS_OBJECT_IOTHREAD);
DO_TEST("iothreads-ids-partial", QEMU_CAPS_OBJECT_IOTHREAD);
+ DO_TEST_FAILURE("iothreads-nocap", NONE);
DO_TEST("iothreads-disk", QEMU_CAPS_OBJECT_IOTHREAD, QEMU_CAPS_DEVICE,
QEMU_CAPS_DRIVE);
DO_TEST("iothreads-disk-virtio-ccw", QEMU_CAPS_OBJECT_IOTHREAD, QEMU_CAPS_DEVICE,
@@ -1338,6 +1339,7 @@ mymain(void)
DO_TEST_PARSE_ERROR("cputune-vcpusched-overlap", QEMU_CAPS_NAME);
DO_TEST("cputune-numatune", QEMU_CAPS_SMP_TOPOLOGY,
QEMU_CAPS_KVM,
+ QEMU_CAPS_OBJECT_IOTHREAD,
QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_OBJECT_MEMORY_FILE);
@@ -1632,6 +1634,18 @@ mymain(void)
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
+ DO_TEST("aarch64-mmio-default-pci",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
+ QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
+ QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
+ QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE);
+ DO_TEST("aarch64-virtio-pci",
+ QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
+ QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
+ QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM,
+ QEMU_CAPS_OBJECT_GPEX, QEMU_CAPS_DEVICE_PCI_BRIDGE,
+ QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, QEMU_CAPS_VIRTIO_SCSI);
DO_TEST("aarch64-aavmf-virtio-mmio",
QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG, QEMU_CAPS_DTB,
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
@@ -1644,6 +1658,11 @@ mymain(void)
QEMU_CAPS_CPU_HOST, QEMU_CAPS_KVM);
DO_TEST("aarch64-gic", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
QEMU_CAPS_KVM);
+ DO_TEST("aarch64-gicv3", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT,
+ QEMU_CAPS_MACH_VIRT_GIC_VERSION);
+ DO_TEST_FAILURE("aarch64-gicv3", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
+ QEMU_CAPS_KVM, QEMU_CAPS_MACHINE_OPT);
driver.caps->host.cpu->arch = VIR_ARCH_AARCH64;
DO_TEST("aarch64-kvm-32-on-64", QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index eae153c5e..5a9c67df7 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -625,6 +625,9 @@ mymain(void)
DO_TEST("smbios-multiple-type2");
DO_TEST("aarch64-aavmf-virtio-mmio");
+ DO_TEST("aarch64-gic");
+ DO_TEST("aarch64-gicv3");
+
DO_TEST("memory-hotplug");
DO_TEST("memory-hotplug-nonuma");
DO_TEST("memory-hotplug-dimm");
diff --git a/tests/seclabeltest.c b/tests/seclabeltest.c
index 93ddcbbdd..6b1e78955 100644
--- a/tests/seclabeltest.c
+++ b/tests/seclabeltest.c
@@ -17,7 +17,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
if (virThreadInitialize() < 0)
return EXIT_FAILURE;
- mgr = virSecurityManagerNew(NULL, "QEMU", false, true, false, false);
+ mgr = virSecurityManagerNew(NULL, "QEMU", VIR_SECURITY_MANAGER_DEFAULT_CONFINED);
if (mgr == NULL) {
fprintf(stderr, "Failed to start security driver");
return EXIT_FAILURE;
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index 4b8fa6f25..c82b3f21a 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -282,7 +282,7 @@ testSELinuxCheckLabels(testSELinuxFile *files, size_t nfiles)
return -1;
}
}
- if (!STREQ_NULLABLE(files[i].context, ctx)) {
+ if (STRNEQ_NULLABLE(files[i].context, ctx)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"File %s context '%s' did not match epected '%s'",
files[i].file, ctx, files[i].context);
@@ -351,7 +351,9 @@ mymain(void)
if (!rc)
return EXIT_AM_SKIP;
- if (!(mgr = virSecurityManagerNew("selinux", "QEMU", false, true, false, true))) {
+ if (!(mgr = virSecurityManagerNew("selinux", "QEMU",
+ VIR_SECURITY_MANAGER_DEFAULT_CONFINED |
+ VIR_SECURITY_MANAGER_PRIVILEGED))) {
virErrorPtr err = virGetLastError();
VIR_TEST_VERBOSE("Unable to initialize security driver: %s\n",
err->message);
diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c
index 3a7862f42..49694f3fc 100644
--- a/tests/securityselinuxtest.c
+++ b/tests/securityselinuxtest.c
@@ -272,7 +272,9 @@ mymain(void)
int ret = 0;
virSecurityManagerPtr mgr;
- if (!(mgr = virSecurityManagerNew("selinux", "QEMU", false, true, false, true))) {
+ if (!(mgr = virSecurityManagerNew("selinux", "QEMU",
+ VIR_SECURITY_MANAGER_DEFAULT_CONFINED |
+ VIR_SECURITY_MANAGER_PRIVILEGED))) {
virErrorPtr err = virGetLastError();
fprintf(stderr, "Unable to initialize security driver: %s\n",
err->message);
diff --git a/tests/storagebackendsheepdogtest.c b/tests/storagebackendsheepdogtest.c
index 7744119bc..2b0f4dbfb 100644
--- a/tests/storagebackendsheepdogtest.c
+++ b/tests/storagebackendsheepdogtest.c
@@ -44,15 +44,28 @@ typedef struct {
uint64_t expected_allocation;
} collie_test;
+struct testNodeInfoParserData {
+ collie_test data;
+ const char *poolxml;
+};
+
+struct testVDIListParserData {
+ collie_test data;
+ const char *poolxml;
+ const char *volxml;
+};
+
static int
-test_node_info_parser(collie_test test, char *poolxml)
+test_node_info_parser(const void *opaque)
{
+ const struct testNodeInfoParserData *data = opaque;
+ collie_test test = data->data;
int ret = -1;
char *output = NULL;
virStoragePoolDefPtr pool = NULL;
- if (!(pool = virStoragePoolDefParseFile(poolxml)))
+ if (!(pool = virStoragePoolDefParseFile(data->poolxml)))
goto cleanup;
if (VIR_STRDUP(output, test.output) < 0)
@@ -78,17 +91,19 @@ test_node_info_parser(collie_test test, char *poolxml)
}
static int
-test_vdi_list_parser(collie_test test, char *poolxml, char *volxml)
+test_vdi_list_parser(const void *opaque)
{
+ const struct testVDIListParserData *data = opaque;
+ collie_test test = data->data;
int ret = -1;
char *output = NULL;
virStoragePoolDefPtr pool = NULL;
virStorageVolDefPtr vol = NULL;
- if (!(pool = virStoragePoolDefParseFile(poolxml)))
+ if (!(pool = virStoragePoolDefParseFile(data->poolxml)))
goto cleanup;
- if (!(vol = virStorageVolDefParseFile(pool, volxml, 0)))
+ if (!(vol = virStorageVolDefParseFile(pool, data->volxml, 0)))
goto cleanup;
if (VIR_STRDUP(output, test.output) < 0)
@@ -118,7 +133,7 @@ test_vdi_list_parser(collie_test test, char *poolxml, char *volxml)
static int
mymain(void)
{
- int ret = -1;
+ int ret = 0;
char *poolxml = NULL;
char *volxml = NULL;
@@ -170,26 +185,42 @@ mymain(void)
abs_srcdir) < 0)
goto cleanup;
+#define DO_TEST_NODE(collie) \
+ do { \
+ struct testNodeInfoParserData data = { \
+ .data = collie, \
+ .poolxml = poolxml, \
+ }; \
+ if (virtTestRun("node_info_parser", test_node_info_parser, \
+ &data) < 0) \
+ ret = -1; \
+ } while (0)
+
while (test->output != NULL) {
- ret = test_node_info_parser(*test, poolxml);
- virtTestResult("node_info_parser", ret, NULL);
+ DO_TEST_NODE(*test);
++test;
- if (ret < 0)
- return EXIT_FAILURE;
}
+
+#define DO_TEST_VDI(collie) \
+ do { \
+ struct testVDIListParserData data = { \
+ .data = collie, \
+ .poolxml = poolxml, \
+ .volxml = volxml, \
+ }; \
+ if (virtTestRun("vdi_list_parser", test_vdi_list_parser, \
+ &data) < 0) \
+ ret = -1; \
+ } while (0)
+
test = vdi_list_tests;
while (test->output != NULL) {
- ret = test_vdi_list_parser(*test, poolxml, volxml);
- virtTestResult("vdi_list_parser", ret, NULL);
+ DO_TEST_VDI(*test);
++test;
- if (ret < 0)
- return EXIT_FAILURE;
}
- ret = 0;
-
cleanup:
VIR_FREE(poolxml);
VIR_FREE(volxml);
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index e612f8f21..aff179c79 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15
cd "$t_" || error_ "failed to cd to $t_"
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+if ( diff --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
compare() { diff -u "$@"; }
-elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
compare() { cmp -s "$@"; }
else
compare() { cmp "$@"; }
diff --git a/tests/testutils.c b/tests/testutils.c
index 89026c634..857e8195f 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -91,6 +91,11 @@ bool virtTestOOMActive(void)
return testOOMActive;
}
+static int virtTestUseTerminalColors(void)
+{
+ return isatty(STDIN_FILENO);
+}
+
static unsigned int
virTestGetFlag(const char *name)
{
@@ -114,44 +119,6 @@ static void virTestAllocHook(int nalloc ATTRIBUTE_UNUSED,
}
#endif
-void virtTestResult(const char *name, int ret, const char *msg, ...)
-{
- va_list vargs;
- va_start(vargs, msg);
-
- if (testCounter == 0 && !virTestGetVerbose())
- fprintf(stderr, " ");
-
- testCounter++;
- if (virTestGetVerbose()) {
- fprintf(stderr, "%3zu) %-60s ", testCounter, name);
- if (ret == 0) {
- fprintf(stderr, "OK\n");
- } else {
- fprintf(stderr, "FAILED\n");
- if (msg) {
- char *str;
- if (virVasprintfQuiet(&str, msg, vargs) == 0) {
- fprintf(stderr, "%s", str);
- VIR_FREE(str);
- }
- }
- }
- } else {
- if (testCounter != 1 &&
- !((testCounter-1) % 40)) {
- fprintf(stderr, " %-3zu\n", (testCounter-1));
- fprintf(stderr, " ");
- }
- if (ret == 0)
- fprintf(stderr, ".");
- else
- fprintf(stderr, "!");
- }
-
- va_end(vargs);
-}
-
#ifdef TEST_OOM_TRACE
static void
virTestShowTrace(void)
@@ -217,11 +184,20 @@ virtTestRun(const char *title,
if (virTestGetVerbose()) {
if (ret == 0)
- fprintf(stderr, "OK\n");
+ if (virtTestUseTerminalColors())
+ fprintf(stderr, "\e[32mOK\e[0m\n"); /* green */
+ else
+ fprintf(stderr, "OK\n");
else if (ret == EXIT_AM_SKIP)
- fprintf(stderr, "SKIP\n");
+ if (virtTestUseTerminalColors())
+ fprintf(stderr, "\e[34m\e[1mSKIP\e[0m\n"); /* bold blue */
+ else
+ fprintf(stderr, "SKIP\n");
else
- fprintf(stderr, "FAILED\n");
+ if (virtTestUseTerminalColors())
+ fprintf(stderr, "\e[31m\e[1mFAILED\e[0m\n"); /* bold red */
+ else
+ fprintf(stderr, "FAILED\n");
} else {
if (testCounter != 1 &&
!((testCounter-1) % 40)) {
diff --git a/tests/testutils.h b/tests/testutils.h
index f34a39346..ccf1d29e1 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -48,8 +48,6 @@ extern char *progname;
bool virtTestOOMActive(void);
-void virtTestResult(const char *name, int ret, const char *msg, ...)
- ATTRIBUTE_FMT_PRINTF(3,4);
int virtTestRun(const char *title,
int (*body)(const void *data),
const void *data);
diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c
index d9e05fd3f..4c380b9c8 100644
--- a/tests/virauthconfigtest.c
+++ b/tests/virauthconfigtest.c
@@ -60,7 +60,7 @@ static int testAuthLookup(const void *args)
if (data->expect) {
if (!actual ||
- !STREQ(actual, data->expect)) {
+ STRNEQ(actual, data->expect)) {
VIR_WARN("Expected value '%s' for '%s' '%s' '%s', but got '%s'",
data->expect, data->hostname,
data->service, data->credname,
diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c
index a6e9a382f..8e458d259 100644
--- a/tests/virbitmaptest.c
+++ b/tests/virbitmaptest.c
@@ -355,7 +355,7 @@ test6(const void *v ATTRIBUTE_UNUSED)
if (!str)
goto error;
- if (!STREQ(str, ""))
+ if (STRNEQ(str, ""))
goto error;
VIR_FREE(str);
@@ -365,7 +365,7 @@ test6(const void *v ATTRIBUTE_UNUSED)
if (!str)
goto error;
- if (!STREQ(str, "0"))
+ if (STRNEQ(str, "0"))
goto error;
VIR_FREE(str);
@@ -376,7 +376,7 @@ test6(const void *v ATTRIBUTE_UNUSED)
if (!str)
goto error;
- if (!STREQ(str, "0,4-5"))
+ if (STRNEQ(str, "0,4-5"))
goto error;
VIR_FREE(str);
@@ -386,7 +386,7 @@ test6(const void *v ATTRIBUTE_UNUSED)
if (!str)
goto error;
- if (!STREQ(str, "0,4-6"))
+ if (STRNEQ(str, "0,4-6"))
goto error;
VIR_FREE(str);
@@ -399,7 +399,7 @@ test6(const void *v ATTRIBUTE_UNUSED)
if (!str)
goto error;
- if (!STREQ(str, "0,4-6,13-16"))
+ if (STRNEQ(str, "0,4-6,13-16"))
goto error;
VIR_FREE(str);
@@ -410,7 +410,7 @@ test6(const void *v ATTRIBUTE_UNUSED)
if (!str)
goto error;
- if (!STREQ(str, "0,4-6,13-16,62-63"))
+ if (STRNEQ(str, "0,4-6,13-16,62-63"))
goto error;
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index 7a876406a..731ecc409 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -662,7 +662,7 @@ static int testCgroupGetPercpuStats(const void *args ATTRIBUTE_UNUSED)
}
for (i = 0; i < EXPECTED_NCPUS; i++) {
- if (!STREQ(params[i].field, VIR_DOMAIN_CPU_STATS_CPUTIME)) {
+ if (STRNEQ(params[i].field, VIR_DOMAIN_CPU_STATS_CPUTIME)) {
fprintf(stderr,
"Wrong parameter name value from virCgroupGetPercpuStats at %zu (is: %s)\n",
i, params[i].field);
diff --git a/tests/virkeyfiletest.c b/tests/virkeyfiletest.c
index c31d2aafa..3908fa810 100644
--- a/tests/virkeyfiletest.c
+++ b/tests/virkeyfiletest.c
@@ -70,17 +70,17 @@ static int testParse(const void *args ATTRIBUTE_UNUSED)
VIR_DEBUG("Missing Value 'Foo.three'");
goto cleanup;
}
- if (!STREQ(virKeyFileGetValueString(kf, "Foo", "one"),
+ if (STRNEQ(virKeyFileGetValueString(kf, "Foo", "one"),
"The first entry is here")) {
VIR_DEBUG("Wrong value for 'Foo.one'");
goto cleanup;
}
- if (!STREQ(virKeyFileGetValueString(kf, "Foo", "two"),
+ if (STRNEQ(virKeyFileGetValueString(kf, "Foo", "two"),
"The second entry")) {
VIR_DEBUG("Wrong value for 'Foo.one'");
goto cleanup;
}
- if (!STREQ(virKeyFileGetValueString(kf, "Foo", "three"),
+ if (STRNEQ(virKeyFileGetValueString(kf, "Foo", "three"),
"The third entry")) {
VIR_DEBUG("Wrong value for 'Foo.one'");
goto cleanup;
@@ -94,7 +94,7 @@ static int testParse(const void *args ATTRIBUTE_UNUSED)
VIR_DEBUG("Missing Value 'Bar.one'");
goto cleanup;
}
- if (!STREQ(virKeyFileGetValueString(kf, "Bar", "one"),
+ if (STRNEQ(virKeyFileGetValueString(kf, "Bar", "one"),
"The first entry in second group")) {
VIR_DEBUG("Wrong value for 'Bar.one'");
goto cleanup;
diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c
index 1ababad9c..ce9eeabc9 100644
--- a/tests/virnetsockettest.c
+++ b/tests/virnetsockettest.c
@@ -406,7 +406,7 @@ static int testSocketSSH(const void *opaque)
}
buf[rv] = '\0';
- if (!STREQ(buf, data->expectOut)) {
+ if (STRNEQ(buf, data->expectOut)) {
virtTestDifference(stderr, data->expectOut, buf);
goto cleanup;
}
diff --git a/tests/virtypedparamtest.c b/tests/virtypedparamtest.c
index b7bd72f50..f4a57925e 100644
--- a/tests/virtypedparamtest.c
+++ b/tests/virtypedparamtest.c
@@ -188,7 +188,7 @@ testTypedParamsGetStringList(const void *opaque ATTRIBUTE_UNUSED)
goto cleanup;
continue;
}
- if (!STREQLEN(strings[i], "bar", 3))
+ if (STRNEQLEN(strings[i], "bar", 3))
goto cleanup;
if (strings[i][3] != l++)
goto cleanup;
diff --git a/tests/viruritest.c b/tests/viruritest.c
index 48b586568..e58e353ce 100644
--- a/tests/viruritest.c
+++ b/tests/viruritest.c
@@ -58,13 +58,13 @@ static int testURIParse(const void *args)
if (!(uri = virURIParse(data->uri)))
goto cleanup;
- if (!STREQ(uri->scheme, data->scheme)) {
+ if (STRNEQ(uri->scheme, data->scheme)) {
VIR_DEBUG("Expected scheme '%s', actual '%s'",
data->scheme, uri->scheme);
goto cleanup;
}
- if (!STREQ(uri->server, data->server)) {
+ if (STRNEQ(uri->server, data->server)) {
VIR_DEBUG("Expected server '%s', actual '%s'",
data->server, uri->server);
goto cleanup;
@@ -76,31 +76,31 @@ static int testURIParse(const void *args)
goto cleanup;
}
- if (!STREQ_NULLABLE(uri->path, data->path)) {
+ if (STRNEQ_NULLABLE(uri->path, data->path)) {
VIR_DEBUG("Expected path '%s', actual '%s'",
data->path, uri->path);
goto cleanup;
}
- if (!STREQ_NULLABLE(uri->query, data->query)) {
+ if (STRNEQ_NULLABLE(uri->query, data->query)) {
VIR_DEBUG("Expected query '%s', actual '%s'",
data->query, uri->query);
goto cleanup;
}
- if (!STREQ_NULLABLE(uri->fragment, data->fragment)) {
+ if (STRNEQ_NULLABLE(uri->fragment, data->fragment)) {
VIR_DEBUG("Expected fragment '%s', actual '%s'",
data->fragment, uri->fragment);
goto cleanup;
}
for (i = 0; data->params && data->params[i].name && i < uri->paramsCount; i++) {
- if (!STREQ_NULLABLE(data->params[i].name, uri->params[i].name)) {
+ if (STRNEQ_NULLABLE(data->params[i].name, uri->params[i].name)) {
VIR_DEBUG("Expected param name %zu '%s', actual '%s'",
i, data->params[i].name, uri->params[i].name);
goto cleanup;
}
- if (!STREQ_NULLABLE(data->params[i].value, uri->params[i].value)) {
+ if (STRNEQ_NULLABLE(data->params[i].value, uri->params[i].value)) {
VIR_DEBUG("Expected param value %zu '%s', actual '%s'",
i, data->params[i].value, uri->params[i].value);
goto cleanup;
@@ -123,7 +123,7 @@ static int testURIParse(const void *args)
if (!(uristr = virURIFormat(uri)))
goto cleanup;
- if (!STREQ(uristr, data->uri_out)) {
+ if (STRNEQ(uristr, data->uri_out)) {
VIR_DEBUG("URI did not roundtrip, expect '%s', actual '%s'",
data->uri_out, uristr);
goto cleanup;