[pve-devel] [PATCH storage 2/2] tests: zfs: complain when a first sub-test dies

Fabian Ebner f.ebner at proxmox.com
Fri Mar 12 10:50:27 CET 2021


Previously, $count was not increased and no test failure was reported.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Found by messing up in the previous patch at first with:
    my $res = map { $_ => [] } keys %{$ids};
instead of
    my $res = { map { $_ => [] } keys %{$ids} };
and wondering why it failed in "production", but the test ran through.

 test/run_test_zfspoolplugin.pl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/run_test_zfspoolplugin.pl b/test/run_test_zfspoolplugin.pl
index 9c5e841..2f63f1b 100755
--- a/test/run_test_zfspoolplugin.pl
+++ b/test/run_test_zfspoolplugin.pl
@@ -2714,7 +2714,10 @@ for (my $i = $start_test; $i <= $end_test; $i++) {
     eval {
 	$tests->{$i}();
     };
-    warn $@ if $@;
+    if (my $err = $@) {
+	warn $err;
+	$count++;
+    }
     cleanup_zfs();
 }
 
-- 
2.20.1






More information about the pve-devel mailing list