]> git.proxmox.com Git - ceph.git/blame - ceph/src/test/rgw/test_multi.md
import ceph quincy 17.2.6
[ceph.git] / ceph / src / test / rgw / test_multi.md
CommitLineData
11fdf7f2
TL
1# Multi Site Test Framework
2This framework allows you to write and run tests against a **local** multi-cluster environment. The framework is using the `mstart.sh` script in order to setup the environment according to a configuration file, and then uses the [nose](https://nose.readthedocs.io/en/latest/) test framework to actually run the tests.
3Tests are written in python2.7, but can invoke shell scripts, binaries etc.
4## Running Tests
5Entry point for all tests is `/path/to/ceph/src/test/rgw/test_multi.py`. And the actual tests are located inside the `/path/to/ceph/src/test/rgw/rgw_multi` subdirectory.
6So, to run all tests use:
7```
8$ cd /path/to/ceph/src/test/rgw/
9$ nosetests test_multi.py
10```
11This will assume a configuration file called `/path/to/ceph/src/test/rgw/test_multi.conf` exists.
12To use a different configuration file, set the `RGW_MULTI_TEST_CONF` environment variable to point to that file.
13Since we use the same entry point file for all tests, running specific tests is possible using the following format:
14```
15$ nosetests test_multi.py:<specific_test_name>
16```
eafe8130
TL
17To run miltiple tests based on wildcard string, use the following format:
18```
19$ nosetests test_multi.py -m "<wildcard string>"
20```
11fdf7f2
TL
21Note that the test to run, does not have to be inside the `test_multi.py` file.
22Note that different options for running specific and multiple tests exists in the [nose documentation](https://nose.readthedocs.io/en/latest/usage.html#options), as well as other options to control the execution of the tests.
23## Configuration
eafe8130
TL
24### Environment Variables
25Following RGW environment variables are taken into consideration when running the tests:
26 - `RGW_FRONTEND`: used to change frontend to 'civetweb' or 'beast' (default)
27 - `RGW_VALGRIND`: used to run the radosgw under valgrind. e.g. RGW_VALGRIND=yes
28Other environment variables used to configure elements other than RGW can also be used as they are used in vstart.sh. E.g. MON, OSD, MGR, MSD
11fdf7f2
TL
29The configuration file for the run has 3 sections:
30### Default
31This section holds the following parameters:
32 - `num_zonegroups`: number of zone groups (integer, default 1)
33 - `num_zones`: number of regular zones in each group (integer, default 3)
eafe8130 34 - `num_az_zones`: number of archive zones (integer, default 0, max value 1)
11fdf7f2
TL
35 - `gateways_per_zone`: number of RADOS gateways per zone (integer, default 2)
36 - `no_bootstrap`: whether to assume that the cluster is already up and does not need to be setup again. If set to "false", it will try to re-run the cluster, so, `mstop.sh` must be called beforehand. Should be set to false, anytime the configuration is changed. Otherwise, and assuming the cluster is already up, it should be set to "true" to save on execution time (boolean, default false)
37 - `log_level`: console log level of the logs in the tests, note that any program invoked from the test my emit logs regardless of that setting (integer, default 20)
38 - 20 and up -> DEBUG
39 - 10 and up -> INFO
40 - 5 and up -> WARNING
41 - 1 and up -> ERROR
42 - CRITICAL is always logged
43- `log_file`: log file name. If not set, only console logs exists (string, default None)
44- `file_log_level`: file log level of the logs in the tests. Similar to `log_level`
45- `tenant`: name of tenant (string, default None)
46- `checkpoint_retries`: *TODO* (integer, default 60)
47- `checkpoint_delay`: *TODO* (integer, default 5)
48- `reconfigure_delay`: *TODO* (integer, default 5)
49### Elasticsearch
50*TODO*
51### Cloud
52*TODO*
53## Writing Tests
54New tests should be added into the `/path/to/ceph/src/test/rgw/rgw_multi` subdirectory.
55- Base classes are in: `/path/to/ceph/src/test/rgw/rgw_multi/multisite.py`
56- `/path/to/ceph/src/test/rgw/rgw_multi/tests.py` holds the majority of the tests, but also many utility and infrastructure functions that could be used in other tests files