Add vagrant setup for testing VPP device locally
[csit.git] / docs / testing_in_vagrant.rst
1 Running CSIT locally in Vagrant
2 -------------------------------
3
4 1. Download and install latest virtualbox from `official page <https://www.virtualbox.org/wiki/Downloads>`_
5    To verify the installation, run VBoxManage:
6       - on windows: "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version
7       - on nix: VBoxManage --version
8    You should see virtualbox manager version printed, eg: 6.0.0r127566
9
10 2. Download and install latest vagrant `from official page <https://www.vagrantup.com/downloads.html>`_
11    To verify the installtion, run:
12       vagrant -v
13    You should see vagrant version printed, eg: Vagrant 2.2.2
14
15 3. Install vagrant plugins
16    From command line run:
17       vagrant plugin install vagrant-vbguest
18       vagrant plugin install vagrant-cachier
19
20    If you are behind a proxy, install proxyconf plugin and update proxy
21    settings in Vagrantfile:
22       vagrant plugin install vagrant-proxyconf
23
24 4. Start the provisioning:
25       vagrant up --provider virtualbox
26
27 Your new VPP Device virtualbox machine will be created and configured.
28 Master branch of csit project will be cloned inside virtual machine into
29       /home/vagrant/csit folder.
30 Once the process is finished, you can login to the box using:
31       vagrant ssh
32
33 From within the box run the tests using:
34       cd /home/vagrant/csit/resources/libraries/bash/entry
35       ./bootstrap_vpp_device.sh csit-vpp-device-master-ubuntu1804-1n-vbox
36
37 In case you need to completely rebuild the box and start from scratch,
38 run these commands:
39       vagrant destroy -f
40       vagrant up --provider virtualbox
41
42 To run only selected tests based on TAGS, export environment variables before
43 running the test suite:
44       export GERRIT_EVENT_TYPE="comment-added"
45       export GERRIT_EVENT_COMMENT_TEXT="devicetest memif"
46       ./bootstrap_vpp_device.sh csit-vpp-device-master-ubuntu1804-1n-vbox