Fix ocata BVT tests

- Use removing of not used cfg* nodes before generating cluster
  nodes
- Add @pytest.mark.fail_snapshot to mcp11_ocata tests
- Remove outdated salt_cmd definitions from tests

Change-Id: I797efb6bb6a5e451e8fbfe8b38c48a6a761838b6
Reviewed-on: https://review.gerrithub.io/370644
Reviewed-by: Tatyanka Leontovich <tleontovich@mirantis.com>
Tested-by: Tatyanka Leontovich <tleontovich@mirantis.com>
diff --git a/tcp_tests/templates/virtual-mcp-ocata-cicd/salt.yaml b/tcp_tests/templates/virtual-mcp-ocata-cicd/salt.yaml
index 758d7d3..2bd1690 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-cicd/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-cicd/salt.yaml
@@ -168,18 +168,22 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Restart salt-master service
+- description: "*Workaround* remove all cfg01 nodes except {{ HOSTNAME_CFG01 }} to not depend on other clusters in 'reclass --top'"
   cmd: |
-     systemctl restart salt-master;
+    # Remove all other nodes except {{ HOSTNAME_CFG01 }} to not rely on them for 'reclass --top'
+    find /srv/salt/reclass/nodes/ -type f -not -name {{ HOSTNAME_CFG01 }}.yml -delete
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
 
 - description: Show reclass-salt --top for cfg01 node
-  cmd: |
-    # Remove all other nodes except {{ HOSTNAME_CFG01 }} to not rely on them for 'reclass --top'
-    find /srv/salt/reclass/nodes/ -type f -not -name {{ HOSTNAME_CFG01 }}.yml -delete
-    reclass-salt --top
+  cmd: reclass-salt --top
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Restart salt-master service
+  cmd: systemctl restart salt-master;
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml b/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml
index 476bd80..dbd87a5 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-dvr/salt.yaml
@@ -161,9 +161,22 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Restart salt-master service
+- description: "*Workaround* remove all cfg01 nodes except {{ HOSTNAME_CFG01 }} to not depend on other clusters in 'reclass --top'"
   cmd: |
-     systemctl restart salt-master;
+    # Remove all other nodes except {{ HOSTNAME_CFG01 }} to not rely on them for 'reclass --top'
+    find /srv/salt/reclass/nodes/ -type f -not -name {{ HOSTNAME_CFG01 }}.yml -delete
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Show reclass-salt --top for cfg01 node
+  cmd: reclass-salt --top
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Restart salt-master service
+  cmd: systemctl restart salt-master;
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
@@ -243,10 +256,7 @@
   skip_fail: false
 
 - description: Show  reclass-salt --top
-  cmd: |
-    # Remove all other nodes except {{ HOSTNAME_CFG01 }} to not rely on them for 'reclass --top'
-    find /srv/salt/reclass/nodes/ -type f -not -name {{ HOSTNAME_CFG01 }}.yml -delete
-    reclass-salt --top
+  cmd: reclass-salt --top
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
diff --git a/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml b/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml
index 9b5c22c..98c2fdd 100644
--- a/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml
+++ b/tcp_tests/templates/virtual-mcp-ocata-ovs/salt.yaml
@@ -168,9 +168,22 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Restart salt-master service
+- description: "*Workaround* remove all cfg01 nodes except {{ HOSTNAME_CFG01 }} to not depend on other clusters in 'reclass --top'"
   cmd: |
-     systemctl restart salt-master;
+    # Remove all other nodes except {{ HOSTNAME_CFG01 }} to not rely on them for 'reclass --top'
+    find /srv/salt/reclass/nodes/ -type f -not -name {{ HOSTNAME_CFG01 }}.yml -delete
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Show reclass-salt --top for cfg01 node
+  cmd: reclass-salt --top
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Restart salt-master service
+  cmd: systemctl restart salt-master;
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
@@ -251,10 +264,7 @@
   skip_fail: false
 
 - description: Show  reclass-salt --top
