diff options
author | Rahul C S <rahulcs@redhat.com> | 2012-02-17 17:23:28 +0530 |
---|---|---|
committer | Rahul C S <rahulcs@redhat.com> | 2012-02-17 17:24:19 +0530 |
commit | db468693ef5faa294d9bc3cd3c5d70c0d99d488b (patch) | |
tree | f552d0a8e88304dba5038eac670a5c7afe3c267e /perf-framework/automate_pwl_ssh | |
parent | 01a77a1ae18d9add01f893e06e58191b065602e8 (diff) |
Adding the performance framework to the qa repo
Change-Id: Ia7dbd82e9bb2e5e65e9345234ce34f8518a091ad
Signed-off-by: Rahul C S <rahulcs@redhat.com>
Diffstat (limited to 'perf-framework/automate_pwl_ssh')
-rwxr-xr-x | perf-framework/automate_pwl_ssh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/perf-framework/automate_pwl_ssh b/perf-framework/automate_pwl_ssh new file mode 100755 index 0000000..78e4c47 --- /dev/null +++ b/perf-framework/automate_pwl_ssh @@ -0,0 +1,43 @@ +#!/bin/bash -u + +expect_log=./expectlog + +if [ ! -f /root/.ssh/id_rsa.pub ] +then + ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa +fi + +if [ ! -f /usr/bin/expect ] +then + echo "expect not found. Attempting to install..." + if grep -i centos /etc/issue > /dev/null 2>&1 + then + echo "CentOS. Using yum" + yum install -y `yum whatprovides expect | grep -o "expect.*x86_64"` > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "Failed installing expect. Exiting..." + exit 1 + fi + elif grep -i ubuntu /etc/issue > /dev/null 2>&1 + then + echo "Ubuntu. Using apt-get" + apt-get install -y expect > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "Failed installing expect. Exiting..." + exit 1 + fi + else + echo "Unknown distribution" + echo "Install expect and try again." + exit 1 + fi +fi + +echo "Attempting passwordless ssh setup on multiple hosts." +echo "log can be found in $expect_log" + +export ROOT_PW1 +export ROOT_PW2 +./pwl_ssh $expect_log $SSH_HOSTS |