summaryrefslogtreecommitdiffstats
path: root/build-gluster-org/scripts/distributed-regression.sh
diff options
context:
space:
mode:
authordkhandel <dkhandel@localhost.localdomain>2018-06-06 17:03:31 +0530
committerdkhandel <dkhandel@localhost.localdomain>2018-06-07 10:15:56 +0530
commit51d0e36ae7c283dc8abae617f2d65dea7e7e2c2a (patch)
treec201b9af81c290071f2c2158a9896288f9adc08a /build-gluster-org/scripts/distributed-regression.sh
parent7140ada137b9ff29d08c7c13c5badeb55ce2729a (diff)
Remove the conditional-step builder and change file names:
- Rename distributed-node-create.sh -> distributed-regression.sh - Rename distributed-regression.py -> run-distributed.test.py Change-Id: I332b1f905a1ba811e09c70e342853f61b5bd1165
Diffstat (limited to 'build-gluster-org/scripts/distributed-regression.sh')
-rw-r--r--build-gluster-org/scripts/distributed-regression.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/build-gluster-org/scripts/distributed-regression.sh b/build-gluster-org/scripts/distributed-regression.sh
new file mode 100644
index 0000000..12f3396
--- /dev/null
+++ b/build-gluster-org/scripts/distributed-regression.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+MAX_ATTEMPTS=3
+set -e
+
+# create and activate virtual env
+virtualenv env
+source env/bin/activate
+
+# create SSH key pair of 4096 bits to use it for instances at Rackspace
+ssh-keygen -f ${WORKSPACE}/key -t rsa -b 4096
+
+# Install pyrax dependency
+pip install pyrax
+/opt/qa/distributed-tests/rackspace-server-manager.py create -n ${MACHINES_COUNT}
+
+for retry in `seq 1 $MAX_ATTEMPTS`
+do
+ ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts --private-key=key /opt/qa/distributed-tests/distributed-server.yml -u root
+ ret=$?
+ if [ $ret -eq 0 ]; then
+ break
+ fi
+ echo 'Attempting to run again...'
+done
+
+# run the script of distributed-test
+../scripts/run-distributed-test.py
+ret=$?
+if [ $ret -eq 0 ]; then
+ # Create tar file from all the failed test log files generated in /tmp
+ tar -czf $WORKSPACE/failed-test-logs.tgz /tmp/*.log
+
+ # if test runs are successful, delete all the machines
+ /opt/qa/distributed-tests/rackspace-server-manager.py delete
+fi