From 96159c933ddfe9923721323e22ee68f6469c1697 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 31 Mar 2015 14:55:20 +0000 Subject: [PATCH] Use ssh -v when ssh'ing to guests to check they are up * Make tcmd take an optional $extrasshopts argument * Make target_cmd{,_root} pass this through * Supply this with value [qw(-v)] Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 1053016..eca68be 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -595,14 +595,14 @@ sub target_await_down ($$) { } sub tcmd { # $tcmd will be put between '' but not escaped - my ($stdout,$user,$ho,$tcmd,$timeout) = @_; + my ($stdout,$user,$ho,$tcmd,$timeout,$extrasshopts) = @_; $timeout=30 if !defined $timeout; tcmdex($timeout,$stdout, - 'ssh', sshopts(), + 'ssh', sshopts(), @{ $extrasshopts || [] }, sshuho($user,$ho), $tcmd); } -sub target_cmd ($$;$) { tcmd(undef,'osstest',@_); } -sub target_cmd_root ($$;$) { tcmd(undef,'root',@_); } +sub target_cmd ($$;$$) { tcmd(undef,'osstest',@_); } +sub target_cmd_root ($$;$$) { tcmd(undef,'root',@_); } sub tcmdout { my $stdout= IO::File::new_tmpfile(); @@ -1653,7 +1653,7 @@ sub guest_check_via_ssh ($) { sub guest_check_up_quick ($) { my ($gho) = @_; if (guest_check_via_ssh($gho)) { - target_cmd_root($gho, "date"); + target_cmd_root($gho, "date", undef, [qw(-v)]); } else { target_ping_check_up($gho); } @@ -1663,7 +1663,7 @@ sub guest_check_up ($) { my ($gho) = @_; guest_await_dhcp_tcp($gho,20); target_ping_check_up($gho); - target_cmd_root($gho, "echo guest $gho->{Name}: ok") + target_cmd_root($gho, "echo guest $gho->{Name}: ok", undef, [qw(-v)]) if guest_check_via_ssh($gho); } -- 2.39.5