From 0ce46ab50ec45c24cbf9e692dfef29bf00b0f55f Mon Sep 17 00:00:00 2001 From: Shameer Kolothum Date: Tue, 14 Jan 2020 16:51:38 +0000 Subject: tests: acpi: update path in rebuild-expected-aml Since commit 1e8a1fae7464("test: Move qtests to a separate directory") qtests are now placed in a separate folder and this breaks the script used to rebuild the expected ACPI tables for bios-tables-test. Update the script with correct path. Fixes: 1e8a1fae7464("test: Move qtests to a separate directory") Signed-off-by: Shameer Kolothum Reviewed-by: Thomas Huth Message-Id: <20200114165138.15716-1-shameerali.kolothum.thodi@huawei.com> Signed-off-by: Thomas Huth --- tests/data/acpi/rebuild-expected-aml.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/data/acpi/rebuild-expected-aml.sh b/tests/data/acpi/rebuild-expected-aml.sh index f89d4624bc..d44e511533 100755 --- a/tests/data/acpi/rebuild-expected-aml.sh +++ b/tests/data/acpi/rebuild-expected-aml.sh @@ -14,7 +14,7 @@ qemu_bins="x86_64-softmmu/qemu-system-x86_64 aarch64-softmmu/qemu-system-aarch64" -if [ ! -e "tests/bios-tables-test" ]; then +if [ ! -e "tests/qtest/bios-tables-test" ]; then echo "Test: bios-tables-test is required! Run make check before this script." echo "Run this script from the build directory." exit 1; @@ -26,11 +26,11 @@ for qemu in $qemu_bins; do echo "Also, run this script from the build directory." exit 1; fi - TEST_ACPI_REBUILD_AML=y QTEST_QEMU_BINARY=$qemu tests/bios-tables-test + TEST_ACPI_REBUILD_AML=y QTEST_QEMU_BINARY=$qemu tests/qtest/bios-tables-test done eval `grep SRC_PATH= config-host.mak` -echo '/* List of comma-separated changed AML files to ignore */' > ${SRC_PATH}/tests/bios-tables-test-allowed-diff.h +echo '/* List of comma-separated changed AML files to ignore */' > ${SRC_PATH}/tests/qtest/bios-tables-test-allowed-diff.h echo "The files were rebuilt and can be added to git." -- cgit v1.2.3 From 16c5c6928ff53bd95e6504301ef6c285501531e7 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Tue, 7 Jan 2020 17:34:37 +0100 Subject: migration-test: ppc64: fix FORTH test program Commit e51e711b1bef has moved the initialization of start_address and end_address after the definition of the command line argument, where the nvramrc is initialized, and thus the loop is between 0 and 0 rather than 1 MiB and 100 MiB. It doesn't affect the result of the test if all the tests are run in sequence because the two first tests don't run the loop, so the values are correctly initialized when we actually need them. But it hangs when we ask to run only one test, for instance: QTEST_QEMU_BINARY=ppc64-softmmu/qemu-system-ppc64 \ tests/migration-test -m=quick -p /ppc64/migration/validate_uuid_error Fixes: e51e711b1bef ("tests/migration: Add migration-test header file") Cc: wei@redhat.com Signed-off-by: Laurent Vivier Message-Id: <20200107163437.52139-1-lvivier@redhat.com> Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Acked-by: David Gibson Signed-off-by: Thomas Huth --- tests/qtest/migration-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 53afec4395..341d190922 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -480,14 +480,14 @@ static int test_migrate_start(QTestState **from, QTestState **to, } else if (strcmp(arch, "ppc64") == 0) { machine_opts = "vsmt=8"; memory_size = "256M"; + start_address = PPC_TEST_MEM_START; + end_address = PPC_TEST_MEM_END; arch_source = g_strdup_printf("-nodefaults " "-prom-env 'use-nvramrc?=true' -prom-env " "'nvramrc=hex .\" _\" begin %x %x " "do i c@ 1 + i c! 1000 +loop .\" B\" 0 " "until'", end_address, start_address); arch_target = g_strdup(""); - start_address = PPC_TEST_MEM_START; - end_address = PPC_TEST_MEM_END; } else if (strcmp(arch, "aarch64") == 0) { init_bootfile(bootpath, aarch64_kernel, sizeof(aarch64_kernel)); machine_opts = "virt,gic-version=max"; -- cgit v1.2.3 From 99fd3178a0d6f8edbf22b5e82b3e5134f93c4084 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 16 Jan 2020 15:07:36 +0100 Subject: tests/qtest/vhost-user-test: Fix memory leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not allocate resources in case we return early, and make sure to free dest_cmdline at the end. Reported-by: Euler Robot Reported-by: Pan Nengyuan Message-Id: <20200116140736.9498-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/qtest/vhost-user-test.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c index 2324b964ad..9ee0f1e4fd 100644 --- a/tests/qtest/vhost-user-test.c +++ b/tests/qtest/vhost-user-test.c @@ -707,9 +707,9 @@ static void test_read_guest_mem(void *obj, void *arg, QGuestAllocator *alloc) static void test_migrate(void *obj, void *arg, QGuestAllocator *alloc) { TestServer *s = arg; - TestServer *dest = test_server_new("dest"); - GString *dest_cmdline = g_string_new(qos_get_current_command_line()); - char *uri = g_strdup_printf("%s%s", "unix:", dest->mig_path); + TestServer *dest; + GString *dest_cmdline; + char *uri; QTestState *to; GSource *source; QDict *rsp; @@ -720,6 +720,10 @@ static void test_migrate(void *obj, void *arg, QGuestAllocator *alloc) return; } + dest = test_server_new("dest"); + dest_cmdline = g_string_new(qos_get_current_command_line()); + uri = g_strdup_printf("%s%s", "unix:", dest->mig_path); + size = get_log_size(s); g_assert_cmpint(size, ==, (256 * 1024 * 1024) / (VHOST_LOG_PAGE * 8)); @@ -778,6 +782,7 @@ static void test_migrate(void *obj, void *arg, QGuestAllocator *alloc) qtest_quit(to); test_server_free(dest); g_free(uri); + g_string_free(dest_cmdline, true); } static void wait_for_rings_started(TestServer *s, size_t count) -- cgit v1.2.3