|
1 | | -These are the functional tests for stf client-side. They check that OpenStack is running. |
| 1 | +Feature-verification-tests are made up of two parts: tests and callback plugins. |
2 | 2 |
|
3 | | -The deployment templates are in infrared, and have the following names: |
| 3 | +The callback plugins output the test results in different ways. |
| 4 | +The custom_logger plugin takes a test-id from the task names and reports the results of the tests in a file, where each line contains a test ID and a result (pass/fail). |
| 5 | +The custom_junit plugin extends the standard ansible junit plugin and report in XML format that Polarion expects. |
4 | 6 |
|
5 | | -* ``stf-connectors-osp13`` |
6 | | -* ``stf-connectors-osp16-edge`` |
7 | | -* ``enable-stf`` |
8 | 7 |
|
9 | | -The tags for the ansible playbook correspond to these templates and run the appropriate tests for each deployment. |
| 8 | +The tests are STF and for telemetry services in RHOSO. |
10 | 9 |
|
11 | | -The current set of functional tests are: |
| 10 | +STF tests |
| 11 | +These are the functional tests for stf. They check that OpenStack components are running and connected to STF and that the system works end-to-end. |
| 12 | +They are based on an infrared depoyment. |
12 | 13 |
|
13 | | -* Check collectd is running |
14 | | - This checks that the collectd container has been deployed and is generating ANY metrics |
15 | | - The test currently runs when the ``collectd-*`` tags are passed. |
| 14 | +RHOSO telemetry tests |
| 15 | +These tests cover telemetry features in RHOSO-18. These tests check that the telemetry-operator has deployed and configured the required services as expected. |
16 | 16 |
|
17 | | -* Check QDR is running |
18 | | - This checks that the ``metrics_qdr`` container has been deployed and is receiving ANY metrics |
19 | | - This test runs when the ``*-write-qdr-*`` tags are passed. |
20 | 17 |
|
21 | | - |
22 | | -Running tests locally |
23 | | ---------------------- |
24 | | - |
25 | | -If you have deployed client-side STF and want to test it locally, you can run the following command:: |
26 | | - |
27 | | - ansible-playbook -i `infrared workspace inventory` stf_functional_tests.yml |
28 | | - |
29 | | -OR:: |
30 | | - |
31 | | - ansible-playbook -i `infrared workspace inventory` stf_functional_tests.yml --tags "<one of the tags from above>" |
32 | | - |
33 | | -To get a summarised output of the tests at the end, use the provided logging callback:: |
34 | | - |
35 | | - ANSIBLE_CALLBACK_WHITELIST=custom_logger ansible-playbook -i `infrared workspace inventory` stf_functional_tests.yml |
36 | | - |
37 | | -The logging callback will summarise the tests run on each node and whether they passed or failed. |
38 | | -The callback will only report on the status of tasks that have a name beginning with ``[Test]``. |
39 | | - |
40 | | -.. note:: |
41 | | - If you haven't deployed using infrared, you can still run the tests if you create your own inventory file, containing one group of hosts called ``overcloud_nodes``. |
42 | | - Alternatively, you can create your own playbook that imports the tasks in ``tasks/*.yml`` |
43 | | - |
44 | | -Adding new tests |
45 | | ----------------- |
46 | | - |
47 | | -Adding a new test for existing deployment templates requires no changes in |
48 | | -Jenkins. |
49 | | -Adding tests for new deployment templates requires that the template is in |
50 | | -Infrared and deployed in Jenkins. |
51 | | - |
52 | | -The changes required in this repo for tests is to add additional tasks under |
53 | | -``tasks/test_<your_test_name>.yml``:: |
54 | | - |
55 | | - - name: "[Test] My test name" |
56 | | - shell: | |
57 | | - my_test_command |
58 | | - register: command_output |
59 | | - failed_when: command_output.stdout == some_value |
60 | | - |
61 | | -Most of the functional tests are a series of shell commands that one would run |
62 | | -when verifying that particular features were deployed correctly, and can be |
63 | | -adapted from any manual testing that is done. |
64 | | - |
65 | | - |
66 | | -The task can then be imported in ``stf_functional_tests.yml`` like so:: |
67 | | - |
68 | | - - name: Collectd checks |
69 | | - hosts: overcloud_nodes |
70 | | - become: true |
71 | | - roles: |
72 | | - - "{{ playbook_dir }}" |
73 | | - tags: |
74 | | - - enable-stf |
75 | | - - stf-connectors-osp13 |
76 | | - - some-other-template-name |
77 | | - tasks: |
78 | | - - import_tasks: tasks/test_<your_test_name> |
79 | | - |
80 | | - |
81 | | - |
82 | | -Configuration |
83 | | -------------- |
84 | | -The following vars can be passed to change the behaviour. |
85 | | - |
86 | | -* **collectd_container_name** |
87 | | - |
88 | | - The name of the container where collectd is running, e.g. ``collectd-test`` |
89 | | - |
90 | | - default: ``collectd`` |
91 | | - |
92 | | -* **qdr_container_name** |
93 | | - |
94 | | - The name of the container where qdr is running, e.g. ``metrics_qdr``, ``qdr-test`` |
95 | | - |
96 | | - default: ``metrics_qdr` |
97 | | -
|
98 | | -
|
99 | | -
|
100 | | -
|
101 | | -Running e2e tests against existing STF |
102 | | --------------------------------------- |
103 | | -
|
104 | | -E2E tests are currently running against predeployed STF that installed on top of OpenShift deployed in QuickLab insfrastracture. |
105 | | -There is an inventory file called stf.inf that should be included in the ansible-playbook command along side with the Infrared inventory file. |
106 | | -
|
107 | | - ANSIBLE_CALLBACK_WHITELIST=custom_logger ansible-playbook -i `ir workspace inventory` -i stf.inv playbooks/stf_functional_tests.yml --tags <TAGS> |
0 commit comments