Report: Small fixes
[csit.git] / docs / testing_in_vagrant.rst
1 Running CSIT locally in Vagrant
2 -------------------------------
3
4 Install prerequisites
5 =====================
6
7 Run all commands from command line.
8
9 1. Download and install latest virtualbox from `official page
10    <https://www.virtualbox.org/wiki/Downloads>`_.
11    To verify the installation, run VBoxManage:
12
13    - on windows::
14
15       "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version
16
17    - on nix::
18
19       VBoxManage --version
20
21    You should see virtualbox manager version printed, eg: 6.1.12r139181
22
23 2. Download and install latest vagrant `from official page
24    <https://www.vagrantup.com/downloads.html>`_.
25    To verify the installtion, run::
26
27       vagrant -v
28
29    You should see vagrant version printed, eg: Vagrant 2.2.9
30
31 3. Install vagrant plugins::
32
33       vagrant plugin install vagrant-vbguest
34       vagrant plugin install vagrant-cachier
35
36    If you are behind a proxy, install proxyconf plugin and update proxy
37    settings in Vagrantfile::
38
39       vagrant plugin install vagrant-proxyconf
40
41 Set up and run Vagrant virtualbox
42 ======================================
43
44 Before running following commands change working directory to Vagrant specific directory
45 (from within root CSIT directory) ::
46
47     cd resources/libraries/tools/vagrant
48
49 This allows Vagrant to automatically find Vagrantfile and corresponding Vagrant environment.
50
51 Start the provisioning::
52
53    vagrant up --provider virtualbox
54
55 Your new VPP Device virtualbox machine will be created and configured.
56 Master branch of csit project will be cloned inside virtual machine into
57
58    /home/vagrant/csit folder.
59
60 Once the process is finished, you can login to the box using::
61
62    vagrant ssh
63
64 In case you need to completely rebuild the box and start from scratch,
65 run these commands::
66
67    vagrant destroy -f
68    vagrant up --provider virtualbox
69
70
71 Run tests
72 ==============================
73
74 From within the box run the tests using::
75
76    cd /home/vagrant/csit/resources/libraries/bash/entry
77    ./bootstrap_vpp_device.sh csit-vpp-device-master-ubuntu1804-1n-vbox
78
79 To run only selected tests based on TAGS, export environment variables before
80 running the test suite::
81
82    export GERRIT_EVENT_TYPE="comment-added"
83    export GERRIT_EVENT_COMMENT_TEXT="devicetest memif"
84
85    # now it will run tests, selected based on tags
86    ./bootstrap_vpp_device.sh csit-vpp-device-master-ubuntu1804-1n-vbox
87
88