Create new test group for mcp+trusty models
Additionally: add 'sync time' step in virtual-mcp-trusty template
Change-Id: Ia03c017d1b7037f5e9528dd0235c9e86be4e3e24
diff --git a/tcp_tests/templates/virtual-mcp-trusty/openstack.yaml b/tcp_tests/templates/virtual-mcp-trusty/openstack.yaml
index c1eb756..b122cfa 100644
--- a/tcp_tests/templates/virtual-mcp-trusty/openstack.yaml
+++ b/tcp_tests/templates/virtual-mcp-trusty/openstack.yaml
@@ -7,12 +7,17 @@
{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
# Install OpenStack control services
+- description: Sync time
+ cmd: salt --hard-crash --state-output=mixed --state-verbose=False -G 'oscodename:trusty' cmd.run "service ntp stop && ntpdate pool.ntp.org && service ntp start"
+ node_name: {{ HOSTNAME_CFG01 }}
+ retry: {count: 1, delay: 5}
+ skip_fail: false
- description: Install glance on all controllers
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@glance:server' state.sls glance -b 1
node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 3, delay: 30}
+ retry: {count: 1, delay: 5}
skip_fail: false
- description: Install keystone service (note that different fernet keys are created on different nodes)
@@ -126,7 +131,7 @@
cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-C 'I@designate:server' state.sls designate -b 1
node_name: {{ HOSTNAME_CFG01 }}
- retry: {count: 5, delay: 10}
+ retry: {count: 1, delay: 10}
skip_fail: true
- description: Check neutron agent-list
diff --git a/tcp_tests/tests/system/test_install_mcp_sl_os.py b/tcp_tests/tests/system/test_install_mcp_sl_os.py
index 54a92f0..d416875 100644
--- a/tcp_tests/tests/system/test_install_mcp_sl_os.py
+++ b/tcp_tests/tests/system/test_install_mcp_sl_os.py
@@ -41,9 +41,8 @@
args='service ntp stop; ntpd -gq; service ntp start')
if settings.RUN_TEMPEST:
- openstack_actions.run_tempest(pattern=settings.PATTERN,
- target='cfg01')
- openstack_actions.download_tempest_report(stored_node='cfg01')
+ openstack_actions.run_tempest(pattern=settings.PATTERN)
+ openstack_actions.download_tempest_report()
LOG.info("*************** DONE **************")
@pytest.mark.grab_versions
diff --git a/tcp_tests/tests/system/test_install_mcp_trusty.py b/tcp_tests/tests/system/test_install_mcp_trusty.py
new file mode 100644
index 0000000..8c91faa
--- /dev/null
+++ b/tcp_tests/tests/system/test_install_mcp_trusty.py
@@ -0,0 +1,91 @@
+# Copyright 2018 Mirantis, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import pytest
+
+from tcp_tests import logger
+from tcp_tests import settings
+
+LOG = logger.logger
+
+
+@pytest.mark.deploy
+class TestMcpInstallStacklightOpenstackTrusty(object):
+ """Test class for testing mcp11 vxlan deploy"""
+
+ @pytest.mark.grab_versions
+ @pytest.mark.fail_snapshot
+ def test_mcp_trusty_os_install(self, underlay, openstack_deployed,
+ openstack_actions):
+ """Test for deploying an mcp environment and check it
+ Scenario:
+ 1. Prepare salt on hosts
+ 2. Setup controller nodes
+ 3. Setup compute nodes
+ 4. Run tempest
+
+ """
+ openstack_actions._salt.local(
+ tgt='*', fun='cmd.run',
+ args='service ntp stop; ntpd -gq; service ntp start')
+
+ if settings.RUN_TEMPEST:
+ openstack_actions.run_tempest(pattern=settings.PATTERN,
+ target='cfg01')
+ openstack_actions.download_tempest_report(stored_node='cfg01')
+ LOG.info("*************** DONE **************")
+
+ @pytest.mark.grab_versions
+ @pytest.mark.fail_snapshot
+ def test_mcp_trusty_sl_os_install(self, underlay, config,
+ openstack_deployed, sl_deployed,
+ openstack_actions):
+ """Test for deploying an mcp environment and check it
+ Scenario:
+ 1. Prepare salt on hosts
+ 2. Setup controller nodes
+ 3. Setup compute nodes
+ 4. Get monitoring nodes
+ 5. Check that docker services are running
+ 6. Check current prometheus targets are UP
+ 7. Run SL component tests
+ 8. Download SL component tests report
+ """
+ mon_nodes = sl_deployed.get_monitoring_nodes()
+ LOG.debug('Mon nodes list {0}'.format(mon_nodes))
+
+ sl_deployed.check_prometheus_targets(mon_nodes)
+
+ # Run SL component tetsts
+ sl_deployed.run_sl_functional_tests(
+ 'cfg01',
+ '/root/stacklight-pytest/stacklight_tests/',
+ 'tests/prometheus',
+ 'test_alerts.py')
+
+ # Download report
+ sl_deployed.download_sl_test_report(
+ 'cfg01',
+ '/root/stacklight-pytest/stacklight_tests/report.xml')
+ LOG.info("*************** DONE **************")
+
+ openstack_actions._salt.local(
+ tgt='*', fun='cmd.run',
+ args='service ntp stop; ntpd -gq; service ntp start')
+
+ if settings.RUN_TEMPEST:
+ openstack_actions.run_tempest(pattern=settings.PATTERN,
+ target='cfg01')
+ openstack_actions.download_tempest_report(stored_node='cfg01')
+ LOG.info("*************** DONE **************")