small refactoring
diff --git a/scripts/run_all_tests.sh b/scripts/run_all_tests.sh
index 68d9805..a300468 100644
--- a/scripts/run_all_tests.sh
+++ b/scripts/run_all_tests.sh
@@ -9,7 +9,7 @@
DEBS=`download_debs`
echo "Debs has been downloaded"
-bash run_test.sh 172.16.52.108 test37 172.16.55.2 disk_io_perf.pem
-bash run_test.sh 172.16.52.108 test37 172.16.55.2 disk_io_perf.pem
-bash run_test.sh 172.16.52.108 test37 172.16.55.2 disk_io_perf.pem
-bash run_test.sh 172.16.52.108 test37 172.16.55.2 disk_io_perf.pem
\ No newline at end of file
+bash run_test.sh 172.16.52.108 172.16.55.2 disk_io_perf.pem file_to_test.dat result.txt
+bash run_test.sh 172.16.52.108 172.16.55.2 disk_io_perf.pem file_to_test.dat result.txt
+bash run_test.sh 172.16.52.108 172.16.55.2 disk_io_perf.pem file_to_test.dat result.txt
+bash run_test.sh 172.16.52.108 172.16.55.2 disk_io_perf.pem file_to_test.dat result.txt
\ No newline at end of file
diff --git a/scripts/run_test.sh b/scripts/run_test.sh
index a4351ce..f5e2d27 100644
--- a/scripts/run_test.sh
+++ b/scripts/run_test.sh
@@ -1,18 +1,34 @@
function get_arguments() {
- export FUEL_MASTER_IP=${1:-172.16.52.108} # << FIXME
- export FUEL_MASTER_PASSWD=${2:-test37}
- export EXTERNAL_IP=${3:-172.16.55.2} # << FIXME .....
- export KEY_FILE_NAME=${4:-disk_io_perf.pem}
- export FILE_TO_TEST=$5 # << FIXME
- export RESULT_FILE=$6
- export TIMEOUT=${7:-360}
+ export FUEL_MASTER_IP=$1
- if [ $KEY_FILE_NAME does not exist ]; # << FIXME
+ if [ -z "${FUEL_MASTER_IP}" ]; then echo "Fuel master node ip is not provided"; fi
+
+ export EXTERNAL_IP=$2
+
+ if [ -z "${EXTERNAL_IP}" ]; then echo "Fuel external ip is not provided"; fi
+
+ export KEY_FILE_NAME=$3
+
+ if [ -z "${KEY_FILE_NAME}" ]; then echo "Key file name is not provided"; fi
+
+ export FILE_TO_TEST=$4
+
+ if [ -z "${KEY_FILE_NAME}" ]; then echo "Key file name is not provided"; fi
+
+ if [ ! -f $KEY_FILE_NAME ];
then
echo "File $KEY_FILE_NAME does not exist."
fi
+ export RESULT_FILE=$5
+
+ if [ -z "${RESULT_FILE}" ]; then echo "Result file name is not provided"; fi
+
+ export FUEL_MASTER_PASSWD=${6:-test37}
+ export TIMEOUT=${7:-360}
+
+
echo "Fuel master IP: $FUEL_MASTER_IP"
echo "Fuel master password: $FUEL_MASTER_PASSWD"
echo "External IP: $EXTERNAL_IP"
@@ -26,7 +42,7 @@
image_name="$IMAGE_NAME"
counter=0
- while [ ! "$image_state" eq "active" ] ; do
+ while [ ["$image_state" == "active"] ] ; do
sleep 1
image_state=$(glance image-list | grep "$image_name" | awk '{print $12}')
echo $image_state
@@ -89,9 +105,12 @@
exit
fi
fi
+
+ export VM_IP=$IP
+ echo "VM_IP: $VM_IP"
}
-function get_openrc() {
+function run_openrc() {
source run_vm.sh "$FUEL_MASTER_IP" "$FUEL_MASTER_PASSWD" "$EXTERNAL_IP"
source `get_openrc`
@@ -100,17 +119,13 @@
echo "openrc variables are unset or set to the empty string"
fi
- VM_IP=$IP
- echo "VM IP: $VM_IP"
echo 'AUTH_URL: "$OS_AUTH_URL"'
}
-# CHECK
-shift
get_arguments $@
echo "getting openrc from controller node"
-get_openrc
+run_openrc
echo "openrc has been activated on your machine"
get_floating_ip
diff --git a/scripts/run_vm.sh b/scripts/run_vm.sh
index dfd6fb3..894e30d 100644
--- a/scripts/run_vm.sh
+++ b/scripts/run_vm.sh
@@ -82,18 +82,21 @@
function prepare_node() {
# set -e
# set -o pipefail
-
+ echo "Preparing node"
COMPUTE_NODE=$($SSH_OVER_MASTER fuel node | grep compute | awk '-F|' '{gsub(" ", "", $5); print $5}')
- sshpass -p${FUEL_PASSWD} scp -r ../io_scenario root@${MASTER_IP}:/tmp
+ echo "Copying io_scenario to compute node"
+ sshpass -p${FUEL_MASTER_PASSWD} scp -r ../io_scenario root@${FUEL_MASTER_IP}:/tmp
$SSH_OVER_MASTER scp -r /tmp/io_scenario $COMPUTE_NODE:/tmp >/dev/null
- sshpass -p${FUEL_PASSWD} scp $DEBS root@${MASTER_IP}:/tmp
+ echo "Copying debs to compute node"
+ sshpass -p${FUEL_MASTER_PASSWD} scp $DEBS root@${FUEL_MASTER_IP}:/tmp
$SSH_OVER_MASTER scp $DEBS $COMPUTE_NODE:/tmp
$SSH_OVER_MASTER ssh $COMPUTE_NODE dpkg -i $DEBS
- sshpass -p${FUEL_PASSWD} scp single_node_test_short.sh root@${MASTER_IP}:/tmp
+ echo "Copying single_node_test.sh to compute node"
+ sshpass -p${FUEL_MASTER_PASSWD} scp single_node_test_short.sh root@${FUEL_MASTER_IP}:/tmp
$SSH_OVER_MASTER scp /tmp/single_node_test_short.sh $COMPUTE_NODE:/tmp
}