automatic test running and sending to webapp
diff --git a/scripts/run_all_tests.sh b/scripts/run_all_tests.sh
index 4bb9d26..68d9805 100644
--- a/scripts/run_all_tests.sh
+++ b/scripts/run_all_tests.sh
@@ -1,3 +1,14 @@
+SSH_PASS=$(sshpass)
+export SSH_OPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
+
+if [ -z SSH_PASS ]; then
+ sudo apt-get install sshpass
+ echo 'All dependencies has been installed'
+fi
+
+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
diff --git a/scripts/run_test.sh b/scripts/run_test.sh
index 483f583..94612ba 100644
--- a/scripts/run_test.sh
+++ b/scripts/run_test.sh
@@ -3,6 +3,7 @@
EXTERNAL_IP=$3
KEY_FILE_NAME=$4
+
if [ ! -z $5 ]
then
FILE_TO_TEST=$5
@@ -36,7 +37,7 @@
image_name=$IMAGE_NAME
counter=0
- while [ $image_state != "active" ] ; do
+ while [ ! $image_state eq "active" ] ; do
sleep 1
image_state=$(glance image-list | grep $image_name | awk '{print $12}')
echo $image_state
@@ -88,7 +89,7 @@
done
}
-source run_vm.sh $FUEL_MASTER_IP $FUEL_MASTER_PASSWD $EXTERNAL_IP
+bash run_vm.sh $FUEL_MASTER_IP $FUEL_MASTER_PASSWD $EXTERNAL_IP
source `get_openrc`
list=$(nova list)
if [ "$list" == "" ]; then
@@ -118,10 +119,15 @@
echo "Floating IP has been obtained"
source `prepare_vm`
echo "VM has been prepared"
-ssh -i $KEY_FILE_NAME ubuntu@$VM_IP \
- "cd /tmp/io_scenario; sudo bash ../single_node_test_short.sh $FILE_TO_TEST $FILE_TO_STORE_RESULTS"
-nova delete $VM_NAME
-wait_vm_deleted
-echo "$VM_NAME has been deleted successfully"
-cinder delete $VOL_ID
-echo "Volume has been deleted $VOL_ID"
+
+# sudo bash ../single_node_test_short.sh $FILE_TO_TEST $FILE_TO_STORE_RESULTS
+
+ssh $SSH_OPTS -i $KEY_FILE_NAME ubuntu@$VM_IP \
+ "cd /tmp/io_scenario; echo 'results' > $FILE_TO_STORE_RESULTS; \
+ curl -X POST -d @$FILE_TO_STORE_RESULTS http://http://172.16.52.80/api/test --header 'Content-Type:application/json'"
+
+# nova delete $VM_NAME
+# wait_vm_deleted
+# echo "$VM_NAME has been deleted successfully"
+# cinder delete $VOL_ID
+# echo "Volume has been deleted $VOL_ID"
diff --git a/scripts/run_vm.sh b/scripts/run_vm.sh
index 94a39ea..2f0f888 100644
--- a/scripts/run_vm.sh
+++ b/scripts/run_vm.sh
@@ -2,10 +2,10 @@
MASTER_IP=$1
FUEL_PASSWD=$2
NEW_IP=$3
-VM_NAME=disk-io-test
+VM_NAME=disk-io-test2
# VM_IP=$(nova floating-ip-create "$FLOATIN_NET" | grep "$FLOATIN_NET" | awk '{print $2}')
-VM_IP=172.16.55.14
+VM_IP=172.16.55.23
OS_ORIGIN_IP=10.20.0.129
OS_EXT_IP=172.16.53.66
@@ -72,7 +72,7 @@
echo "Copy DEBS packages"
scp -i "$KEY_FILE_NAME" single_node_test_short.sh ubuntu@${VM_IP}:/tmp >/dev/null
echo "Copy single_node_test_short"
- ssh -i "$KEY_FILE_NAME" ubuntu@${VM_IP} sudo dpkg -i $DEBS >/dev/null
+ ssh $SSH_OPTS -i "$KEY_FILE_NAME" ubuntu@${VM_IP} sudo dpkg -i $DEBS >/dev/null
echo "dpkg on vm"
}