summaryrefslogtreecommitdiffstats
path: root/build-gluster-org/scripts/distributed-regression.sh
diff options
context:
space:
mode:
authorDeepshikha Khandelwal <dkhandel@redhat.com>2018-09-20 11:33:30 +0530
committerDeepshikha Khandelwal <dkhandel@redhat.com>2018-09-20 11:33:30 +0530
commitd6508f8bbaf397b132fc25e44bef625da1552595 (patch)
tree0f1cd85406ddc700f72bb42477168f86b9ad95c9 /build-gluster-org/scripts/distributed-regression.sh
parent2857318fe33d11b8c77a7b33d8eb1ad2cb92d8b8 (diff)
Add extra arguments when calling ansible playbook
Change-Id: I5fd0d5f283895aceeded09cecfa2d76d1797236a Signed-off-by: Deepshikha Khandelwal <dkhandel@redhat.com>
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