blob: 56f6a79bb0e1fc7975d6a6de5ede99f7a9ff63c8 [file] [log] [blame]
sgudzbf4de572017-11-23 14:37:01 +02001# 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
15from tcp_tests import logger
16from tcp_tests import settings
17import pytest
18LOG = logger.logger
19
20
21@pytest.mark.deploy
22class 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 Dmitrievea48cf52018-07-18 18:04:39 +030028 hardware, sl_actions, stacklight_deployed):
sgudzbf4de572017-11-23 14:37:01 +020029 """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 Dmitrievea48cf52018-07-18 18:04:39 +030045 mon_nodes = stacklight_deployed.get_monitoring_nodes()
sgudzbf4de572017-11-23 14:37:01 +020046 LOG.debug('Mon nodes list {0}'.format(mon_nodes))
47
48
49# Run SL component tetsts
Dennis Dmitrievea48cf52018-07-18 18:04:39 +030050 stacklight_deployed.run_sl_functional_tests(
sgudzbf4de572017-11-23 14:37:01 +020051 'cfg01',
52 '/root/stacklight-pytest/stacklight_tests/',
53 'tests',
vitalygusev0e57ef62018-11-30 12:13:56 +040054 'tests_alerts.py')
sgudzbf4de572017-11-23 14:37:01 +020055
56# Download report
Dennis Dmitrievea48cf52018-07-18 18:04:39 +030057 stacklight_deployed.download_sl_test_report(
sgudzbf4de572017-11-23 14:37:01 +020058 'cfg01',
59 '/root/stacklight-pytest/stacklight_tests/report.xml')
60 LOG.info("*************** DONE **************")