[Sanity] Removed hardcoded node groups from Single VIP test

The VIP address is not expected to be on all nodes, it is not
expected on e.g. Salt master, compute nodes, gateway nodes,
apt, bmk, ceph-mon, kvm, ceph osd, dns nodes.
Removed hardcoded group named and replaced them by pillars.

Change-Id: Idd92718132d1d7c0efcee53f539566ebf3720390
Related-prod: PROD-34418
diff --git a/test_set/cvp-sanity/tests/test_single_vip.py b/test_set/cvp-sanity/tests/test_single_vip.py
index 92a6a5e..31e47f7 100644
--- a/test_set/cvp-sanity/tests/test_single_vip.py
+++ b/test_set/cvp-sanity/tests/test_single_vip.py
@@ -1,6 +1,7 @@
 import utils
 import json
 import pytest
+import re
 
 
 @pytest.mark.smoke
@@ -17,9 +18,37 @@
     exclude_from_grep =  " | grep -v {}".format('\|'.join(keywords_to_exclude_interfaces)) \
                         if len(keywords_to_exclude_interfaces) > 0 \
                         else ""
+
+    # Let's exclude cmp, kvm, ceph OSD nodes, k8s-cmp, cfg, apt, dns,
+    # gtw, ceph mon nodes
+    exclude_nodes = local_salt_client.test_ping(
+         tgt="I@nova:compute or "                 # cmp
+             "I@ceph:osd or "                     # ceph osd
+             "I@salt:control or "                 # kvm
+             "I@ceph:mon or "                     # ceph mon
+             "I@salt:master or "                  # cfg
+             "I@neutron:gateway or "              # gtw
+             "I@powerdns:server or "              # dns
+             "I@debmirror:client or "             # apt
+             "I@kubernetes:* and not I@etcd:*",   # k8s-cmp
+         expr_form='compound').keys()
+
+    # bmk nodes has no unique pillar, let's add it separately to skip
+    bmk_hostname = local_salt_client.pillar_get(
+        param='_param:openstack_benchmark_node01_hostname')
+    if bmk_hostname:
+        exclude_nodes.append(bmk_hostname)
+
+    exclude_groups = []
+    for node in exclude_nodes:
+        index = re.search('[0-9]{1,3}$', node.split('.')[0])
+        if index:
+            exclude_groups.append(node.split('.')[0][:-len(index.group(0))])
+        else:
+            exclude_groups.append(node)
     no_vip = {}
     for group in groups:
-        if group in ['cmp', 'cfg', 'kvm', 'cmn', 'osd', 'gtw', 'dns', 'apt']:
+        if group in exclude_groups:
             continue
         nodes_list = local_salt_client.cmd(
             tgt="L@" + ','.join(groups[group]),