]> git.proxmox.com Git - qemu-server.git/commitdiff
tests: cfg2cmd: get testname earlier
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 21 Aug 2020 08:38:08 +0000 (10:38 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 21 Aug 2020 08:38:08 +0000 (10:38 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
test/run_config2command_tests.pl

index b5c0a271d72251b116fd18a10e608a2f1cc2c55f..7a4c0eb2423eb637857aaf9bcc88dcccaf914500 100755 (executable)
@@ -122,6 +122,13 @@ sub parse_test($) {
            $current_test->{expect_error} = "$1";
        }
     }
+
+    $config_fn =~ /([^\/]+)$/;
+    my $testname = "$1";
+    if (my $desc = $current_test->{description}) {
+       $testname = "'$testname' - $desc";
+    }
+    $current_test->{testname} = $testname;
 }
 
 sub get_test_qemu_version {
@@ -306,11 +313,7 @@ sub do_test($) {
 
     parse_test $config_fn;
 
-    $config_fn =~ /([^\/]+)$/;
-    my $testname = "$1";
-    if (my $desc = $current_test->{description}) {
-       $testname = "'$testname' - $desc";
-    }
+    my $testname = $current_test->{testname};
 
     my ($vmid, $storecfg) = $base_env->@{qw(vmid storage_config)};