blob: 78583afe8ab80134768adc155965b7c900f83149 [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
35 def test_run_tempest(self, tempest_actions, show_step, _):
Tatyana Leontovichf3718442018-10-31 13:36:13 +020036 """Runner for Openstack tempest tests
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030037
38 Scenario:
39 1. Run tempest
40 """
41 show_step(1)
42 tempest_actions.prepare_and_run_tempest()
43
44 @pytest.mark.grab_versions
45 @pytest.mark.parametrize("_", [settings.ENV_NAME])
46 @pytest.mark.run_stacklight
47 def test_run_stacklight(self, sl_actions, show_step, _):
48 """Runner for Stacklight tests
49
50 Scenario:
51 1. Run SL test
52 """
53
54 # Run SL component tetsts
55 show_step(1)
56 sl_actions.setup_sl_functional_tests(
57 'cfg01',
58 )
59 sl_actions.run_sl_functional_tests(
60 'cfg01',
61 '/root/stacklight-pytest/stacklight_tests/',
62 'tests/prometheus',
63 'test_alerts.py',
64 junit_report_name='stacklight_report.xml')
65 # Download report
66 sl_actions.download_sl_test_report(
67 'cfg01',
68 '/root/stacklight-pytest/stacklight_tests/'
69 'stacklight_report.xml')
70
71 @pytest.mark.grab_versions
72 @pytest.mark.extract(container_system='docker', extract_from='conformance',
73 files_to_extract=['report'])
74 @pytest.mark.merge_xunit(path='/root/report',
75 output='/root/conformance_result.xml')
76 @pytest.mark.grab_k8s_results(name=['k8s_conformance.log',
77 'conformance_result.xml'])
78 @pytest.mark.parametrize("_", [settings.ENV_NAME])
79 @pytest.mark.k8s_conformance
80 def test_run_k8s_conformance(self, show_step, config, k8s_actions,
81 k8s_logs, _):
82 """Test run of k8s conformance tests"""
83 k8s_actions.run_conformance()
84
85 @pytest.mark.grab_versions
Dennis Dmitriev34fd3002018-11-15 18:25:16 +020086 @pytest.mark.extract(container_system='docker',
87 extract_from='mirantis/virtlet',
88 files_to_extract=['conformance_virtlet_result.xml'])
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030089 @pytest.mark.grab_k8s_results(name=['virtlet_conformance.log',
Dennis Dmitriev34fd3002018-11-15 18:25:16 +020090 'conformance_virtlet_result.xml'])
Dennis Dmitrievee5ef232018-08-31 13:53:18 +030091 @pytest.mark.parametrize("_", [settings.ENV_NAME])
92 @pytest.mark.k8s_conformance_virtlet
93 def test_run_k8s_conformance_virtlet(self, show_step, config, k8s_actions,
94 k8s_logs, _):
95 """Test run of k8s virtlet conformance tests"""
Dennis Dmitriev34fd3002018-11-15 18:25:16 +020096 config.k8s.run_extended_virtlet_conformance = True
97 k8s_actions.run_virtlet_conformance(
98 report_name="conformance_virtlet_result.xml")