blob: 8ca8c067ca504f113014d2238d22a3900b949540 [file] [log] [blame]
Dennis Dmitrievee5ef232018-08-31 13:53:18 +03001# 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
15import pytest
16
17from tcp_tests import logger
18from tcp_tests import settings
19
20LOG = logger.logger
21
22
23class 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 Dmitriev427e4152019-05-08 15:12:43 +030035 def test_run_tempest(self, tempest_actions, show_step, salt_actions, _):
Tatyana Leontovichf3718442018-10-31 13:36:13 +020036 """Runner for Openstack tempest tests
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030037
38 Scenario:
Dennis Dmitriev427e4152019-05-08 15:12:43 +030039 1. Sync time on the environment nodes
40 2. Run tempest
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030041 """
42 show_step(1)
Dennis Dmitriev427e4152019-05-08 15:12:43 +030043 salt_actions.sync_time()
44 show_step(2)
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030045 tempest_actions.prepare_and_run_tempest()
46
47 @pytest.mark.grab_versions
48 @pytest.mark.parametrize("_", [settings.ENV_NAME])
Oleksii Zhurba1d547c12019-05-13 17:42:42 -050049 @pytest.mark.run_stacklight_old
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030050 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/',
vitalygusevf6dd2742018-11-28 17:51:28 +040065 'tests',
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030066 '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 Ryzhenkin6f7ccb32018-12-26 18:41:27 +040075 @pytest.mark.prepare_log(filepath='/tmp/conformance/conformance.log')
76 @pytest.mark.merge_xunit(path='/tmp/conformance',
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030077 output='/root/conformance_result.xml')
Victor Ryzhenkin6f7ccb32018-12-26 18:41:27 +040078 @pytest.mark.download(name=['conformance.log',
79 'conformance_result.xml'])
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030080 @pytest.mark.parametrize("_", [settings.ENV_NAME])
81 @pytest.mark.k8s_conformance
82 def test_run_k8s_conformance(self, show_step, config, k8s_actions,
Victor Ryzhenkin6f7ccb32018-12-26 18:41:27 +040083 conformance_helper, _):
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030084 """Test run of k8s conformance tests"""
Victor Ryzhenkin6f7ccb32018-12-26 18:41:27 +040085 k8s_actions.start_conformance_inside_pod()
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030086
87 @pytest.mark.grab_versions
Victor Ryzhenkin6f7ccb32018-12-26 18:41:27 +040088 @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 Dmitrievee5ef232018-08-31 13:53:18 +030094 @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 Ryzhenkin6f7ccb32018-12-26 18:41:27 +040097 conformance_helper, _):
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030098 """Test run of k8s virtlet conformance tests"""
Victor Ryzhenkin6f7ccb32018-12-26 18:41:27 +040099 k8s_actions.start_conformance_inside_pod(cnf_type='virtlet')