blob: 80bfc715c6fb77c464cbe406868b3eaa14ca3a15 [file] [log] [blame]
Dennis Dmitriev6f59add2016-10-18 13:45:27 +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.
14import copy
Dennis Dmitrieva982b2d2016-10-21 16:52:50 +030015import time
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030016
17import pytest
18
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030019from tcp_tests import settings
20from tcp_tests.helpers import ext
Dennis Dmitriev474e3f72016-10-21 16:46:09 +030021from tcp_tests import logger
22
23LOG = logger.logger
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030024
25
26@pytest.mark.deploy
27class TestTCPInstaller(object):
28 """Test class for testing TCP deployment"""
29
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030030 @pytest.mark.fail_snapshot
Dennis Dmitriev9cc4ca32016-11-03 13:50:45 +020031 def test_tcp_install_default(self, underlay, openstack_deployed,
32 show_step, rally):
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030033 """Test for deploying an tcp environment and check it
34
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030035 Scenario:
Dennis Dmitriev4be178c2016-10-25 13:17:46 +030036 1. Prepare salt on hosts
37 2. Setup controller nodes
38 3. Setup compute nodes
Dennis Dmitriev6f59add2016-10-18 13:45:27 +030039
Dennis Dmitriev75fce1b2016-10-18 15:04:28 +030040 """
dis58f25882016-12-06 19:13:15 +020041 LOG.info("*************** DONE **************")
42
43 def test_tcp_install_run_rally(self, underlay, openstack_deployed,
Dina Belovae6fdffb2017-09-19 13:58:34 -070044 show_step, rally):
dis58f25882016-12-06 19:13:15 +020045 """Test for deploying an tcp environment and check it
46
47 Scenario:
48 1. Prepare salt on hosts
49 2. Setup controller nodes
50 3. Setup compute nodes
51
52 """
Dennis Dmitriev9cc4ca32016-11-03 13:50:45 +020053 # prepare rally
54 rally.prepare()
55 rally.pull_image()
56 rally.run()
57 # run tempest
58 rally.run_tempest()
59
60 res = rally.get_results()
61
62 fail_msg = 'Tempest verification fails {}'.format(res)
63 assert res['failures'] == 0, fail_msg
Dennis Dmitriev1a745e32016-11-07 14:40:28 +020064
Dennis Dmitriev99b26fe2017-04-26 12:34:44 +030065 @pytest.mark.fail_snapshot
Dennis Dmitriev1a745e32016-11-07 14:40:28 +020066 def test_tcp_install_with_scripts(self, config, underlay, salt_deployed,
67 show_step, rally):
68 """Test for deploying an tcp environment with scripts and check it
69
70 Scenario:
71 1. Prepare salt on hosts
72 2. Setup controller nodes
73 3. Setup compute nodes
74
75 """
76
77 cmd = 'cd /srv/salt/reclass/scripts/; ./bootstrap_all.sh'
Dina Belovae6fdffb2017-09-19 13:58:34 -070078 underlay.check_call(cmd, host=config.salt.salt_master_host,
79 verbose=True)
Dennis Dmitriev1a745e32016-11-07 14:40:28 +020080
81 # prepare rally
82 rally.prepare()
83 rally.pull_image()
84 rally.run()
85 # run tempest
86 rally.run_tempest()
87
88 res = rally.get_results()
89
90 fail_msg = 'Tempest verification fails {}'.format(res)
91 assert res['failures'] == 0, fail_msg