summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2016-04-04 17:23:53 -0400
committerJeff Darcy <jdarcy@redhat.com>2016-04-06 07:31:58 -0700
commit21d8a461ae712539f5a0bf7e6889df29750c5256 (patch)
tree6fd1a33874e43ed94308e42c7b869fb958857c0f
parent34d1c81dc4c730eb0cd2b8fd756b8bffed655e9c (diff)
tests: improve vagrant usability
The first and most important change is to deal with the fact that "localhost" is an IPv6 address in the vagrant box we're using. This was non-obviously behind some of the NFS tests failing to run properly, so there's now an Ansible role etc. to make the necessary modifications in /etc/hosts. Also added "-j" to the make command, and changed the invocation of "run-tests.sh" so it passes through any arguments instead of running all tests every time. BUG: 1291537 Change-Id: I5e6125de043c41fdb2866875e999cb1fcd72ba52 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/13904 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com>
-rwxr-xr-xrun-tests-in-vagrant.sh4
-rw-r--r--tests/vagrant/vagrant-template/roles/fix-localhost/tasks/main.yml6
-rw-r--r--tests/vagrant/vagrant-template/setup.yml1
3 files changed, 9 insertions, 2 deletions
diff --git a/run-tests-in-vagrant.sh b/run-tests-in-vagrant.sh
index aedf1ca0a18..029439f68af 100755
--- a/run-tests-in-vagrant.sh
+++ b/run-tests-in-vagrant.sh
@@ -186,7 +186,7 @@ echo
echo
cd tests/vagrant/$BRANCHNAME
-vagrant ssh -c 'cd /home/vagrant/glusterfs; sudo make install' -- -t
+vagrant ssh -c 'cd /home/vagrant/glusterfs; sudo make -j install' -- -t
if [ $? -ne 0 ]
then
echo "make failed, exiting...."
@@ -198,7 +198,7 @@ echo
echo
cd tests/vagrant/$BRANCHNAME
-vagrant ssh -c 'cd /home/vagrant/glusterfs; sudo ./run-tests.sh' -- -t
+vagrant ssh -c "cd /home/vagrant/glusterfs; sudo ./run-tests.sh $*" -- -t
cd $ORIGIN_DIR
echo
echo
diff --git a/tests/vagrant/vagrant-template/roles/fix-localhost/tasks/main.yml b/tests/vagrant/vagrant-template/roles/fix-localhost/tasks/main.yml
new file mode 100644
index 00000000000..84dd252b65b
--- /dev/null
+++ b/tests/vagrant/vagrant-template/roles/fix-localhost/tasks/main.yml
@@ -0,0 +1,6 @@
+---
+- name: remove IPv6 address for localhost
+ shell: sed -i '/::1/s/localhost //' /etc/hosts
+
+- name: add IPv4 address for localhost
+ shell: sed -i '/127.0.0.1/s/$/ localhost/' /etc/hosts
diff --git a/tests/vagrant/vagrant-template/setup.yml b/tests/vagrant/vagrant-template/setup.yml
index 454c171300d..a9e798da3f4 100644
--- a/tests/vagrant/vagrant-template/setup.yml
+++ b/tests/vagrant/vagrant-template/setup.yml
@@ -12,5 +12,6 @@
- mock-user
- selinux
- iptables
+ - fix-localhost
- daemon-services