summaryrefslogtreecommitdiffstats
path: root/build-gluster-org/scripts/distributed-regression.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build-gluster-org/scripts/distributed-regression.sh')
-rwxr-xr-xbuild-gluster-org/scripts/distributed-regression.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/build-gluster-org/scripts/distributed-regression.sh b/build-gluster-org/scripts/distributed-regression.sh
index 5ec80b3..dbe0f24 100755
--- a/build-gluster-org/scripts/distributed-regression.sh
+++ b/build-gluster-org/scripts/distributed-regression.sh
@@ -1,23 +1,26 @@
#!/bin/sh
-MAX_ATTEMPTS=3
+MAX_ATTEMPTS=2
# cleaning the previous logs
sudo rm -rf /tmp/failed-tests /tmp/*log /tmp/*patch.tar.gz >/dev/null 2>&1
# create and activate virtual env
-virtualenv env
+virtualenv --system-site-packages env
. 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 dependencies
-pip install pyrax ansible
+pip install -I pyrax ansible
#create the server machines
-ansible-playbook /opt/qa/distributed-tests/create-vm.yml -e COUNT=${MACHINES_COUNT} -e NAME=${JOB_NAME}-${BUILD_ID}
+ansible-playbook /opt/qa/distributed-tests/create-vm.yml -e COUNT=${MACHINES_COUNT} -e NAME=${JOB_NAME}-${BUILD_ID} -e PATH=${WORKSPACE}
for retry in $(seq 1 $MAX_ATTEMPTS)
do
- ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts /opt/qa/distributed-tests/setup.yml -u root --skip-tags 'copy_logs'
+ ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts /opt/qa/distributed-tests/setup.yml -u root --skip-tags 'copy_logs' -e PATH=${WORKSPACE}
ret=$?
if [ $ret -eq 0 ]; then
break
@@ -30,10 +33,10 @@ done
ret=$?
#copy the logs from machines before deleting
-ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts --private-key=key /opt/qa/distributed-tests/distributed-server.yml -u root --tags 'copy_logs'
+ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts /opt/qa/distributed-tests/setup.yml -u root --tags 'copy_logs'
#delete the server machines
-ansible-playbook -i hosts /opt/qa/distributed-tests/delete-vm.yml
+ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts /opt/qa/distributed-tests/delete-vm.yml
if [ $ret -ne 0 ]; then
# Create tar file from all the failed test log files generated in /tmp
tar -czf "$WORKSPACE"/failed-tests-logs.tgz /tmp/*.log /tmp/failed-tests