feat(docs): Hugo
[csit.git] / docs / content / introduction / testing_in_vagrant.md
1 ---
2 bookHidden: true
3 title: "Running CSIT locally in Vagrant"
4 ---
5
6 # Running CSIT locally in Vagrant
7
8 ## Install prerequisites
9
10 Run all commands from command line.
11
12 1. Download and install virtualbox from
13    [official page](https://www.virtualbox.org/wiki/Downloads).
14    To verify the installation, run VBoxManage
15
16    - on windows
17
18          "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" --version
19
20    - on nix
21
22          VBoxManage --version
23          Tested version: 6.1.16r140961
24
25 2. Download and install latest vagrant
26    [from official page](https://www.vagrantup.com/downloads.html).
27    To verify the installtion, run
28
29        vagrant -v
30        Tested version: Vagrant 2.2.15
31
32 3. Install vagrant plugins::
33
34        vagrant plugin install vagrant-vbguest
35        vagrant plugin install vagrant-cachier
36
37    If you are behind a proxy, install proxyconf plugin and update proxy
38    settings in Vagrantfile::
39
40        vagrant plugin install vagrant-proxyconf
41
42 ## Set up and run Vagrant virtualbox
43
44 Before running following commands change working directory to Vagrant specific directory
45 (from within root CSIT directory)
46
47     cd csit.infra.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 /home/vagrant/csit folder.
58
59 Once the process is finished, you can login to the box using
60
61     vagrant ssh
62
63 In case you need to completely rebuild the box and start from scratch,
64 run these commands
65
66     vagrant destroy -f
67     vagrant up --provider virtualbox
68
69 ## Run tests
70
71 From within the box run the tests using
72
73     cd /home/vagrant/csit/resources/libraries/bash/entry
74     ./bootstrap_vpp_device.sh csit-vpp-device-master-ubuntu2004-1n-vbox
75
76 To run only selected tests based on TAGS, export environment variables before
77 running the test suite
78
79     export GERRIT_EVENT_TYPE="comment-added"
80     export GERRIT_EVENT_COMMENT_TEXT="devicetest memif"
81
82     # now it will run tests, selected based on tags
83     ./bootstrap_vpp_device.sh csit-vpp-device-master-ubuntu2004-1n-vbox
84
85