-  cmd: |
-    # Remove all other nodes except {{ HOSTNAME_CFG01 }} to not rely on them for 'reclass --top'
-    find /srv/salt/reclass/nodes/ -type f -not -name {{ HOSTNAME_CFG01 }}.yml -delete
-    reclass-salt --top
+  cmd: reclass-salt --top
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
diff --git a/tcp_tests/tests/system/test_install_mcp11_ovs_newton.py b/tcp_tests/tests/system/test_install_mcp11_ovs_newton.py
index 6c44de4..4b541bb 100644
--- a/tcp_tests/tests/system/test_install_mcp11_ovs_newton.py
+++ b/tcp_tests/tests/system/test_install_mcp11_ovs_newton.py
@@ -27,14 +27,6 @@
 class Test_Mcp11_install(object):
     """Test class for testing mcp11 vxlan deploy"""
 
-    #salt_cmd = 'salt -l debug '  # For debug output
-    #salt_call_cmd = 'salt-call -l debug '  # For debug output
-    salt_cmd = 'salt --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    salt_call_cmd = 'salt-call --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    #salt_cmd = 'salt --state-output=terse --state-verbose=False '  # For reduced output
-    #salt_call_cmd = 'salt-call --state-output=terse --state-verbose=False '  # For reduced output
-
-    # @pytest.mark.snapshot_needed
     @pytest.mark.fail_snapshot
     def test_mcp11_newton_ovs_install(self, underlay, openstack_deployed,
                                      show_step):
@@ -48,6 +40,7 @@
         """
         LOG.info("*************** DONE **************")
 
+    @pytest.mark.fail_snapshot
     def test_mcp11_newton_dvr_install(self, underlay, openstack_deployed,
                                      show_step):
         """Test for deploying an mcp environment and check it
diff --git a/tcp_tests/tests/system/test_install_mcp11_ovs_ocata.py b/tcp_tests/tests/system/test_install_mcp11_ovs_ocata.py
index 2ed355e..88c5cb7 100644
--- a/tcp_tests/tests/system/test_install_mcp11_ovs_ocata.py
+++ b/tcp_tests/tests/system/test_install_mcp11_ovs_ocata.py
@@ -23,13 +23,7 @@
 class Test_Mcp11_install(object):
     """Test class for testing mcp11 vxlan deploy"""
 
-    #salt_cmd = 'salt -l debug '  # For debug output
-    #salt_call_cmd = 'salt-call -l debug '  # For debug output
-    salt_cmd = 'salt --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    salt_call_cmd = 'salt-call --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    #salt_cmd = 'salt --state-output=terse --state-verbose=False '  # For reduced output
-    #salt_call_cmd = 'salt-call --state-output=terse --state-verbose=False '  # For reduced output
-
+    @pytest.mark.fail_snapshot
     def test_mcp11_ocata_ovs_install(self, underlay, openstack_deployed,
                                           show_step):
         """Test for deploying an mcp environment and check it
@@ -49,6 +43,7 @@
             LOG.debug("Founded files {0}".format(file_name))
             gtw_remote.download(destination=file_name, target=os.getcwd())
 
+    @pytest.mark.fail_snapshot
     def test_mcp11_ocata_dvr_install(self, underlay, openstack_deployed,
                                           show_step):
         """Test for deploying an mcp environment and check it
@@ -68,6 +63,7 @@
             LOG.debug("Founded files {0}".format(file_name))
             gtw_remote.download(destination=file_name, target=os.getcwd())
 
