]> git.proxmox.com Git - qemu-server.git/commitdiff
tests: avoid calling test script to get target names
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 May 2023 11:12:55 +0000 (13:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 May 2023 13:06:46 +0000 (15:06 +0200)
As otherwise we couple *all* Makefile targets to the dependencies of
the test script, even for a simple make call (e.g., done on building
the source), so use a much simpler heuristic that just depends on
perl, which is essential in Debian.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
test/Makefile
test/run_qemu_migrate_tests.pl

index 7a8487c5bd4ca36c29c91fb18493e93692f41d10..97340edfe3ea106ae01873608183770a8f6b0f58 100644 (file)
@@ -1,6 +1,3 @@
-MIGRATION_TEST_NAMES := $(shell ./run_qemu_migrate_tests.pl DUMP_NAMES)
-MIGRATION_TEST_TARGETS := $(addprefix test_migration_,$(MIGRATION_TEST_NAMES))
-
 all: test
 
 test: test_snapshot test_ovf test_cfg_to_cmd test_pci_addr_conflicts test_qemu_img_convert test_migration test_restore_config
@@ -21,6 +18,8 @@ test_qemu_img_convert: run_qemu_img_convert_tests.pl
 test_pci_addr_conflicts: run_pci_addr_checks.pl
        ./run_pci_addr_checks.pl
 
+MIGRATION_TEST_TARGETS := $(addprefix test_migration_,$(shell perl -ne 'print "$1 " if /^\s*name\s*=>\s*["'\'']([^\s"'\'']+)["'\'']\s*,\s*$/; END { print "\n" }' run_qemu_migrate_tests.pl))
+
 test_migration: run_qemu_migrate_tests.pl MigrationTest/*.pm $(MIGRATION_TEST_TARGETS)
 
 $(MIGRATION_TEST_TARGETS):
index bbba5f9772d6e6172116e08ff084f5f87af736b9..090449f3f56f51d08f7e6bd76e426d6c652635ff 100755 (executable)
@@ -418,8 +418,9 @@ sub local_volids_for_vm {
 
 my $tests = [
 # each test consists of the following:
-# name           - unique name for the test which also serves as a dir name and
-#                  gets passed to make, so don't use whitespace or slash
+# name           - unique name for the test which also serves as a dir name.
+#                  NOTE: gets passed to make, so don't use whitespace or slash
+#                        and adapt buildsys (regex) on code structure changes
 # target         - hostname of target node
 # vmid           - ID of the VM to migrate
 # opts           - options for the migrate() call
@@ -1531,12 +1532,6 @@ my $tests = [
 
 my $single_test_name = shift;
 
-if (defined($single_test_name) && $single_test_name eq 'DUMP_NAMES') {
-    my $output = join(' ', map { $_->{name} } $tests->@*);
-    print "$output\n";
-    exit 0;
-}
-
 mkdir $RUN_DIR_PATH;
 
 foreach my $test (@{$tests}) {