From 21950ff5eb032fefc4753bd68af57f655d0c61f2 Mon Sep 17 00:00:00 2001 From: Stefan Stanacar Date: Wed, 15 May 2013 10:42:18 +0000 Subject: qemuimage-testlib: pass optional timeout to ssh function Sometimes we need to change the timeout used by the function for certain kinds of tests. Signed-off-by: Stefan Stanacar Signed-off-by: Richard Purdie --- scripts/qemuimage-testlib | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib index 1fa9b4edbd..475231bbc4 100755 --- a/scripts/qemuimage-testlib +++ b/scripts/qemuimage-testlib @@ -144,10 +144,15 @@ EOF` # function to run command in $ip_addr via ssh Test_SSH() { - local ip_addr=$1 - shift - local command=$@ - local time_out=60 + local ip_addr="$1" + local command="$2" + + if [ $# -eq 3 ]; then + local time_out=$3 + else + local time_out=60 + fi + local ret=0 local exp_cmd=`cat << EOF eval spawn ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@$ip_addr "$command" -- cgit 1.2.3-korg