aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/avocado/avocado_qemu/__init__.py9
-rw-r--r--tests/avocado/info_usernet.py1
-rw-r--r--tests/avocado/migration.py4
-rw-r--r--tests/avocado/replay_linux.py1
-rw-r--r--tests/migration/stress.c2
-rw-r--r--tests/qtest/ac97-test.c2
-rw-r--r--tests/qtest/bios-tables-test.c10
-rw-r--r--tests/qtest/cdrom-test.c2
-rw-r--r--tests/qtest/cxl-test.c10
-rw-r--r--tests/qtest/device-plug-test.c2
-rw-r--r--tests/qtest/e1000e-test.c2
-rw-r--r--tests/qtest/fuzz/generic_fuzz.c8
-rw-r--r--tests/qtest/fuzz/generic_fuzz_configs.h2
-rw-r--r--tests/qtest/fuzz/qos_fuzz.c2
-rw-r--r--tests/qtest/i440fx-test.c6
-rw-r--r--tests/qtest/ivshmem-test.c4
-rw-r--r--tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c2
-rw-r--r--tests/qtest/libqos/arm-imx25-pdk-machine.c2
-rw-r--r--tests/qtest/libqos/arm-n800-machine.c2
-rw-r--r--tests/qtest/libqos/arm-raspi2-machine.c2
-rw-r--r--tests/qtest/libqos/arm-sabrelite-machine.c2
-rw-r--r--tests/qtest/libqos/arm-smdkc210-machine.c2
-rw-r--r--tests/qtest/libqos/arm-virt-machine.c2
-rw-r--r--tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c2
-rw-r--r--tests/qtest/libqos/e1000e.c2
-rw-r--r--tests/qtest/libqos/generic-pcihost.h2
-rw-r--r--tests/qtest/libqos/libqos-malloc.c (renamed from tests/qtest/libqos/malloc.c)2
-rw-r--r--tests/qtest/libqos/libqos-malloc.h (renamed from tests/qtest/libqos/malloc.h)0
-rw-r--r--tests/qtest/libqos/libqos.c2
-rw-r--r--tests/qtest/libqos/libqos.h2
-rw-r--r--tests/qtest/libqos/malloc-pc.h2
-rw-r--r--tests/qtest/libqos/malloc-spapr.h2
-rw-r--r--tests/qtest/libqos/meson.build2
-rw-r--r--tests/qtest/libqos/pci-pc.h2
-rw-r--r--tests/qtest/libqos/pci-spapr.h2
-rw-r--r--tests/qtest/libqos/qgraph.h2
-rw-r--r--tests/qtest/libqos/qos_external.c2
-rw-r--r--tests/qtest/libqos/qos_external.h2
-rw-r--r--tests/qtest/libqos/rtas.h2
-rw-r--r--tests/qtest/libqos/virtio-9p.c4
-rw-r--r--tests/qtest/libqos/virtio-mmio.c2
-rw-r--r--tests/qtest/libqos/virtio-pci.c2
-rw-r--r--tests/qtest/libqos/virtio.h2
-rw-r--r--tests/qtest/libqtest.c4
-rw-r--r--tests/qtest/m48t59-test.c2
-rw-r--r--tests/qtest/machine-none-test.c2
-rw-r--r--tests/qtest/meson.build7
-rw-r--r--tests/qtest/migration-helpers.c2
-rw-r--r--tests/qtest/migration-helpers.h2
-rw-r--r--tests/qtest/migration-test.c22
-rw-r--r--tests/qtest/npcm7xx_emc-test.c8
-rw-r--r--tests/qtest/prom-env-test.c4
-rw-r--r--tests/qtest/qmp-test.c4
-rw-r--r--tests/qtest/qos-test.c2
-rw-r--r--tests/qtest/rtc-test.c2
-rw-r--r--tests/qtest/vhost-user-test.c4
-rw-r--r--tests/unit/test-crypto-tlscredsx509.c4
-rw-r--r--tests/unit/test-crypto-tlssession.c6
-rw-r--r--tests/unit/test-io-channel-tls.c6
-rw-r--r--tests/unit/test-qga.c2
-rwxr-xr-xtests/vm/freebsd3
-rwxr-xr-xtests/vm/haiku.x86_643
-rwxr-xr-xtests/vm/netbsd3
63 files changed, 137 insertions, 76 deletions
diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py
index 9d17a28..5f1d3e5 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -299,6 +299,12 @@ class QemuSystemTest(QemuBaseTest):
self.cancel("%s accelerator does not seem to be "
"available" % accelerator)
+ def require_netdev(self, netdevname):
+ netdevhelp = run_cmd([self.qemu_bin,
+ '-M', 'none', '-netdev', 'help'])[0];
+ if netdevhelp.find('\n' + netdevname + '\n') < 0:
+ self.cancel('no support for user networking')
+
def _new_vm(self, name, *args):
self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_")
vm = QEMUMachine(self.qemu_bin, base_temp_dir=self.workdir,
@@ -512,7 +518,7 @@ class LinuxDistro:
class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
"""Facilitates having a cloud-image Linux based available.
- For tests that indent to interact with guests, this is a better choice
+ For tests that intend to interact with guests, this is a better choice
to start with than the more vanilla `QemuSystemTest` class.
"""
@@ -550,6 +556,7 @@ class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'):
super().setUp()
+ self.require_netdev('user')
self._set_distro()
self.vm.add_args('-smp', self.smp)
self.vm.add_args('-m', self.memory)
diff --git a/tests/avocado/info_usernet.py b/tests/avocado/info_usernet.py
index dc01f74..b862a47 100644
--- a/tests/avocado/info_usernet.py
+++ b/tests/avocado/info_usernet.py
@@ -16,6 +16,7 @@ from qemu.utils import get_info_usernet_hostfwd_port
class InfoUsernet(QemuSystemTest):
def test_hostfwd(self):
+ self.require_netdev('user')
self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22')
self.vm.launch()
res = self.vm.command('human-monitor-command',
diff --git a/tests/avocado/migration.py b/tests/avocado/migration.py
index 584d6ef..4b25680 100644
--- a/tests/avocado/migration.py
+++ b/tests/avocado/migration.py
@@ -14,7 +14,7 @@ import tempfile
from avocado_qemu import QemuSystemTest
from avocado import skipUnless
-from avocado.utils import network
+from avocado.utils.network import ports
from avocado.utils import wait
from avocado.utils.path import find_command
@@ -57,7 +57,7 @@ class Migration(QemuSystemTest):
self.assert_migration(source_vm, dest_vm)
def _get_free_port(self):
- port = network.find_free_port()
+ port = ports.find_free_port()
if port is None:
self.cancel('Failed to find a free port')
return port
diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py
index e1f9981..a76dd50 100644
--- a/tests/avocado/replay_linux.py
+++ b/tests/avocado/replay_linux.py
@@ -55,6 +55,7 @@ class ReplayLinux(LinuxTest):
'%s,drive=disk%s-rr%s' % (device, id, bus_string))
def launch_and_wait(self, record, args, shift):
+ self.require_netdev('user')
vm = self.get_vm()
vm.add_args('-smp', '1')
vm.add_args('-m', '1024')
diff --git a/tests/migration/stress.c b/tests/migration/stress.c
index b7240a1..88acf8d 100644
--- a/tests/migration/stress.c
+++ b/tests/migration/stress.c
@@ -232,7 +232,7 @@ static void stress(unsigned long long ramsizeGB, int ncpus)
static int mount_misc(const char *fstype, const char *dir)
{
- if (mkdir(dir, 0755) < 0 && errno != EEXIST) {
+ if (g_mkdir_with_parents(dir, 0755) < 0 && errno != EEXIST) {
fprintf(stderr, "%s (%05d): ERROR: cannot create %s: %s\n",
argv0, gettid(), dir, strerror(errno));
return -1;
diff --git a/tests/qtest/ac97-test.c b/tests/qtest/ac97-test.c
index b084e31..74103ef 100644
--- a/tests/qtest/ac97-test.c
+++ b/tests/qtest/ac97-test.c
@@ -28,7 +28,7 @@ static void *ac97_get_driver(void *obj, const char *interface)
return &ac97->dev;
}
- fprintf(stderr, "%s not present in e1000e\n", interface);
+ fprintf(stderr, "%s not present in ac97\n", interface);
g_assert_not_reached();
}
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 7c5f736..3678396 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -1461,6 +1461,7 @@ static void test_acpi_piix4_tcg_acpi_hmat(void)
test_acpi_tcg_acpi_hmat(MACHINE_PC);
}
+#ifdef CONFIG_POSIX
static void test_acpi_erst(const char *machine)
{
gchar *tmp_path = g_dir_make_tmp("qemu-test-erst.XXXXXX", NULL);
@@ -1511,6 +1512,7 @@ static void test_acpi_microvm_acpi_erst(void)
g_free(tmp_path);
free_test_data(&data);
}
+#endif /* CONFIG_POSIX */
static void test_acpi_virt_tcg(void)
{
@@ -1551,6 +1553,7 @@ static void test_acpi_q35_viot(void)
free_test_data(&data);
}
+#ifdef CONFIG_POSIX
static void test_acpi_q35_cxl(void)
{
gchar *tmp_path = g_dir_make_tmp("qemu-test-cxl.XXXXXX", NULL);
@@ -1593,6 +1596,7 @@ static void test_acpi_q35_cxl(void)
g_free(tmp_path);
free_test_data(&data);
}
+#endif /* CONFIG_POSIX */
static void test_acpi_virt_viot(void)
{
@@ -1805,8 +1809,10 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/q35/dimmpxm", test_acpi_q35_tcg_dimm_pxm);
qtest_add_func("acpi/piix4/acpihmat", test_acpi_piix4_tcg_acpi_hmat);
qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat);
+#ifdef CONFIG_POSIX
qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst);
qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst);
+#endif
qtest_add_func("acpi/q35/applesmc", test_acpi_q35_applesmc);
qtest_add_func("acpi/q35/pvpanic-isa", test_acpi_q35_pvpanic_isa);
qtest_add_func("acpi/microvm", test_acpi_microvm_tcg);
@@ -1818,7 +1824,9 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/q35/ivrs", test_acpi_q35_tcg_ivrs);
if (strcmp(arch, "x86_64") == 0) {
qtest_add_func("acpi/microvm/pcie", test_acpi_microvm_pcie_tcg);
+#ifdef CONFIG_POSIX
qtest_add_func("acpi/microvm/acpierst", test_acpi_microvm_acpi_erst);
+#endif
}
}
if (has_kvm) {
@@ -1826,7 +1834,9 @@ int main(int argc, char *argv[])
qtest_add_func("acpi/q35/kvm/dmar", test_acpi_q35_kvm_dmar);
}
qtest_add_func("acpi/q35/viot", test_acpi_q35_viot);
+#ifdef CONFIG_POSIX
qtest_add_func("acpi/q35/cxl", test_acpi_q35_cxl);
+#endif
qtest_add_func("acpi/q35/slic", test_acpi_q35_slic);
} else if (strcmp(arch, "aarch64") == 0) {
if (has_tcg) {
diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c
index a7766a9..26a2400 100644
--- a/tests/qtest/cdrom-test.c
+++ b/tests/qtest/cdrom-test.c
@@ -52,7 +52,7 @@ static int prepare_image(const char *arch, char *isoimage)
perror("Error creating temporary iso image file");
return -1;
}
- if (!mkdtemp(srcdir)) {
+ if (!g_mkdtemp(srcdir)) {
perror("Error creating temporary directory");
goto cleanup;
}
diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c
index 2133e97..2e14da7 100644
--- a/tests/qtest/cxl-test.c
+++ b/tests/qtest/cxl-test.c
@@ -89,13 +89,14 @@ static void cxl_2root_port(void)
qtest_end();
}
+#ifdef CONFIG_POSIX
static void cxl_t3d(void)
{
g_autoptr(GString) cmdline = g_string_new(NULL);
char template[] = "/tmp/cxl-test-XXXXXX";
const char *tmpfs;
- tmpfs = mkdtemp(template);
+ tmpfs = g_mkdtemp(template);
g_string_printf(cmdline, QEMU_PXB_CMD QEMU_RP QEMU_T3D, tmpfs, tmpfs);
@@ -109,7 +110,7 @@ static void cxl_1pxb_2rp_2t3d(void)
char template[] = "/tmp/cxl-test-XXXXXX";
const char *tmpfs;
- tmpfs = mkdtemp(template);
+ tmpfs = g_mkdtemp(template);
g_string_printf(cmdline, QEMU_PXB_CMD QEMU_2RP QEMU_2T3D,
tmpfs, tmpfs, tmpfs, tmpfs);
@@ -124,7 +125,7 @@ static void cxl_2pxb_4rp_4t3d(void)
char template[] = "/tmp/cxl-test-XXXXXX";
const char *tmpfs;
- tmpfs = mkdtemp(template);
+ tmpfs = g_mkdtemp(template);
g_string_printf(cmdline, QEMU_2PXB_CMD QEMU_4RP QEMU_4T3D,
tmpfs, tmpfs, tmpfs, tmpfs, tmpfs, tmpfs,
@@ -133,6 +134,7 @@ static void cxl_2pxb_4rp_4t3d(void)
qtest_start(cmdline->str);
qtest_end();
}
+#endif /* CONFIG_POSIX */
int main(int argc, char **argv)
{
@@ -144,8 +146,10 @@ int main(int argc, char **argv)
qtest_add_func("/pci/cxl/pxb_x2_with_window", cxl_2pxb_with_window);
qtest_add_func("/pci/cxl/rp", cxl_root_port);
qtest_add_func("/pci/cxl/rp_x2", cxl_2root_port);
+#ifdef CONFIG_POSIX
qtest_add_func("/pci/cxl/type3_device", cxl_t3d);
qtest_add_func("/pci/cxl/rp_x2_type3_x2", cxl_1pxb_2rp_2t3d);
qtest_add_func("/pci/cxl/pxb_x2_root_port_x4_type3_x4", cxl_2pxb_4rp_4t3d);
+#endif
return g_test_run();
}
diff --git a/tests/qtest/device-plug-test.c b/tests/qtest/device-plug-test.c
index 2e31378..a1fb99c 100644
--- a/tests/qtest/device-plug-test.c
+++ b/tests/qtest/device-plug-test.c
@@ -95,7 +95,7 @@ static void test_pci_unplug_json_request(void)
}
QTestState *qtest = qtest_initf(
- "%s -device '{\"driver\": \"virtio-mouse-pci\", \"id\": \"dev0\"}'",
+ "%s -device \"{'driver': 'virtio-mouse-pci', 'id': 'dev0'}\"",
machine_addition);
/*
diff --git a/tests/qtest/e1000e-test.c b/tests/qtest/e1000e-test.c
index c98779c..4cdd823 100644
--- a/tests/qtest/e1000e-test.c
+++ b/tests/qtest/e1000e-test.c
@@ -31,7 +31,7 @@
#include "qemu/iov.h"
#include "qemu/module.h"
#include "qemu/bitops.h"
-#include "libqos/malloc.h"
+#include "libqos/libqos-malloc.h"
#include "libqos/e1000e.h"
static void e1000e_send_verify(QE1000E *d, int *test_sockets, QGuestAllocator *alloc)
diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuzz.c
index 447ffe8..afc1d20 100644
--- a/tests/qtest/fuzz/generic_fuzz.c
+++ b/tests/qtest/fuzz/generic_fuzz.c
@@ -994,16 +994,16 @@ static GString *generic_fuzz_predefined_config_cmdline(FuzzTarget *t)
g_assert(t->opaque);
config = t->opaque;
- setenv("QEMU_AVOID_DOUBLE_FETCH", "1", 1);
+ g_setenv("QEMU_AVOID_DOUBLE_FETCH", "1", 1);
if (config->argfunc) {
args = config->argfunc();
- setenv("QEMU_FUZZ_ARGS", args, 1);
+ g_setenv("QEMU_FUZZ_ARGS", args, 1);
g_free(args);
} else {
g_assert_nonnull(config->args);
- setenv("QEMU_FUZZ_ARGS", config->args, 1);
+ g_setenv("QEMU_FUZZ_ARGS", config->args, 1);
}
- setenv("QEMU_FUZZ_OBJECTS", config->objects, 1);
+ g_setenv("QEMU_FUZZ_OBJECTS", config->objects, 1);
return generic_fuzz_cmdline(t);
}
diff --git a/tests/qtest/fuzz/generic_fuzz_configs.h b/tests/qtest/fuzz/generic_fuzz_configs.h
index 004c701..0775e67 100644
--- a/tests/qtest/fuzz/generic_fuzz_configs.h
+++ b/tests/qtest/fuzz/generic_fuzz_configs.h
@@ -21,7 +21,7 @@ typedef struct generic_fuzz_config {
static inline gchar *generic_fuzzer_virtio_9p_args(void){
char tmpdir[] = "/tmp/qemu-fuzz.XXXXXX";
- g_assert_nonnull(mkdtemp(tmpdir));
+ g_assert_nonnull(g_mkdtemp(tmpdir));
return g_strdup_printf("-machine q35 -nodefaults "
"-device virtio-9p,fsdev=hshare,mount_tag=hshare "
diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c
index c856d3d..3a3d9c1 100644
--- a/tests/qtest/fuzz/qos_fuzz.c
+++ b/tests/qtest/fuzz/qos_fuzz.c
@@ -23,7 +23,7 @@
#include "qemu/main-loop.h"
#include "tests/qtest/libqtest.h"
-#include "tests/qtest/libqos/malloc.h"
+#include "tests/qtest/libqos/libqos-malloc.h"
#include "tests/qtest/libqos/qgraph.h"
#include "tests/qtest/libqos/qgraph_internal.h"
#include "tests/qtest/libqos/qos_external.h"
diff --git a/tests/qtest/i440fx-test.c b/tests/qtest/i440fx-test.c
index 6d7d4d8..3890f12 100644
--- a/tests/qtest/i440fx-test.c
+++ b/tests/qtest/i440fx-test.c
@@ -278,6 +278,8 @@ static void test_i440fx_pam(gconstpointer opaque)
qtest_end();
}
+#ifndef _WIN32
+
#define BLOB_SIZE ((size_t)65536)
#define ISA_BIOS_MAXSZ ((size_t)(128 * 1024))
@@ -396,6 +398,8 @@ static void request_pflash(FirmwareTestFixture *fixture,
fixture->is_bios = false;
}
+#endif /* _WIN32 */
+
int main(int argc, char **argv)
{
TestData data;
@@ -406,8 +410,10 @@ int main(int argc, char **argv)
qtest_add_data_func("i440fx/defaults", &data, test_i440fx_defaults);
qtest_add_data_func("i440fx/pam", &data, test_i440fx_pam);
+#ifndef _WIN32
add_firmware_test("i440fx/firmware/bios", request_bios);
add_firmware_test("i440fx/firmware/pflash", request_pflash);
+#endif
return g_test_run();
}
diff --git a/tests/qtest/ivshmem-test.c b/tests/qtest/ivshmem-test.c
index e23a97f..9611d05 100644
--- a/tests/qtest/ivshmem-test.c
+++ b/tests/qtest/ivshmem-test.c
@@ -481,8 +481,8 @@ int main(int argc, char **argv)
tmpshmem = mmap(0, TMPSHMSIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
g_assert(tmpshmem != MAP_FAILED);
/* server */
- if (mkdtemp(dir) == NULL) {
- g_error("mkdtemp: %s", g_strerror(errno));
+ if (g_mkdtemp(dir) == NULL) {
+ g_error("g_mkdtemp: %s", g_strerror(errno));
}
tmpdir = dir;
tmpserver = g_strconcat(tmpdir, "/server", NULL);
diff --git a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c b/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c
index c8a3ea1..ab24add 100644
--- a/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c
+++ b/tests/qtest/libqos/aarch64-xlnx-zcu102-machine.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
#include "qemu/module.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "sdhci.h"
diff --git a/tests/qtest/libqos/arm-imx25-pdk-machine.c b/tests/qtest/libqos/arm-imx25-pdk-machine.c
index 54d0c95..8fe128f 100644
--- a/tests/qtest/libqos/arm-imx25-pdk-machine.c
+++ b/tests/qtest/libqos/arm-imx25-pdk-machine.c
@@ -20,7 +20,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "i2c.h"
diff --git a/tests/qtest/libqos/arm-n800-machine.c b/tests/qtest/libqos/arm-n800-machine.c
index ecd46b1..4e5afe0 100644
--- a/tests/qtest/libqos/arm-n800-machine.c
+++ b/tests/qtest/libqos/arm-n800-machine.c
@@ -20,7 +20,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "i2c.h"
diff --git a/tests/qtest/libqos/arm-raspi2-machine.c b/tests/qtest/libqos/arm-raspi2-machine.c
index 0a29434..367c6c1 100644
--- a/tests/qtest/libqos/arm-raspi2-machine.c
+++ b/tests/qtest/libqos/arm-raspi2-machine.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
#include "qemu/module.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "sdhci.h"
diff --git a/tests/qtest/libqos/arm-sabrelite-machine.c b/tests/qtest/libqos/arm-sabrelite-machine.c
index ec19a01..94f6a20 100644
--- a/tests/qtest/libqos/arm-sabrelite-machine.c
+++ b/tests/qtest/libqos/arm-sabrelite-machine.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
#include "qemu/module.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "sdhci.h"
diff --git a/tests/qtest/libqos/arm-smdkc210-machine.c b/tests/qtest/libqos/arm-smdkc210-machine.c
index 4bff249..9bbce92 100644
--- a/tests/qtest/libqos/arm-smdkc210-machine.c
+++ b/tests/qtest/libqos/arm-smdkc210-machine.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
#include "qemu/module.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "sdhci.h"
diff --git a/tests/qtest/libqos/arm-virt-machine.c b/tests/qtest/libqos/arm-virt-machine.c
index 139eaba..4e87405 100644
--- a/tests/qtest/libqos/arm-virt-machine.c
+++ b/tests/qtest/libqos/arm-virt-machine.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
#include "qemu/module.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "virtio-mmio.h"
#include "generic-pcihost.h"
diff --git a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c b/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c
index 3be8002..daac762 100644
--- a/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c
+++ b/tests/qtest/libqos/arm-xilinx-zynq-a9-machine.c
@@ -19,7 +19,7 @@
#include "qemu/osdep.h"
#include "../libqtest.h"
#include "qemu/module.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "sdhci.h"
diff --git a/tests/qtest/libqos/e1000e.c b/tests/qtest/libqos/e1000e.c
index f87e0e8..fc14b07 100644
--- a/tests/qtest/libqos/e1000e.c
+++ b/tests/qtest/libqos/e1000e.c
@@ -23,7 +23,7 @@
#include "qemu/iov.h"
#include "qemu/module.h"
#include "qemu/bitops.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "e1000e.h"
diff --git a/tests/qtest/libqos/generic-pcihost.h b/tests/qtest/libqos/generic-pcihost.h
index c693c76..6493a87 100644
--- a/tests/qtest/libqos/generic-pcihost.h
+++ b/tests/qtest/libqos/generic-pcihost.h
@@ -14,7 +14,7 @@
#define LIBQOS_GENERIC_PCIHOST_H
#include "pci.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
typedef struct QGenericPCIBus {
diff --git a/tests/qtest/libqos/malloc.c b/tests/qtest/libqos/libqos-malloc.c
index f0c8f95..d756697 100644
--- a/tests/qtest/libqos/malloc.c
+++ b/tests/qtest/libqos/libqos-malloc.c
@@ -11,7 +11,7 @@
*/
#include "qemu/osdep.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qemu/host-utils.h"
typedef struct MemBlock {
diff --git a/tests/qtest/libqos/malloc.h b/tests/qtest/libqos/libqos-malloc.h
index bbb8c74..bbb8c74 100644
--- a/tests/qtest/libqos/malloc.h
+++ b/tests/qtest/libqos/libqos-malloc.h
diff --git a/tests/qtest/libqos/libqos.c b/tests/qtest/libqos/libqos.c
index 85c7641..5ffda08 100644
--- a/tests/qtest/libqos/libqos.c
+++ b/tests/qtest/libqos/libqos.c
@@ -1,6 +1,4 @@
#include "qemu/osdep.h"
-#include <sys/wait.h>
-
#include "../libqtest.h"
#include "libqos.h"
#include "pci.h"
diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h
index ba7df44..9b4dd50 100644
--- a/tests/qtest/libqos/libqos.h
+++ b/tests/qtest/libqos/libqos.h
@@ -3,7 +3,7 @@
#include "../libqtest.h"
#include "pci.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
typedef struct QOSState QOSState;
diff --git a/tests/qtest/libqos/malloc-pc.h b/tests/qtest/libqos/malloc-pc.h
index d8d7985..e531473 100644
--- a/tests/qtest/libqos/malloc-pc.h
+++ b/tests/qtest/libqos/malloc-pc.h
@@ -13,7 +13,7 @@
#ifndef LIBQOS_MALLOC_PC_H
#define LIBQOS_MALLOC_PC_H
-#include "malloc.h"
+#include "libqos-malloc.h"
void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags);
diff --git a/tests/qtest/libqos/malloc-spapr.h b/tests/qtest/libqos/malloc-spapr.h
index f99572f..f544c0d 100644
--- a/tests/qtest/libqos/malloc-spapr.h
+++ b/tests/qtest/libqos/malloc-spapr.h
@@ -8,7 +8,7 @@
#ifndef LIBQOS_MALLOC_SPAPR_H
#define LIBQOS_MALLOC_SPAPR_H
-#include "malloc.h"
+#include "libqos-malloc.h"
void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags);
diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build
index fd5d6e5..cff83c8 100644
--- a/tests/qtest/libqos/meson.build
+++ b/tests/qtest/libqos/meson.build
@@ -6,7 +6,7 @@ libqos_srcs = files(
'qos_external.c',
'pci.c',
'fw_cfg.c',
- 'malloc.c',
+ 'libqos-malloc.c',
'libqos.c',
'sdhci-cmd.c',
diff --git a/tests/qtest/libqos/pci-pc.h b/tests/qtest/libqos/pci-pc.h
index 49ec950..849bd49 100644
--- a/tests/qtest/libqos/pci-pc.h
+++ b/tests/qtest/libqos/pci-pc.h
@@ -14,7 +14,7 @@
#define LIBQOS_PCI_PC_H
#include "pci.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
typedef struct QPCIBusPC {
diff --git a/tests/qtest/libqos/pci-spapr.h b/tests/qtest/libqos/pci-spapr.h
index 20a4371..3dbf1e5 100644
--- a/tests/qtest/libqos/pci-spapr.h
+++ b/tests/qtest/libqos/pci-spapr.h
@@ -8,7 +8,7 @@
#ifndef LIBQOS_PCI_SPAPR_H
#define LIBQOS_PCI_SPAPR_H
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "pci.h"
#include "qgraph.h"
diff --git a/tests/qtest/libqos/qgraph.h b/tests/qtest/libqos/qgraph.h
index 871740c..6e94824 100644
--- a/tests/qtest/libqos/qgraph.h
+++ b/tests/qtest/libqos/qgraph.h
@@ -21,7 +21,7 @@
#include <gmodule.h>
#include "qemu/module.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
/* maximum path length */
#define QOS_PATH_MAX_ELEMENT_SIZE 50
diff --git a/tests/qtest/libqos/qos_external.c b/tests/qtest/libqos/qos_external.c
index b7a0b87..c6bb8bf 100644
--- a/tests/qtest/libqos/qos_external.c
+++ b/tests/qtest/libqos/qos_external.c
@@ -24,7 +24,7 @@
#include "qapi/qmp/qstring.h"
#include "qemu/module.h"
#include "qapi/qmp/qlist.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "qgraph_internal.h"
#include "qos_external.h"
diff --git a/tests/qtest/libqos/qos_external.h b/tests/qtest/libqos/qos_external.h
index 8446e3d..ea37364 100644
--- a/tests/qtest/libqos/qos_external.h
+++ b/tests/qtest/libqos/qos_external.h
@@ -21,7 +21,7 @@
#include "qgraph.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qapi/qapi-types-machine.h"
#include "qapi/qapi-types-qom.h"
diff --git a/tests/qtest/libqos/rtas.h b/tests/qtest/libqos/rtas.h
index f38f99d..be8353d 100644
--- a/tests/qtest/libqos/rtas.h
+++ b/tests/qtest/libqos/rtas.h
@@ -5,7 +5,7 @@
#ifndef LIBQOS_RTAS_H
#define LIBQOS_RTAS_H
-#include "malloc.h"
+#include "libqos-malloc.h"
int qrtas_get_time_of_day(QTestState *qts, QGuestAllocator *alloc,
struct tm *tm, uint32_t *ns);
diff --git a/tests/qtest/libqos/virtio-9p.c b/tests/qtest/libqos/virtio-9p.c
index 70aea8b..ae9b0a2 100644
--- a/tests/qtest/libqos/virtio-9p.c
+++ b/tests/qtest/libqos/virtio-9p.c
@@ -48,9 +48,9 @@ void virtio_9p_create_local_test_dir(void)
*/
char *template = concat_path(pwd, "qtest-9p-local-XXXXXX");
- local_test_path = mkdtemp(template);
+ local_test_path = g_mkdtemp(template);
if (!local_test_path) {
- g_test_message("mkdtemp('%s') failed: %s", template, strerror(errno));
+ g_test_message("g_mkdtemp('%s') failed: %s", template, strerror(errno));
}
g_assert(local_test_path != NULL);
diff --git a/tests/qtest/libqos/virtio-mmio.c b/tests/qtest/libqos/virtio-mmio.c
index a6cca86..bd0b1d8 100644
--- a/tests/qtest/libqos/virtio-mmio.c
+++ b/tests/qtest/libqos/virtio-mmio.c
@@ -12,7 +12,7 @@
#include "qemu/module.h"
#include "virtio.h"
#include "virtio-mmio.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "qgraph.h"
#include "standard-headers/linux/virtio_ring.h"
diff --git a/tests/qtest/libqos/virtio-pci.c b/tests/qtest/libqos/virtio-pci.c
index 67c2498..485b8f6 100644
--- a/tests/qtest/libqos/virtio-pci.c
+++ b/tests/qtest/libqos/virtio-pci.c
@@ -13,7 +13,7 @@
#include "virtio-pci.h"
#include "pci.h"
#include "pci-pc.h"
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "malloc-pc.h"
#include "qgraph.h"
#include "standard-headers/linux/virtio_ring.h"
diff --git a/tests/qtest/libqos/virtio.h b/tests/qtest/libqos/virtio.h
index b8bd06e..7adc7cb 100644
--- a/tests/qtest/libqos/virtio.h
+++ b/tests/qtest/libqos/virtio.h
@@ -10,7 +10,7 @@
#ifndef LIBQOS_VIRTIO_H
#define LIBQOS_VIRTIO_H
-#include "malloc.h"
+#include "libqos-malloc.h"
#include "standard-headers/linux/virtio_ring.h"
#define QVIRTIO_F_BAD_FEATURE 0x40000000ull
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 8c159ea..7c9fc07 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -393,7 +393,7 @@ QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd)
char *sock_path, sock_dir[] = "/tmp/qtest-serial-XXXXXX";
QTestState *qts;
- g_assert_true(mkdtemp(sock_dir) != NULL);
+ g_assert_true(g_mkdtemp(sock_dir) != NULL);
sock_path = g_strdup_printf("%s/sock", sock_dir);
sock_fd_init = init_socket(sock_path);
@@ -1424,7 +1424,7 @@ QTestState *qtest_inproc_init(QTestState **s, bool log, const char* arch,
* way, qtest_get_arch works for inproc qtest.
*/
gchar *bin_path = g_strconcat("/qemu-system-", arch, NULL);
- setenv("QTEST_QEMU_BINARY", bin_path, 0);
+ g_setenv("QTEST_QEMU_BINARY", bin_path, 0);
g_free(bin_path);
return qts;
diff --git a/tests/qtest/m48t59-test.c b/tests/qtest/m48t59-test.c
index b94a123..843d2ce 100644
--- a/tests/qtest/m48t59-test.c
+++ b/tests/qtest/m48t59-test.c
@@ -137,7 +137,7 @@ static void cmos_get_date_time(QTestState *s, struct tm *date)
date->tm_mday = mday;
date->tm_mon = mon - 1;
date->tm_year = base_year + year - 1900;
-#ifndef __sun__
+#if !defined(__sun__) && !defined(_WIN32)
date->tm_gmtoff = 0;
#endif
diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c
index f92fab4..31cc0bf 100644
--- a/tests/qtest/machine-none-test.c
+++ b/tests/qtest/machine-none-test.c
@@ -81,7 +81,7 @@ static void test_machine_cpu_cli(void)
" add it to cpus_map\n", arch);
return; /* TODO: die here to force all targets have a test */
}
- qts = qtest_initf("-machine none -cpu '%s'", cpu_model);
+ qts = qtest_initf("-machine none -cpu \"%s\"", cpu_model);
response = qtest_qmp(qts, "{ 'execute': 'quit' }");
g_assert(qdict_haskey(response, "return"));
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index be4b30d..e910cb3 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -71,7 +71,8 @@ qtests_i386 = \
(config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
(config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
(config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
- (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
+ (config_host.has_key('CONFIG_POSIX') and \
+ 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_Q35') and \
config_all_devices.has_key('CONFIG_VIRTIO_PCI') and \
@@ -239,7 +240,6 @@ qos_test_ss.add(
'adm1272-test.c',
'ds1338-test.c',
'e1000-test.c',
- 'e1000e-test.c',
'eepro100-test.c',
'es1370-test.c',
'ipoctal232-test.c',
@@ -267,6 +267,9 @@ qos_test_ss.add(
'virtio-iommu-test.c',
'vmxnet3-test.c',
)
+if config_host.has_key('CONFIG_POSIX')
+ qos_test_ss.add(files('e1000e-test.c'))
+endif
if have_virtfs
qos_test_ss.add(files('virtio-9p-test.c'))
endif
diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c
index c6fbeb3..f6f3c66 100644
--- a/tests/qtest/migration-helpers.c
+++ b/tests/qtest/migration-helpers.c
@@ -34,6 +34,7 @@ static void check_stop_event(QTestState *who)
}
}
+#ifndef _WIN32
/*
* Events can get in the way of responses we are actually waiting for.
*/
@@ -58,6 +59,7 @@ QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...)
return ret;
}
+#endif
/*
* Events can get in the way of responses we are actually waiting for.
diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h
index 5956189..db0684d 100644
--- a/tests/qtest/migration-helpers.h
+++ b/tests/qtest/migration-helpers.h
@@ -17,8 +17,10 @@
extern bool got_stop;
+#ifndef _WIN32
G_GNUC_PRINTF(3, 4)
QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...);
+#endif
G_GNUC_PRINTF(2, 3)
QDict *wait_command(QTestState *who, const char *command, ...);
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index f63edd0..4728d52 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -761,14 +761,14 @@ test_migrate_tls_psk_start_common(QTestState *from,
data->workdir = g_strdup_printf("%s/tlscredspsk0", tmpfs);
data->pskfile = g_strdup_printf("%s/%s", data->workdir,
QCRYPTO_TLS_CREDS_PSKFILE);
- mkdir(data->workdir, 0700);
+ g_mkdir_with_parents(data->workdir, 0700);
test_tls_psk_init(data->pskfile);
if (mismatch) {
data->workdiralt = g_strdup_printf("%s/tlscredspskalt0", tmpfs);
data->pskfilealt = g_strdup_printf("%s/%s", data->workdiralt,
QCRYPTO_TLS_CREDS_PSKFILE);
- mkdir(data->workdiralt, 0700);
+ g_mkdir_with_parents(data->workdiralt, 0700);
test_tls_psk_init_alt(data->pskfilealt);
}
@@ -873,12 +873,20 @@ test_migrate_tls_x509_start_common(QTestState *from,
data->clientcert = g_strdup_printf("%s/client-cert.pem", data->workdir);
}
- mkdir(data->workdir, 0700);
+ g_mkdir_with_parents(data->workdir, 0700);
test_tls_init(data->keyfile);
+#ifndef _WIN32
g_assert(link(data->keyfile, data->serverkey) == 0);
+#else
+ g_assert(CreateHardLink(data->serverkey, data->keyfile, NULL) != 0);
+#endif
if (args->clientcert) {
+#ifndef _WIN32
g_assert(link(data->keyfile, data->clientkey) == 0);
+#else
+ g_assert(CreateHardLink(data->clientkey, data->keyfile, NULL) != 0);
+#endif
}
TLS_ROOT_REQ_SIMPLE(cacertreq, data->cacert);
@@ -1623,6 +1631,7 @@ static void test_precopy_tcp_tls_x509_reject_anon_client(void)
#endif /* CONFIG_TASN1 */
#endif /* CONFIG_GNUTLS */
+#ifndef _WIN32
static void *test_migrate_fd_start_hook(QTestState *from,
QTestState *to)
{
@@ -1691,6 +1700,7 @@ static void test_migrate_fd_proto(void)
};
test_precopy_common(&args);
}
+#endif /* _WIN32 */
static void do_test_validate_uuid(MigrateStart *args, bool should_fail)
{
@@ -2452,9 +2462,9 @@ int main(int argc, char **argv)
return g_test_run();
}
- tmpfs = mkdtemp(template);
+ tmpfs = g_mkdtemp(template);
if (!tmpfs) {
- g_test_message("mkdtemp on path (%s): %s", template, strerror(errno));
+ g_test_message("g_mkdtemp on path (%s): %s", template, strerror(errno));
}
g_assert(tmpfs);
@@ -2523,7 +2533,9 @@ int main(int argc, char **argv)
#endif /* CONFIG_GNUTLS */
/* qtest_add_func("/migration/ignore_shared", test_ignore_shared); */
+#ifndef _WIN32
qtest_add_func("/migration/fd_proto", test_migrate_fd_proto);
+#endif
qtest_add_func("/migration/validate_uuid", test_validate_uuid);
qtest_add_func("/migration/validate_uuid_error", test_validate_uuid_error);
qtest_add_func("/migration/validate_uuid_src_not_set",
diff --git a/tests/qtest/npcm7xx_emc-test.c b/tests/qtest/npcm7xx_emc-test.c
index a353fef..c373d24 100644
--- a/tests/qtest/npcm7xx_emc-test.c
+++ b/tests/qtest/npcm7xx_emc-test.c
@@ -209,6 +209,7 @@ static int emc_module_index(const EMCModule *mod)
return diff;
}
+#ifndef _WIN32
static void packet_test_clear(void *sockets)
{
int *test_sockets = sockets;
@@ -243,6 +244,7 @@ static int *packet_test_init(int module_num, GString *cmd_line)
g_test_queue_destroy(packet_test_clear, test_sockets);
return test_sockets;
}
+#endif /* _WIN32 */
static uint32_t emc_read(QTestState *qts, const EMCModule *mod,
NPCM7xxPWMRegister regno)
@@ -250,6 +252,7 @@ static uint32_t emc_read(QTestState *qts, const EMCModule *mod,
return qtest_readl(qts, mod->base_addr + regno * sizeof(uint32_t));
}
+#ifndef _WIN32
static void emc_write(QTestState *qts, const EMCModule *mod,
NPCM7xxPWMRegister regno, uint32_t value)
{
@@ -339,6 +342,7 @@ static bool emc_soft_reset(QTestState *qts, const EMCModule *mod)
g_message("%s: Timeout expired", __func__);
return false;
}
+#endif /* _WIN32 */
/* Check emc registers are reset to default value. */
static void test_init(gconstpointer test_data)
@@ -387,6 +391,7 @@ static void test_init(gconstpointer test_data)
qtest_quit(qts);
}
+#ifndef _WIN32
static bool emc_wait_irq(QTestState *qts, const EMCModule *mod, int step,
bool is_tx)
{
@@ -843,6 +848,7 @@ static void test_rx(gconstpointer test_data)
qtest_quit(qts);
}
+#endif /* _WIN32 */
static void emc_add_test(const char *name, const TestData* td,
GTestDataFunc fn)
@@ -865,8 +871,10 @@ int main(int argc, char **argv)
td->module = &emc_module_list[i];
add_test(init, td);
+#ifndef _WIN32
add_test(tx, td);
add_test(rx, td);
+#endif
}
return g_test_run();
diff --git a/tests/qtest/prom-env-test.c b/tests/qtest/prom-env-test.c
index c2b0448..39ccb59 100644
--- a/tests/qtest/prom-env-test.c
+++ b/tests/qtest/prom-env-test.c
@@ -58,8 +58,8 @@ static void test_machine(const void *machine)
" -machine " PSERIES_DEFAULT_CAPABILITIES;
}
- qts = qtest_initf("-M %s -accel tcg %s -prom-env 'use-nvramrc?=true' "
- "-prom-env 'nvramrc=%x %x l!' ", (const char *)machine,
+ qts = qtest_initf("-M %s -accel tcg %s -prom-env \"use-nvramrc?=true\" "
+ "-prom-env \"nvramrc=%x %x l!\" ", (const char *)machine,
extra_args, MAGIC, ADDRESS);
check_guest_memory(qts);
qtest_quit(qts);
diff --git a/tests/qtest/qmp-test.c b/tests/qtest/qmp-test.c
index 9a42480..bf7304c 100644
--- a/tests/qtest/qmp-test.c
+++ b/tests/qtest/qmp-test.c
@@ -166,8 +166,8 @@ char *fifo_name;
static void setup_blocking_cmd(void)
{
- if (!mkdtemp(tmpdir)) {
- g_error("mkdtemp: %s", strerror(errno));
+ if (!g_mkdtemp(tmpdir)) {
+ g_error("g_mkdtemp: %s", strerror(errno));
}
fifo_name = g_strdup_printf("%s/fifo", tmpdir);
if (mkfifo(fifo_name, 0666)) {
diff --git a/tests/qtest/qos-test.c b/tests/qtest/qos-test.c
index f97d0a0..831db5c 100644
--- a/tests/qtest/qos-test.c
+++ b/tests/qtest/qos-test.c
@@ -25,7 +25,7 @@
#include "qapi/qobject-input-visitor.h"
#include "qapi/qapi-visit-machine.h"
#include "qapi/qapi-visit-qom.h"
-#include "libqos/malloc.h"
+#include "libqos/libqos-malloc.h"
#include "libqos/qgraph.h"
#include "libqos/qgraph_internal.h"
#include "libqos/qos_external.h"
diff --git a/tests/qtest/rtc-test.c b/tests/qtest/rtc-test.c
index 8126ab1..02ed4e1 100644
--- a/tests/qtest/rtc-test.c
+++ b/tests/qtest/rtc-test.c
@@ -111,7 +111,7 @@ static void cmos_get_date_time(struct tm *date)
date->tm_mday = mday;
date->tm_mon = mon - 1;
date->tm_year = base_year + year - 1900;
-#ifndef __sun__
+#if !defined(__sun__) && !defined(_WIN32)
date->tm_gmtoff = 0;
#endif
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index 8bf390b..d7d6cfc 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -491,9 +491,9 @@ static TestServer *test_server_new(const gchar *name,
/* run the main loop thread so the chardev may operate */
server->thread = g_thread_new(NULL, thread_function, server->loop);
- tmpfs = mkdtemp(template);
+ tmpfs = g_mkdtemp(template);
if (!tmpfs) {
- g_test_message("mkdtemp on path (%s): %s", template, strerror(errno));
+ g_test_message("g_mkdtemp on path (%s): %s", template, strerror(errno));
}
g_assert(tmpfs);
diff --git a/tests/unit/test-crypto-tlscredsx509.c b/tests/unit/test-crypto-tlscredsx509.c
index aab4149..3c25d75 100644
--- a/tests/unit/test-crypto-tlscredsx509.c
+++ b/tests/unit/test-crypto-tlscredsx509.c
@@ -75,7 +75,7 @@ static void test_tls_creds(const void *opaque)
QCryptoTLSCreds *creds;
#define CERT_DIR "tests/test-crypto-tlscredsx509-certs/"
- mkdir(CERT_DIR, 0700);
+ g_mkdir_with_parents(CERT_DIR, 0700);
unlink(CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);
if (data->isServer) {
@@ -141,7 +141,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
- mkdir(WORKDIR, 0700);
+ g_mkdir_with_parents(WORKDIR, 0700);
test_tls_init(KEYFILE);
diff --git a/tests/unit/test-crypto-tlssession.c b/tests/unit/test-crypto-tlssession.c
index f222959..615a134 100644
--- a/tests/unit/test-crypto-tlssession.c
+++ b/tests/unit/test-crypto-tlssession.c
@@ -249,8 +249,8 @@ static void test_crypto_tls_session_x509(const void *opaque)
#define CLIENT_CERT_DIR "tests/test-crypto-tlssession-client/"
#define SERVER_CERT_DIR "tests/test-crypto-tlssession-server/"
- mkdir(CLIENT_CERT_DIR, 0700);
- mkdir(SERVER_CERT_DIR, 0700);
+ g_mkdir_with_parents(CLIENT_CERT_DIR, 0700);
+ g_mkdir_with_parents(SERVER_CERT_DIR, 0700);
unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);
unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);
@@ -398,7 +398,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
- mkdir(WORKDIR, 0700);
+ g_mkdir_with_parents(WORKDIR, 0700);
test_tls_init(KEYFILE);
test_tls_psk_init(PSKFILE);
diff --git a/tests/unit/test-io-channel-tls.c b/tests/unit/test-io-channel-tls.c
index f6fb988..cc39247 100644
--- a/tests/unit/test-io-channel-tls.c
+++ b/tests/unit/test-io-channel-tls.c
@@ -125,8 +125,8 @@ static void test_io_channel_tls(const void *opaque)
#define CLIENT_CERT_DIR "tests/test-io-channel-tls-client/"
#define SERVER_CERT_DIR "tests/test-io-channel-tls-server/"
- mkdir(CLIENT_CERT_DIR, 0700);
- mkdir(SERVER_CERT_DIR, 0700);
+ g_mkdir_with_parents(CLIENT_CERT_DIR, 0700);
+ g_mkdir_with_parents(SERVER_CERT_DIR, 0700);
unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);
unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);
@@ -273,7 +273,7 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
g_setenv("GNUTLS_FORCE_FIPS_MODE", "2", 1);
- mkdir(WORKDIR, 0700);
+ g_mkdir_with_parents(WORKDIR, 0700);
test_tls_init(KEYFILE);
diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c
index b27c77a..a05a462 100644
--- a/tests/unit/test-qga.c
+++ b/tests/unit/test-qga.c
@@ -60,7 +60,7 @@ fixture_setup(TestFixture *fixture, gconstpointer data, gchar **envp)
fixture->loop = g_main_loop_new(NULL, FALSE);
fixture->test_dir = g_strdup("/tmp/qgatest.XXXXXX");
- g_assert_nonnull(mkdtemp(fixture->test_dir));
+ g_assert_nonnull(g_mkdtemp(fixture->test_dir));
path = g_build_filename(fixture->test_dir, "sock", NULL);
cwd = g_get_current_dir();
diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index cd1fabd..3643fe3 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -63,6 +63,9 @@ class FreeBSDVM(basevm.BaseVM):
# libs: migration
"zstd",
+
+ # libs: networking
+ "libslirp",
]
BUILD_SCRIPT = """
diff --git a/tests/vm/haiku.x86_64 b/tests/vm/haiku.x86_64
index 936f7d2..29668bc 100755
--- a/tests/vm/haiku.x86_64
+++ b/tests/vm/haiku.x86_64
@@ -71,6 +71,7 @@ class HaikuVM(basevm.BaseVM):
"devel:libpixman_1",
"devel:libpng16",
"devel:libsdl2_2.0",
+ "devel:libslirp",
"devel:libsnappy",
"devel:libssh2",
"devel:libtasn1",
@@ -89,7 +90,7 @@ class HaikuVM(basevm.BaseVM):
mkdir -p /usr/bin
ln -s /boot/system/bin/env /usr/bin/env
cd ../build
- ../src/configure --disable-slirp {configure_opts};
+ ../src/configure {configure_opts};
make --output-sync -j{jobs} {target} {verbose};
"""
diff --git a/tests/vm/netbsd b/tests/vm/netbsd
index aa883ec..da6773f 100755
--- a/tests/vm/netbsd
+++ b/tests/vm/netbsd
@@ -54,6 +54,9 @@ class NetBSDVM(basevm.BaseVM):
# libs: migration
"zstd",
+
+ # libs: networking
+ "libslirp",
]
BUILD_SCRIPT = """