[CVP] Skip flannel interfaces from test_single_vip_exists (it is a case for k8s clusters)
Change-Id: I9b470da565a233cc1cf222b3bd620bc3de73ecd0
Related-PROD: PROD-30137
diff --git a/test_set/cvp-sanity/tests/test_single_vip.py b/test_set/cvp-sanity/tests/test_single_vip.py
index 7a1c2f8..c18c660 100644
--- a/test_set/cvp-sanity/tests/test_single_vip.py
+++ b/test_set/cvp-sanity/tests/test_single_vip.py
@@ -1,5 +1,6 @@
import utils
import json
+import pytest
def test_single_vip_exists(local_salt_client):
@@ -7,15 +8,23 @@
within one group of nodes (where applicable).
Steps:
1. Get IP addresses for nodes via salt cmd.run 'ip a | grep /32'
- 2. Check that at least 1 node responds with something.
+ 2. Check that exactly 1 node responds with something.
"""
groups = utils.calculate_groups()
+
+ keywords_to_exclude_interfaces = ["flannel.1"]
+ exclude_from_grep = " | grep -v {}".format('\|'.join(keywords_to_exclude_interfaces)) \
+ if len(keywords_to_exclude_interfaces) > 0 \
+ else ""
no_vip = {}
for group in groups:
if group in ['cmp', 'cfg', 'kvm', 'cmn', 'osd', 'gtw']:
continue
nodes_list = local_salt_client.cmd(
- "L@" + ','.join(groups[group]), 'cmd.run', 'ip a | grep /32', expr_form='compound')
+ tgt="L@" + ','.join(groups[group]),
+ fun='cmd.run',
+ param='ip a | grep /32 ' + exclude_from_grep,
+ expr_form='compound')
result = [x for x in nodes_list.values() if x]
if len(result) != 1:
if len(result) == 0: