summaryrefslogtreecommitdiffstats
path: root/utils/infra_setup/heat_template/vstf_heat_template/ssh.sh
diff options
context:
space:
mode:
authorYiting.Li <liyiting@huawei.com>2016-01-09 09:50:27 +0800
committerYiting.Li <liyiting@huawei.com>2016-01-09 09:50:27 +0800
commitb8eeff7c6fdbfa5fe308e37a09853a6bc1f20d60 (patch)
treec2fa2ac0b66c633249e05492875fd6e153d5d55c /utils/infra_setup/heat_template/vstf_heat_template/ssh.sh
parent27a84e7905e66c005b02706ea3489576b5873c32 (diff)
JIRA: BOTTLENECKS-29
End to End test framework bottleneck vstf test suite ci script(currently progress is ok without vstf images) Change-Id: Ifdd1289b05d2916f6022c01c2581674e01bc022f Signed-off-by: Yiting.Li <liyiting@huawei.com>
Diffstat (limited to 'utils/infra_setup/heat_template/vstf_heat_template/ssh.sh')
-rw-r--r--utils/infra_setup/heat_template/vstf_heat_template/ssh.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/utils/infra_setup/heat_template/vstf_heat_template/ssh.sh b/utils/infra_setup/heat_template/vstf_heat_template/ssh.sh
new file mode 100644
index 00000000..35600065
--- /dev/null
+++ b/utils/infra_setup/heat_template/vstf_heat_template/ssh.sh
@@ -0,0 +1,28 @@
+function run_cmd()
+{
+ local ip=$1
+ local usr=$2
+ local passwd=$3
+ local cmd=$4
+ expect -c "
+ spawn ssh $usr@$ip
+ set timeout -1
+ expect {
+ \"*no)?\" {
+ send \"yes\r\"
+ exp_continue
+ }
+ \"*assword:*\" {
+ send \"$passwd\r\"
+ exp_continue
+ }
+ \"*#\" {
+ send \"$cmd\r\"
+ exec sleep 1
+ send \"exit\r\"
+ expect eof
+ }
+ }
+ "
+}
+