+    @pytest.mark.fail_snapshot
     def test_mcp11_ocata_dpdk_install(self, underlay, openstack_deployed,
                                       show_step):
         """Test for deploying an mcp dpdk environment and check it
diff --git a/tcp_tests/tests/system/test_install_virtlet.py b/tcp_tests/tests/system/test_install_virtlet.py
index 0ccb75d..367ed45 100644
--- a/tcp_tests/tests/system/test_install_virtlet.py
+++ b/tcp_tests/tests/system/test_install_virtlet.py
@@ -27,14 +27,6 @@
 class TestVirtletInstall(object):
     """Test class for testing Virtlet deploy"""
 
-    #salt_cmd = 'salt -l debug '  # For debug output
-    #salt_call_cmd = 'salt-call -l debug '  # For debug output
-    salt_cmd = 'salt --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    salt_call_cmd = 'salt-call --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    #salt_cmd = 'salt --state-output=terse --state-verbose=False '  # For reduced output
-    #salt_call_cmd = 'salt-call --state-output=terse --state-verbose=False '  # For reduced output
-
-    # @pytest.mark.snapshot_needed
     # @pytest.mark.fail_snapshot
     def test_virtlet_install(self, underlay, virtlet_deployed,
                                      show_step):
diff --git a/tcp_tests/tests/system/test_mcp10_ovs_vxlan_install.py b/tcp_tests/tests/system/test_mcp10_ovs_vxlan_install.py
index 00c9ee1..2c49259 100644
--- a/tcp_tests/tests/system/test_mcp10_ovs_vxlan_install.py
+++ b/tcp_tests/tests/system/test_mcp10_ovs_vxlan_install.py
@@ -27,14 +27,6 @@
 class TestMCP10OvsVxlanInstall(object):
     """Test class for testing mcp10 vxlan deploy"""
 
-    #salt_cmd = 'salt -l debug '  # For debug output
-    #salt_call_cmd = 'salt-call -l debug '  # For debug output
-    salt_cmd = 'salt --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    salt_call_cmd = 'salt-call --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    #salt_cmd = 'salt --state-output=terse --state-verbose=False '  # For reduced output
-    #salt_call_cmd = 'salt-call --state-output=terse --state-verbose=False '  # For reduced output
-
-    # @pytest.mark.snapshot_needed
     @pytest.mark.fail_snapshot
     def test_mcp10_ovs_vxlan_install(self, underlay, openstack_deployed,
                                      show_step):
diff --git a/tcp_tests/tests/system/test_opencontrail.py b/tcp_tests/tests/system/test_opencontrail.py
index 9452bda..542237e 100644
--- a/tcp_tests/tests/system/test_opencontrail.py
+++ b/tcp_tests/tests/system/test_opencontrail.py
@@ -27,7 +27,6 @@
 class TestOpenContrail(object):
     """Test class for testing OpenContrail on a TCP lab"""
 
-    # @pytest.mark.snapshot_needed
     @pytest.mark.fail_snapshot
     def test_opencontrail(self, config, openstack_deployed,
                                  show_step, opencontrail):
diff --git a/tcp_tests/tests/system/test_tcp_install.py b/tcp_tests/tests/system/test_tcp_install.py
index 1ccb0d4..b633867 100644
--- a/tcp_tests/tests/system/test_tcp_install.py
+++ b/tcp_tests/tests/system/test_tcp_install.py
@@ -27,14 +27,6 @@
 class TestTCPInstaller(object):
     """Test class for testing TCP deployment"""
 
-    #salt_cmd = 'salt -l debug '  # For debug output
-    #salt_call_cmd = 'salt-call -l debug '  # For debug output
-    salt_cmd = 'salt --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    salt_call_cmd = 'salt-call --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    #salt_cmd = 'salt --state-output=terse --state-verbose=False '  # For reduced output
-    #salt_call_cmd = 'salt-call --state-output=terse --state-verbose=False '  # For reduced output
-
-    # @pytest.mark.snapshot_needed
     @pytest.mark.fail_snapshot
     def test_tcp_install_default(self, underlay, openstack_deployed,
                                  show_step, rally):
@@ -70,7 +62,6 @@
         fail_msg = 'Tempest verification fails {}'.format(res)
         assert res['failures'] == 0, fail_msg
 
-    # @pytest.mark.snapshot_needed
     @pytest.mark.fail_snapshot
     def test_tcp_install_with_scripts(self, config, underlay, salt_deployed,
                                       show_step, rally):
diff --git a/tcp_tests/tests/system/test_virtlet_actions.py b/tcp_tests/tests/system/test_virtlet_actions.py
index e5c01a1..1935cff 100644
--- a/tcp_tests/tests/system/test_virtlet_actions.py
+++ b/tcp_tests/tests/system/test_virtlet_actions.py
@@ -26,13 +26,6 @@
 class TestVirtletActions(object):
     """Test class for testing Virtlet actions"""
 
-    #salt_cmd = 'salt -l debug '  # For debug output
-    #salt_call_cmd = 'salt-call -l debug '  # For debug output
-    salt_cmd = 'salt --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    salt_call_cmd = 'salt-call --hard-crash --state-output=mixed --state-verbose=False '  # For cause only output
-    #salt_cmd = 'salt --state-output=terse --state-verbose=False '  # For reduced output
-    #salt_call_cmd = 'salt-call --state-output=terse --state-verbose=False '  # For reduced output
-
     def test_virtlet_create_delete_vm(self, underlay, virtlet_deployed,
                                      show_step, virtlet_actions):
         """Test for deploying an mcp environment with virtlet