blob: 7ebd3e2ef5c4dbd64ef4d8e92adf8db42acf291d [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```
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030038export LAB_CONFIG_NAME=virtual-mcp-ocata-dvr # OVS-DVR with ocata packages
39export LAB_CONFIG_NAME=virtual-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
46Run deploy test
47---------------
48```
Dennis Dmitriev7080d8d2016-10-26 13:43:37 +030049export IMAGE_PATH1604=./xenial-server-cloudimg-amd64.qcow2
disc5298382016-11-23 16:03:33 +020050export SHUTDOWN_ENV_ON_TEARDOWN=false # Optional
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +030051export REPOSITORY_SUITE=testing
dis2b2d8632016-12-08 17:56:57 +020052
53LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_default
Dennis Dmitriev98449d92016-12-22 11:55:03 +020054```
Dennis Dmitriev98449d92016-12-22 11:55:03 +020055
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030056Run deploy test and rally verify (tempest)
57------------------------------------------
Dennis Dmitriev5e81a4b2017-04-27 03:32:01 +030058```
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030059export IMAGE_PATH1604=./xenial-server-cloudimg-amd64.qcow2
60export SHUTDOWN_ENV_ON_TEARDOWN=false # Optional
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +030061export REPOSITORY_SUITE=testing
Dennis Dmitriev5e81a4b2017-04-27 03:32:01 +030062
63LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_run_rally
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030064```
Dennis Dmitriev5e81a4b2017-04-27 03:32:01 +030065
Dennis Dmitrieveac3aab2017-07-12 16:36:41 +030066Run OSS deploy
67--------------
68```
69export IMAGE_PATH1604=./xenial-server-cloudimg-amd64.qcow2
70export SHUTDOWN_ENV_ON_TEARDOWN=false # Optional
71export REPOSITORY_SUITE=testing
72
73LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_oss_install_default
74```
75
Dennis Dmitrievb4b5c102017-05-10 17:09:06 +030076Run deploy test for mk22-qa-lab01 (outdated)
77--------------------------------------------
disc5298382016-11-23 16:03:33 +020078Note: This lab is not finished yet. TBD: configure vsrx node
79```
dis2b2d8632016-12-08 17:56:57 +020080export ENV_NAME=tcpcloud-mk22 # You can set any env name
disc5298382016-11-23 16:03:33 +020081export LAB_CONFIG_NAME=mk22-qa-lab01 # Name of set of templates
82export VSRX_PATH=./vSRX.img # /path/to/vSRX.img, or to ./xenial-server-cloudimg-amd64.qcow2 as a temporary workaround
83
84LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_default
85```
disf0924fb2016-12-03 04:01:12 +020086, or as an alternative there is another test that use deploy scripts from models repository written on bash [2]:
87```
88LC_ALL=en_US.UTF-8 py.test -vvv -s -k test_tcp_install_with_scripts
89```
90
91Labs with names mk22-lab-basic and mk22-lab-avdanced are deprecated and not recommended to use.
disc5298382016-11-23 16:03:33 +020092
Dennis Dmitrievb3fc4242017-07-14 16:01:51 +030093Use HugePages for environments based on qemu-kvm VMs
94----------------------------------------------------
95
96To create VMs using HugePages, configure the server (see below) and then use the following variable:
97
98```
99export DRIVER_USE_HUGEPAGES=true
100```
101
102Configure HugePages without reboot
103==================================
104This is a runtime-based steps. To make it persistent, you need to edit some configs.
105
1061. Remove apparmor
107```
108service apparmor stop
109service apparmor teardown
110update-rc.d -f apparmor remove
111apt-get remove apparmor
112```
113
1142. Allocate memory for Hugepages
115
1162Mb * 30000 = ~60Gb RAM will be used for HugePages.
117Suitable for CI servers with 64Gb RAM and no other heavy services except libvirt.
118
119WARNING! Too high value will hang your server, be carefull and try lower values first.
120```
Dennis Dmitrievea7ee492017-07-14 20:16:07 +0300121echo 28000 | sudo tee /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
Dennis Dmitrievb3fc4242017-07-14 16:01:51 +0300122apt-get install -y hugepages
123hugeadm --set-recommended-shmmax
124cat /proc/meminfo | grep HugePages
125```
126
1273. Mount hugetlbfs to use it with qemu-kvm
128```
129mkdir -p /mnt/hugepages2M
130mount -t hugetlbfs hugetlbfs /mnt/hugepages2M
131```
132
1334. Enable HugePages for libvirt
134```
135echo "hugetlbfs_mount = '/mnt/hugepages2M'" > /etc/libvirt/qemu.conf
136service libvirt-bin restart
137```
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300138
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300139Create and start the env for manual tests
140-----------------------------------------
Dmitrya21a79d2016-11-09 19:08:21 +0200141```
Dennis Dmitriev2c5693f2016-11-04 01:10:22 +0200142dos.py create-env ./tcp_tests/templates/underlay/mk22-lab-basic.yaml
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300143dos.py start "${ENV_NAME}"
Dmitrya21a79d2016-11-09 19:08:21 +0200144```
Dennis Dmitriev6f59add2016-10-18 13:45:27 +0300145
Dennis Dmitriev7080d8d2016-10-26 13:43:37 +0300146Then, 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 +0200147
148[1] https://github.com/openstack/fuel-devops/blob/master/doc/source/install.rst
149
150[2] https://github.com/Mirantis/mk-lab-salt-model/tree/dash/scripts