qemuimage-testlib: silence some key warnings
Set StrictHostKeyChecking to no to silence the fingerprint warnings, and instead of creating a temporary file for the known hosts and then deleting it just use /dev/null. (From OE-Core rev: 24e4a570eb527cff017386976296d5747c1adf57) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
3328d7c3f7
commit
4b5001de2f
|
@ -84,13 +84,12 @@ Test_SCP()
|
||||||
local ip_addr=$1
|
local ip_addr=$1
|
||||||
local src=$2
|
local src=$2
|
||||||
local des=$3
|
local des=$3
|
||||||
local tmpfile=`mktemp`
|
|
||||||
local time_out=60
|
local time_out=60
|
||||||
local ret=0
|
local ret=0
|
||||||
|
|
||||||
# We use expect to interactive with target by ssh
|
# We use expect to interactive with target by ssh
|
||||||
local exp_cmd=`cat << EOF
|
local exp_cmd=`cat << EOF
|
||||||
eval spawn scp -o UserKnownHostsFile=$tmpfile "$src" root@$ip_addr:"$des"
|
eval spawn scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$src" root@$ip_addr:"$des"
|
||||||
set timeout $time_out
|
set timeout $time_out
|
||||||
expect {
|
expect {
|
||||||
"*assword:" { send "\r"; exp_continue}
|
"*assword:" { send "\r"; exp_continue}
|
||||||
|
@ -107,7 +106,6 @@ EOF`
|
||||||
|
|
||||||
expect -c "$exp_cmd"
|
expect -c "$exp_cmd"
|
||||||
ret=$?
|
ret=$?
|
||||||
rm -rf $tmpfile
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,11 +115,10 @@ Test_SSH()
|
||||||
local ip_addr=$1
|
local ip_addr=$1
|
||||||
shift
|
shift
|
||||||
local command=$@
|
local command=$@
|
||||||
local tmpfile=`mktemp`
|
|
||||||
local time_out=60
|
local time_out=60
|
||||||
local ret=0
|
local ret=0
|
||||||
local exp_cmd=`cat << EOF
|
local exp_cmd=`cat << EOF
|
||||||
eval spawn ssh -o UserKnownHostsFile=$tmpfile root@$ip_addr "$command"
|
eval spawn ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@$ip_addr "$command"
|
||||||
set timeout $time_out
|
set timeout $time_out
|
||||||
expect {
|
expect {
|
||||||
"*assword:" { send "\r"; exp_continue}
|
"*assword:" { send "\r"; exp_continue}
|
||||||
|
@ -138,7 +135,6 @@ EOF`
|
||||||
|
|
||||||
expect -c "$exp_cmd"
|
expect -c "$exp_cmd"
|
||||||
ret=$?
|
ret=$?
|
||||||
rm -rf $tmpfile
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue