when one of the ovmf tests fails to parse at all,
we just get the 'die' message of the failing component, but not which
file actually failed to parse

to get better output, convert the parsing also to a test
and ok() and fail() respectively and then printing the error

Signed-off-by: Dominik Csapak <d.csa...@proxmox.com>
---
 test/run_ovf_tests.pl | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/test/run_ovf_tests.pl b/test/run_ovf_tests.pl
index b9e4825..74c53bc 100755
--- a/test/run_ovf_tests.pl
+++ b/test/run_ovf_tests.pl
@@ -12,8 +12,22 @@ use Data::Dumper;
 
 my $test_manifests = join ('/', $Bin, 'ovf_manifests');
 
-my $win2008 = 
PVE::QemuServer::OVF::parse_ovf("$test_manifests/Win_2008_R2_two-disks.ovf");
-my $win10 = PVE::QemuServer::OVF::parse_ovf("$test_manifests/Win10-Liz.ovf");
+print "parsing ovfs\n";
+
+my $win2008 = eval { 
PVE::QemuServer::OVF::parse_ovf("$test_manifests/Win_2008_R2_two-disks.ovf") };
+if (my $err = $@) {
+    fail('parse win2008');
+    warn("error: $err\n");
+} else {
+    ok('parse win2008');
+}
+my $win10 = eval { 
PVE::QemuServer::OVF::parse_ovf("$test_manifests/Win10-Liz.ovf") };
+if (my $err = $@) {
+    fail('parse win10');
+    warn("error: $err\n");
+} else {
+    ok('parse win10');
+}
 
 print "testing disks\n";
 
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to