blob: fdf0ebbd65859a1dde14cd9f3f68e49ee5bf4b47 [file] [log] [blame] [view]
Dennis Dmitriev7d538c62016-10-18 13:51:17 +03001# tcp-qa
Dennis Dmitriev6f59add2016-10-18 13:45:27 +03002
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +03003Contribute
4----------
5
6Please send patches using gerrithub.io:
7
8```
9git remote add gerrit ssh://review.gerrithub.io:29418/Mirantis/tcp-qa
10git review
11```
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030012
13Clone the repo
14--------------
Dmitrya21a79d2016-11-09 19:08:21 +020015```
Dennis Dmitriev5bd9f562016-10-18 13:50:47 +030016git clone https://github.com/Mirantis/tcp-qa
Dennis Dmitriev5bd9f562016-10-18 13:50:47 +030017cd ./tcp-qa
Dmitrya21a79d2016-11-09 19:08:21 +020018```
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030019
20Install requirements
21--------------------
Dmitrya21a79d2016-11-09 19:08:21 +020022```
Dennis Dmitriev9cc4ca32016-11-03 13:50:45 +020023pip install -r ./tcp_tests/requirements.txt
Dmitrya21a79d2016-11-09 19:08:21 +020024```
Dennis Dmitrievf624fb02016-11-07 15:00:34 +020025* Note: Please read [1] if you don't have fuel-devops installed, because there are required some additional packages and configuration.
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030026
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030027Get cloudinit image
28-------------------
Dmitrya21a79d2016-11-09 19:08:21 +020029```
Dennis Dmitriev7080d8d2016-10-26 13:43:37 +030030wget https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img -O ./xenial-server-cloudimg-amd64.qcow2
Dmitrya21a79d2016-11-09 19:08:21 +020031```
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030032
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030033Choose the name of the cluster model
34------------------------------------
35LAB_CONFIG_NAME variable maps cluster name from the model repository with
36the set of templates in the ./tcp_tests/templates/ folder.
Dmitrya21a79d2016-11-09 19:08:21 +020037```
Vladimir Khlyunev25f1e742018-11-07 16:52:10 +040038export LAB_CONFIG_NAME=cookied-mcp-ocata-dvr # OVS-DVR with ocata packages
39export LAB_CONFIG_NAME=cookied-mcp-ocata-ovs # OVS-NO-DVR with ocata packages
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +030040export LAB_CONFIG_NAME=virtual-mcp-ocata-cicd # Operational Support System Tools
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030041export LAB_CONFIG_NAME=virtual-mcp11-dvr # OVS-DVR with neutron packages
42export LAB_CONFIG_NAME=virtual-mcp11-ovs # OVS-NO-DVR with neutron packages
43export LAB_CONFIG_NAME=virtual-mcp11-dpdk # OVS-DPDK with neutron packages
44```
45
Matthew Mosesohn9c94d4e2017-08-14 16:49:07 +030046Set packages repository
47-----------------------
48Note: The recommended repo is `testing`. Possible choices: stable, testing, nightly. Nightly contains latest packages.
49```
50export REPOSITORY_SUITE=testing
51```
52
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030053Run deploy test
54---------------
55```
Dennis Dmitriev7080d8d2016-10-26 13:43:37 +030056export IMAGE_PATH1604=./xenial-server-cloudimg-amd64.qcow2
disc5298382016-11-23 16:03:33 +020057export SHUTDOWN_ENV_ON_TEARDOWN=false # Optional
dis2b2d8632016-12-08 17:56:57 +020058
59LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_default
Dennis Dmitriev98449d92016-12-22 11:55:03 +020060```
Dennis Dmitriev98449d92016-12-22 11:55:03 +020061
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030062Run deploy test and rally verify (tempest)
63------------------------------------------
Dennis Dmitriev5e81a4b2017-04-27 03:32:01 +030064```
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030065export IMAGE_PATH1604=./xenial-server-cloudimg-amd64.qcow2
66export SHUTDOWN_ENV_ON_TEARDOWN=false # Optional
Dennis Dmitriev5e81a4b2017-04-27 03:32:01 +030067
68LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_run_rally
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030069```
Dennis Dmitriev5e81a4b2017-04-27 03:32:01 +030070
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +030071Run OSS deploy
72--------------
73```
74export IMAGE_PATH1604=./xenial-server-cloudimg-amd64.qcow2
75export SHUTDOWN_ENV_ON_TEARDOWN=false # Optional
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +030076
77LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_oss_install_default
78```
79
Matthew Mosesohn9c94d4e2017-08-14 16:49:07 +030080
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030081Run deploy test for mk22-qa-lab01 (outdated)
82--------------------------------------------
disc5298382016-11-23 16:03:33 +020083Note: This lab is not finished yet. TBD: configure vsrx node
84```
dis2b2d8632016-12-08 17:56:57 +020085export ENV_NAME=tcpcloud-mk22 # You can set any env name
disc5298382016-11-23 16:03:33 +020086export LAB_CONFIG_NAME=mk22-qa-lab01 # Name of set of templates
87export VSRX_PATH=./vSRX.img # /path/to/vSRX.img, or to ./xenial-server-cloudimg-amd64.qcow2 as a temporary workaround
88
89LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_default
90```
disf0924fb2016-12-03 04:01:12 +020091, or as an alternative there is another test that use deploy scripts from models repository written on bash [2]:
92```
93LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_with_scripts
94```
95
96Labs with names mk22-lab-basic and mk22-lab-avdanced are deprecated and not recommended to use.
disc5298382016-11-23 16:03:33 +020097
Dennis Dmitrievb3fc4242017-07-14 16:01:51 +030098Use HugePages for environments based on qemu-kvm VMs
99----------------------------------------------------
100
101To create VMs using HugePages, configure the server (see below) and then use the following variable:
102
103```
104export DRIVER_USE_HUGEPAGES=true
105```
106
107Configure HugePages without reboot
108==================================
109This is a runtime-based steps. To make it persistent, you need to edit some configs.
110
1111. Remove apparmor
112```
113service apparmor stop
114service apparmor teardown
115update-rc.d -f apparmor remove
116apt-get remove apparmor
117```
118
1192. Allocate memory for Hugepages
120
1212Mb * 30000 = ~60Gb RAM will be used for HugePages.
122Suitable for CI servers with 64Gb RAM and no other heavy services except libvirt.
123
124WARNING! Too high value will hang your server, be carefull and try lower values first.
125```
Dennis Dmitrievea7ee492017-07-14 20:16:07 +0300126echo 28000 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
Dennis Dmitrievb3fc4242017-07-14 16:01:51 +0300127apt-get install -y hugepages
128hugeadm --set-recommended-shmmax
129cat /proc/meminfo | grep HugePages
130```
131
1323. Mount hugetlbfs to use it with qemu-kvm
133```
134mkdir -p /mnt/hugepages2M
135mount -t hugetlbfs hugetlbfs /mnt/hugepages2M
136```
137
1384. Enable HugePages for libvirt
139```
140echo "hugetlbfs_mount = '/mnt/hugepages2M'" > /etc/libvirt/qemu.conf
141service libvirt-bin restart
142```
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300143
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300144Create and start the env for manual tests
145-----------------------------------------
Dmitrya21a79d2016-11-09 19:08:21 +0200146```
Dennis Dmitriev2c5693f2016-11-04 01:10:22 +0200147dos.py create-env ./tcp_tests/templates/underlay/mk22-lab-basic.yaml
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300148dos.py start "${ENV_NAME}"
Dmitrya21a79d2016-11-09 19:08:21 +0200149```
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300150
Dennis Dmitriev7080d8d2016-10-26 13:43:37 +0300151Then, wait until cloud-init is finished and port 22 is open (~3-4 minutes), and login with root:r00tme
Dennis Dmitrievf624fb02016-11-07 15:00:34 +0200152
153[1] https://github.com/openstack/fuel-devops/blob/master/doc/source/install.rst
154
155[2] https://github.com/Mirantis/mk-lab-salt-model/tree/dash/scripts