blob: e946185b5f351c8cf6a9fb048cdb93a72c1145d0 [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,
28 hardware, sl_actions, sl_deployed):
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
sgudzbf4de572017-11-23 14:37:01 +020045 mon_nodes = sl_deployed.get_monitoring_nodes()
46 LOG.debug('Mon nodes list {0}'.format(mon_nodes))
47
48
49# Run SL component tetsts
50 sl_deployed.run_sl_functional_tests(
51 'cfg01',
52 '/root/stacklight-pytest/stacklight_tests/',
53 'tests',
54 'tests/prometheus')
55
56# Download report
57 sl_deployed.download_sl_test_report(
58 'cfg01',
59 '/root/stacklight-pytest/stacklight_tests/report.xml')
60 LOG.info("*************** DONE **************")