Remove running Tempest from openstack.yaml in cookied virtual labs

Tempest must be started from the test code, not from
the deployment process

Change-Id: I54ba9c77cb349975cfafd021049290a84b20acba
diff --git a/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/openstack.yaml b/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/openstack.yaml
index bc1facc..f8dd91c 100644
--- a/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/openstack.yaml
+++ b/tcp_tests/templates/cookied-mcp-ocata-dop-sl2/openstack.yaml
@@ -254,19 +254,19 @@
   retry: {count: 1, delay: 30}
   skip_fail: false
 
-- description:  Allow all tcp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
+#- description:  Allow all tcp
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
+#    '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
 
-- description:  Allow all icmp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
+#- description:  Allow all icmp
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
+#    '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
 
 - description: sync time
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
@@ -330,30 +330,3 @@
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 30}
   skip_fail: false
-
-- description: Run tests
-  cmd: |
-    if [[ {{ PATTERN }} == "false" ]]; then
-        docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate  >> image.output
-    else
-        docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -e CUSTOM='--pattern {{ PATTERN }}' -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate  >> image.output
-    fi
-  node_name: {{ HOSTNAME_GTW01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Download xml results
-  download:
-    remote_path: /root
-    remote_filename: "report_*.xml"
-    local_path: {{ os_env('PWD') }}
-  node_name: {{ HOSTNAME_GTW01 }}
-  skip_fail: true
-
-- description: Download html results
-  download:
-    remote_path: /root
-    remote_filename: "report_*.html"
-    local_path: {{ os_env('PWD') }}
-  node_name: {{ HOSTNAME_GTW01 }}
-  skip_fail: true
diff --git a/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/openstack.yaml b/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/openstack.yaml
index d06a7d5..bae02cc 100644
--- a/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/openstack.yaml
+++ b/tcp_tests/templates/cookied-mcp-ocata-dvr-vxlan/openstack.yaml
@@ -254,19 +254,19 @@
   retry: {count: 1, delay: 30}
   skip_fail: false
 
-- description:  Allow all tcp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
+#- description:  Allow all tcp
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
+#    '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
 
-- description:  Allow all icmp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
+#- description:  Allow all icmp
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
+#    '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
 
 - description: sync time
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
@@ -372,30 +372,3 @@
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 30}
   skip_fail: false
-
-- description: Run tests
-  cmd: |
-    if [[ {{ PATTERN }} == "false" ]]; then
-        docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate  >> image.output
-    else
-        docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -e CUSTOM='--pattern {{ PATTERN }}' -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate  >> image.output
-    fi
-  node_name: {{ HOSTNAME_GTW01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Download xml results
-  download:
-    remote_path: /root
-    remote_filename: "report_*.xml"
-    local_path: {{ os_env('PWD') }}
-  node_name: {{ HOSTNAME_GTW01 }}
-  skip_fail: true
-
-- description: Download html results
-  download:
-    remote_path: /root
-    remote_filename: "report_*.html"
-    local_path: {{ os_env('PWD') }}
-  node_name: {{ HOSTNAME_GTW01 }}
-  skip_fail: true
diff --git a/tcp_tests/tests/system/test_install_cookied_ocata.py b/tcp_tests/tests/system/test_install_cookied_ocata.py
index 22f4b93..0678365 100644
--- a/tcp_tests/tests/system/test_install_cookied_ocata.py
+++ b/tcp_tests/tests/system/test_install_cookied_ocata.py
@@ -15,6 +15,7 @@
 import pytest
 
 from tcp_tests import logger
+from tcp_tests import settings
 
 LOG = logger.logger
 
@@ -34,6 +35,9 @@
         3. Setup compute nodes
 
         """
+        if settings.RUN_TEMPEST:
+            openstack_deployed.run_tempest(pattern=settings.PATTERN)
+            openstack_deployed.download_tempest_report()
         LOG.info("*************** DONE **************")
 
     @pytest.mark.grab_versions
@@ -47,6 +51,9 @@
         3. Setup compute nodes
 
         """
+        if settings.RUN_TEMPEST:
+            openstack_deployed.run_tempest(pattern=settings.PATTERN)
+            openstack_deployed.download_tempest_report()
         LOG.info("*************** DONE **************")
 
     @pytest.mark.grab_versions
@@ -60,12 +67,18 @@
         2. Setup CICD nodes
         3. Setup OpenStack
         4. Setup StackLight v2
-        5. Get monitoring nodes
-        6. Check that docker services are running
-        7. Check current prometheus targets are UP
-        8. Run SL component tests
-        9. Download SL component tests report
+        5. Run Tempest for OpenStack cluster
+        6. Get monitoring nodes
+        7. Check that docker services are running
+        8. Check current prometheus targets are UP
+        9. Run SL component tests
+        10. Download SL component tests report
         """
+        show_step(5)
+        if settings.RUN_TEMPEST:
+            openstack_deployed.run_tempest(pattern=settings.PATTERN)
+            openstack_deployed.download_tempest_report()
+
         expected_service_list = ['monitoring_remote_storage_adapter',
                                  'monitoring_server',
                                  'monitoring_remote_agent',
@@ -73,23 +86,23 @@
                                  'monitoring_alertmanager',
                                  'monitoring_remote_collector',
                                  'monitoring_pushgateway']
-        show_step(5)
+        show_step(6)
         mon_nodes = sl_deployed.get_monitoring_nodes()
         LOG.debug('Mon nodes list {0}'.format(mon_nodes))
 
-        show_step(6)
+        show_step(7)
         sl_deployed.check_docker_services(mon_nodes, expected_service_list)
 
-        show_step(7)
+        show_step(8)
         sl_deployed.check_prometheus_targets(mon_nodes)
 
-        show_step(8)
+        show_step(9)
         # Run SL component tetsts
         sl_deployed.run_sl_functional_tests(
             'cfg01',
             '/root/stacklight-pytest/stacklight_tests/tests/prometheus')
 
-        show_step(9)
+        show_step(10)
         # Download report
         sl_deployed.download_sl_test_report(
             'cfg01',