Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +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. |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 14 | |
| 15 | import pytest |
| 16 | |
Dennis Dmitriev | 474e3f7 | 2016-10-21 16:46:09 +0300 | [diff] [blame] | 17 | from tcp_tests import logger |
| 18 | |
| 19 | LOG = logger.logger |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 20 | |
| 21 | |
| 22 | @pytest.mark.deploy |
| 23 | class TestTCPInstaller(object): |
| 24 | """Test class for testing TCP deployment""" |
| 25 | |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 26 | @pytest.mark.fail_snapshot |
Dennis Dmitriev | 9cc4ca3 | 2016-11-03 13:50:45 +0200 | [diff] [blame] | 27 | def test_tcp_install_default(self, underlay, openstack_deployed, |
| 28 | show_step, rally): |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 29 | """Test for deploying an tcp environment and check it |
| 30 | |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 31 | Scenario: |
Dennis Dmitriev | 4be178c | 2016-10-25 13:17:46 +0300 | [diff] [blame] | 32 | 1. Prepare salt on hosts |
| 33 | 2. Setup controller nodes |
| 34 | 3. Setup compute nodes |
Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 35 | |
Dennis Dmitriev | 75fce1b | 2016-10-18 15:04:28 +0300 | [diff] [blame] | 36 | """ |
dis | 58f2588 | 2016-12-06 19:13:15 +0200 | [diff] [blame] | 37 | LOG.info("*************** DONE **************") |
| 38 | |
| 39 | def test_tcp_install_run_rally(self, underlay, openstack_deployed, |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 40 | show_step, rally): |
dis | 58f2588 | 2016-12-06 19:13:15 +0200 | [diff] [blame] | 41 | """Test for deploying an tcp environment and check it |
| 42 | |
| 43 | Scenario: |
| 44 | 1. Prepare salt on hosts |
| 45 | 2. Setup controller nodes |
| 46 | 3. Setup compute nodes |
| 47 | |
| 48 | """ |
Dennis Dmitriev | 9cc4ca3 | 2016-11-03 13:50:45 +0200 | [diff] [blame] | 49 | # prepare rally |
| 50 | rally.prepare() |
| 51 | rally.pull_image() |
| 52 | rally.run() |
| 53 | # run tempest |
| 54 | rally.run_tempest() |
| 55 | |
| 56 | res = rally.get_results() |
| 57 | |
| 58 | fail_msg = 'Tempest verification fails {}'.format(res) |
| 59 | assert res['failures'] == 0, fail_msg |
Dennis Dmitriev | 1a745e3 | 2016-11-07 14:40:28 +0200 | [diff] [blame] | 60 | |
Dennis Dmitriev | 99b26fe | 2017-04-26 12:34:44 +0300 | [diff] [blame] | 61 | @pytest.mark.fail_snapshot |
Dennis Dmitriev | 1a745e3 | 2016-11-07 14:40:28 +0200 | [diff] [blame] | 62 | def test_tcp_install_with_scripts(self, config, underlay, salt_deployed, |
| 63 | show_step, rally): |
| 64 | """Test for deploying an tcp environment with scripts and check it |
| 65 | |
| 66 | Scenario: |
| 67 | 1. Prepare salt on hosts |
| 68 | 2. Setup controller nodes |
| 69 | 3. Setup compute nodes |
| 70 | |
| 71 | """ |
| 72 | |
| 73 | cmd = 'cd /srv/salt/reclass/scripts/; ./bootstrap_all.sh' |
Dina Belova | e6fdffb | 2017-09-19 13:58:34 -0700 | [diff] [blame] | 74 | underlay.check_call(cmd, host=config.salt.salt_master_host, |
| 75 | verbose=True) |
Dennis Dmitriev | 1a745e3 | 2016-11-07 14:40:28 +0200 | [diff] [blame] | 76 | |
| 77 | # prepare rally |
| 78 | rally.prepare() |
| 79 | rally.pull_image() |
| 80 | rally.run() |
| 81 | # run tempest |
| 82 | rally.run_tempest() |
| 83 | |
| 84 | res = rally.get_results() |
| 85 | |
| 86 | fail_msg = 'Tempest verification fails {}'.format(res) |
| 87 | assert res['failures'] == 0, fail_msg |