sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [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 | from tcp_tests import logger |
| 16 | from tcp_tests import settings |
| 17 | import pytest |
| 18 | LOG = logger.logger |
| 19 | |
| 20 | |
| 21 | @pytest.mark.deploy |
| 22 | class TestUpgradeStacklight(object): |
| 23 | |
| 24 | """Test class for testing OpenContrail on a TCP lab""" |
| 25 | @pytest.mark.grab_versions |
| 26 | @pytest.mark.fail_snapshot |
| 27 | def test_upgrade_stacklight(self, underlay, config, |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 28 | hardware, sl_actions, stacklight_deployed): |
sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [diff] [blame] | 29 | """Runner |
| 30 | |
| 31 | Scenario: |
| 32 | 1. Prepare salt on hosts |
| 33 | 2. Setup controller nodes |
| 34 | 3. Setup compute nodes |
| 35 | 4. Prepare tests |
| 36 | 5. Run tests |
| 37 | """ |
| 38 | # Upgrade SL |
| 39 | lab_name = settings.LAB_CONFIG_NAME |
| 40 | steps_path = 'templates/{0}/sl-upgrade.yaml'.format(lab_name) |
| 41 | commands = underlay.read_template(steps_path) |
| 42 | sl_actions.install(commands, label='Upgrade SL services') |
| 43 | hardware.create_snapshot(name='sl_v1_upgraded') |
| 44 | |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 45 | mon_nodes = stacklight_deployed.get_monitoring_nodes() |
sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [diff] [blame] | 46 | LOG.debug('Mon nodes list {0}'.format(mon_nodes)) |
| 47 | |
| 48 | |
| 49 | # Run SL component tetsts |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 50 | stacklight_deployed.run_sl_functional_tests( |
sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [diff] [blame] | 51 | 'cfg01', |
| 52 | '/root/stacklight-pytest/stacklight_tests/', |
| 53 | 'tests', |
vitalygusev | 0e57ef6 | 2018-11-30 12:13:56 +0400 | [diff] [blame] | 54 | 'tests_alerts.py') |
sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [diff] [blame] | 55 | |
| 56 | # Download report |
Dennis Dmitriev | ea48cf5 | 2018-07-18 18:04:39 +0300 | [diff] [blame] | 57 | stacklight_deployed.download_sl_test_report( |
sgudz | bf4de57 | 2017-11-23 14:37:01 +0200 | [diff] [blame] | 58 | 'cfg01', |
| 59 | '/root/stacklight-pytest/stacklight_tests/report.xml') |
| 60 | LOG.info("*************** DONE **************") |