[pve-devel] [PATCH qemu-server 05/12] test: restore config: use diff to make failure human-readable
Fiona Ebner
f.ebner at proxmox.com
Tue Mar 4 11:44:06 CET 2025
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
test/run_qemu_restore_config_tests.pl | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/test/run_qemu_restore_config_tests.pl b/test/run_qemu_restore_config_tests.pl
index 1e1e8072..231975c6 100755
--- a/test/run_qemu_restore_config_tests.pl
+++ b/test/run_qemu_restore_config_tests.pl
@@ -80,9 +80,14 @@ dir_glob_foreach('./restore-config-input', '[0-9]+.conf', sub {
);
}
- my $expected = file_get_contents("${EXPECTED_DIR}/${file}");
-
- is_deeply($got, $expected, $file);
+ my $cmd = ['diff', '-u', "${EXPECTED_DIR}/${file}", '-'];
+ eval { PVE::Tools::run_command($cmd, input => $got); };
+ if (my $err = $@) {
+ note($err);
+ fail($file);
+ } else {
+ pass($file);
+ }
});
done_testing();
--
2.39.5
More information about the pve-devel
mailing list