Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 1 | # Copyright 2016 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | |
| 15 | import pytest |
| 16 | |
| 17 | from tcp_tests import logger |
| 18 | from tcp_tests import settings |
| 19 | |
| 20 | LOG = logger.logger |
| 21 | |
| 22 | |
| 23 | class Test3rdpartySuites(object): |
| 24 | """Test class for running 3rdparty test suites |
| 25 | |
| 26 | Requires environment variables: |
| 27 | ENV_NAME |
| 28 | LAB_CONFIG_NAME |
| 29 | TESTS_CONFIGS |
| 30 | """ |
| 31 | |
| 32 | @pytest.mark.grab_versions |
| 33 | @pytest.mark.parametrize("_", [settings.ENV_NAME]) |
| 34 | @pytest.mark.run_tempest |
Dennis Dmitriev | 427e415 | 2019-05-08 15:12:43 +0300 | [diff] [blame] | 35 | def test_run_tempest(self, tempest_actions, show_step, salt_actions, _): |
Tatyana Leontovich | f371844 | 2018-10-31 13:36:13 +0200 | [diff] [blame] | 36 | """Runner for Openstack tempest tests |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 37 | |
| 38 | Scenario: |
Dennis Dmitriev | 427e415 | 2019-05-08 15:12:43 +0300 | [diff] [blame] | 39 | 1. Sync time on the environment nodes |
| 40 | 2. Run tempest |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 41 | """ |
| 42 | show_step(1) |
Dennis Dmitriev | 427e415 | 2019-05-08 15:12:43 +0300 | [diff] [blame] | 43 | salt_actions.sync_time() |
| 44 | show_step(2) |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 45 | tempest_actions.prepare_and_run_tempest() |
| 46 | |
| 47 | @pytest.mark.grab_versions |
| 48 | @pytest.mark.parametrize("_", [settings.ENV_NAME]) |
Oleksii Zhurba | 1d547c1 | 2019-05-13 17:42:42 -0500 | [diff] [blame] | 49 | @pytest.mark.run_stacklight_old |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 50 | def test_run_stacklight(self, sl_actions, show_step, _): |
| 51 | """Runner for Stacklight tests |
| 52 | |
| 53 | Scenario: |
| 54 | 1. Run SL test |
| 55 | """ |
| 56 | |
| 57 | # Run SL component tetsts |
| 58 | show_step(1) |
| 59 | sl_actions.setup_sl_functional_tests( |
| 60 | 'cfg01', |
| 61 | ) |
| 62 | sl_actions.run_sl_functional_tests( |
| 63 | 'cfg01', |
| 64 | '/root/stacklight-pytest/stacklight_tests/', |
vitalygusev | f6dd274 | 2018-11-28 17:51:28 +0400 | [diff] [blame] | 65 | 'tests', |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 66 | 'test_alerts.py', |
| 67 | junit_report_name='stacklight_report.xml') |
| 68 | # Download report |
| 69 | sl_actions.download_sl_test_report( |
| 70 | 'cfg01', |
| 71 | '/root/stacklight-pytest/stacklight_tests/' |
| 72 | 'stacklight_report.xml') |
| 73 | |
| 74 | @pytest.mark.grab_versions |
Victor Ryzhenkin | 6f7ccb3 | 2018-12-26 18:41:27 +0400 | [diff] [blame] | 75 | @pytest.mark.prepare_log(filepath='/tmp/conformance/conformance.log') |
| 76 | @pytest.mark.merge_xunit(path='/tmp/conformance', |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 77 | output='/root/conformance_result.xml') |
Victor Ryzhenkin | 6f7ccb3 | 2018-12-26 18:41:27 +0400 | [diff] [blame] | 78 | @pytest.mark.download(name=['conformance.log', |
| 79 | 'conformance_result.xml']) |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 80 | @pytest.mark.parametrize("_", [settings.ENV_NAME]) |
| 81 | @pytest.mark.k8s_conformance |
| 82 | def test_run_k8s_conformance(self, show_step, config, k8s_actions, |
Victor Ryzhenkin | 6f7ccb3 | 2018-12-26 18:41:27 +0400 | [diff] [blame] | 83 | conformance_helper, _): |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 84 | """Test run of k8s conformance tests""" |
Victor Ryzhenkin | 6f7ccb3 | 2018-12-26 18:41:27 +0400 | [diff] [blame] | 85 | k8s_actions.start_conformance_inside_pod() |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 86 | |
| 87 | @pytest.mark.grab_versions |
Victor Ryzhenkin | 6f7ccb3 | 2018-12-26 18:41:27 +0400 | [diff] [blame] | 88 | @pytest.mark.prepare_log(filepath='/tmp/virtlet-conformance/' |
| 89 | 'virtlet_conformance.log') |
| 90 | @pytest.mark.merge_xunit(path='/tmp/virtlet-conformance', |
| 91 | output='/root/conformance_virtlet_result.xml') |
| 92 | @pytest.mark.download(name=['virtlet_conformance.log', |
| 93 | 'conformance_virtlet_result.xml']) |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 94 | @pytest.mark.parametrize("_", [settings.ENV_NAME]) |
| 95 | @pytest.mark.k8s_conformance_virtlet |
| 96 | def test_run_k8s_conformance_virtlet(self, show_step, config, k8s_actions, |
Victor Ryzhenkin | 6f7ccb3 | 2018-12-26 18:41:27 +0400 | [diff] [blame] | 97 | conformance_helper, _): |
Dennis Dmitriev | ee5ef23 | 2018-08-31 13:53:18 +0300 | [diff] [blame] | 98 | """Test run of k8s virtlet conformance tests""" |
Victor Ryzhenkin | 6f7ccb3 | 2018-12-26 18:41:27 +0400 | [diff] [blame] | 99 | k8s_actions.start_conformance_inside_pod(cnf_type='virtlet') |