[Gluster-devel] Introducing a vagrant based Gluster test

Raghavendra Talur rtalur at redhat.com
Fri Jan 8 09:24:07 UTC 2016


Hi All,

Here is a very easy way for all to setup a Gluster Developement and Test
environment.
This currently works only on Fedora 22, Fedora 23.


What you get:
* A use and throw VM on your laptop on which you can perform all your
Gluster development(and run tests!)
* This introduces a mechanism using which a developer could easily test the
Gluster code in a VM environment.
* Also, it will help bring uniformity in the environments used by various
developers.

How to use:
1. git checkout -b custom-branch-name
2. Make changes
3. Execute ./run-tests-in-vagrant.sh

Now you will get prompt for installing vagrant, vagrant-libvirt and ansible
packages on your laptop.
The first you do this it will take long time because you would be
downloading VM image files etc.


What happens in the background:
1. A new directory is created:
    tests/vagrant/vagrant-custom-branch-name

   It will serve as the Vagrant dir which has the
   Vagrantfile and related ansible playbooks.

   The VM is started using Vagrant and provisioned
   using ansible.

2. The source dir is recursively copied over to the
   VM under /home/vagrant/glusterfs.

3. Gluster is source installed in VM.

What happens in the foreground:
1. run-tests.sh is executed in VM using ssh and output is displayed
   in the same terminal with option to use ctrl-c to interrupt the test
   midway. The VM would still persist and you could ssh into it.

Also, you can checkout a different branch elsewhere and execute
run-tests-in-vagrant.sh there to get another VM which would
execute tests on that code.

If you wish to make some changes in the code, you could:
a. Change the code in host and run the script again to repeat
   the whole process.

OR

b. cd tests/vagrant/<git-branch-name> && vagrant ssh
    Now you would placed in the VM and debug as you would on a normal
machine.


With a little effort though you could make it work on all systems running
linux.
Feedback welcome on the documentation.
Feedback and patches welcome on the code.

I will document all this is developer docs after consolidating your
questions and feedback.

Thanks,
Raghavendra Talur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20160108/aae57406/attachment.html>


More information about the Gluster-devel mailing list