From 0deaa9d907732a3fbb1d61dfab5cc87e02770d06 Mon Sep 17 00:00:00 2001 From: frankiejol Date: Fri, 16 Aug 2019 17:15:40 +0200 Subject: [PATCH] fixed tests when there are no testing nodes --- t/kvm/n10_nodes.t | 2 +- t/nodes/60_hardware.t | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/t/kvm/n10_nodes.t b/t/kvm/n10_nodes.t index b8a9b5570..89d459d06 100644 --- a/t/kvm/n10_nodes.t +++ b/t/kvm/n10_nodes.t @@ -1146,7 +1146,7 @@ SKIP: { $vm = undef; } else { $node = remote_node($vm_name); - $node = test_node($vm_name, $node); + $node = test_node($vm_name, $node) if $node; $vm = undef if !$node; } diff --git a/t/nodes/60_hardware.t b/t/nodes/60_hardware.t index 10501896f..451457fd9 100644 --- a/t/nodes/60_hardware.t +++ b/t/nodes/60_hardware.t @@ -67,14 +67,18 @@ for my $vm_name ( 'Void', 'KVM') { $vm = undef; } - diag($msg) if !$vm; - skip($msg,10) if !$vm; - diag("Testing remote node in $vm_name"); my ($node1,$node2) = remote_node_2($vm_name); - ok($node2,"Expecting at least 2 nodes configured to test") or next; + if ( !$node2 ) { + $msg = "Expecting at least 2 nodes configured to test"; + $vm = undef; + } + diag($msg) if !$vm; + skip($msg,10) if !$vm; + + diag("Testing remote node in $vm_name"); clean_remote_node($node1); clean_remote_node($node2) if $node2;