diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..303da24
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,41 @@
+# Automatically generated by `hgimportsvn`
+.svn
+.hgsvn
+
+# Ignore local virtualenvs
+lib/
+bin/
+include/
+.Python/
+
+# These lines are suggested according to the svn:ignore property
+# Feel free to enable them by uncommenting them
+*.pyc
+*.pyo
+*.swp
+*.class
+*.orig
+*~
+.hypothesis/
+
+# autogenerated
+src/_pytest/_version.py
+# setuptools
+.eggs/
+
+doc/*/_build
+build/
+dist/
+*.egg-info
+issue/
+env/
+.env/
+3rdparty/
+.tox
+.cache
+.pytest_cache
+.coverage
+.ropeproject
+.idea
+.hypothesis
+
diff --git a/cvp_checks/fixtures/base.py b/cvp_checks/fixtures/base.py
index 96abad9..2407a63 100644
--- a/cvp_checks/fixtures/base.py
+++ b/cvp_checks/fixtures/base.py
@@ -12,3 +12,22 @@
 @pytest.fixture(scope='session', params=nodes.values(), ids=nodes.keys())
 def nodes_in_group(request):
     return request.param
+
+
+def pytest_namespace():
+    return {'contrail': None}
+
+
+@pytest.fixture(scope='module')
+def contrail(local_salt_client):
+    probe = local_salt_client.cmd(
+        'opencontrail:control',
+        'pillar.get',
+        'opencontrail:control:version',
+        expr_form='pillar')
+    if not probe:
+        pytest.skip("Contrail is not found on this environment")
+    versions = set(probe.values())
+    if len(versions) != 1:
+        pytest.fail('Contrail versions are not the same: {}'.format(probe))
+    pytest.contrail = str(versions.pop())[:1]
diff --git a/cvp_checks/global_config.yaml b/cvp_checks/global_config.yaml
index 7072fcc..40303d6 100644
--- a/cvp_checks/global_config.yaml
+++ b/cvp_checks/global_config.yaml
@@ -62,7 +62,7 @@
 # this test may skip groups (see example)
 test_mtu:
   { #"skipped_groups": ["dbs"]
-    "skipped_ifaces": ["bonding_masters", "lo", "veth", "tap", "cali", "qv", "qb"]}
+    "skipped_ifaces": ["bonding_masters", "lo", "veth", "tap", "cali", "qv", "qb", "br-int", "vxlan"]}
 # mask for interfaces to skip
 
 drivetrain_version: ''
diff --git a/cvp_checks/tests/ceph/test_ceph_pg_count.py b/cvp_checks/tests/ceph/test_ceph_pg_count.py
index 46e50c4..28783e8 100644
--- a/cvp_checks/tests/ceph/test_ceph_pg_count.py
+++ b/cvp_checks/tests/ceph/test_ceph_pg_count.py
@@ -22,7 +22,7 @@
     pg_num and pgp_num should be the same and 
     set according formula to higher value of powered 2
     """
-    
+    pytest.skip("This test needs redesign. Skipped for now")
     ceph_monitors = local_salt_client.cmd(
         'ceph:mon', 
         'test.ping', 
diff --git a/cvp_checks/tests/ceph/test_ceph_tell_bench.py b/cvp_checks/tests/ceph/test_ceph_tell_bench.py
index db45435..b275022 100644
--- a/cvp_checks/tests/ceph/test_ceph_tell_bench.py
+++ b/cvp_checks/tests/ceph/test_ceph_tell_bench.py
@@ -12,6 +12,7 @@
     and gives the "bytes_per_sec" speed for each OSD.
 
     """
+    pytest.skip("This test needs redesign. Skipped for now")
     ceph_monitors = local_salt_client.cmd(
         'ceph:mon', 
         'test.ping', 
diff --git a/cvp_checks/tests/test_contrail.py b/cvp_checks/tests/test_contrail.py
index 22242f7..2d358e9 100644
--- a/cvp_checks/tests/test_contrail.py
+++ b/cvp_checks/tests/test_contrail.py
@@ -1,21 +1,21 @@
 import pytest
 import json
 
+pytestmark = pytest.mark.usefixtures("contrail")
+
+STATUS_FILTER = r'grep -Pv "(==|^$|Disk|unix|support|boot|\*\*|FOR NODE)"'
+STATUS_COMMAND = "contrail-status"
+
+def get_contrail_status(salt_client, pillar, command, processor):
+    return salt_client.cmd(
+        pillar, 'cmd.run',
+        ['{} | {}'.format(command, processor)],
+        expr_form='pillar'
+    )
 
 def test_contrail_compute_status(local_salt_client):
-    probe = local_salt_client.cmd(
-        'opencontrail:control', 'cmd.run',
-        ['contrail-status | grep -Pv \'(==|^$|Disk|unix|support)\''],
-        expr_form='pillar'
-    )
-    if not probe:
-        pytest.skip("Contrail is not found on this environment")
-
-    cs = local_salt_client.cmd(
-        'nova:compute', 'cmd.run',
-        ['contrail-status | grep -Pv \'(==|^$)\''],
-        expr_form='pillar'
-    )
+    cs = get_contrail_status(local_salt_client, 'nova:compute',
+                             STATUS_COMMAND, STATUS_FILTER)
     broken_services = []
 
     for node in cs:
@@ -38,18 +38,17 @@
 
 
 def test_contrail_node_status(local_salt_client):
-    cs = local_salt_client.cmd(
-        'opencontrail:client:analytics_node', 'cmd.run',
-        ['contrail-status | grep -Pv \'(==|^$|Disk|unix|support|boot)\''],
-        expr_form='pillar'
+    command = STATUS_COMMAND
+
+    # TODO: what will be in OpenContrail 5?
+    if pytest.contrail == '4':
+        command = "doctrail all " + command
+    cs = get_contrail_status(local_salt_client,
+                             'opencontrail:client:analytics_node',
+                             command, STATUS_FILTER)
+    cs.update(get_contrail_status(local_salt_client, 'opencontrail:control',
+                                  command, STATUS_FILTER)
     )
-    cs.update(local_salt_client.cmd(
-        'opencontrail:control', 'cmd.run',
-        ['contrail-status | grep -Pv \'(==|^$|Disk|unix|support|boot)\''],
-        expr_form='pillar')
-    )
-    if not cs:
-        pytest.skip("Contrail is not found on this environment")
     broken_services = []
     for node in cs:
         for line in cs[node].split('\n'):
@@ -69,17 +68,9 @@
 
 
 def test_contrail_vrouter_count(local_salt_client):
-    probe = local_salt_client.cmd(
-        'opencontrail:control', 'cmd.run',
-        ['contrail-status | grep -Pv \'(==|^$|Disk|unix|support)\''],
-        expr_form='pillar'
-    )
-    if not probe:
-        pytest.skip("Contrail is not found on this environment")
-    cs = local_salt_client.cmd(
-        'nova:compute', 'cmd.run', ['contrail-status | grep -Pv \'(==|^$)\''],
-        expr_form='pillar'
-    )
+    cs = get_contrail_status(local_salt_client, 'nova:compute',
+                             STATUS_COMMAND, STATUS_FILTER)
+
     # TODO: what if compute lacks these service unintentionally?
     if not cs:
         pytest.skip("Contrail services were not found on compute nodes")
diff --git a/cvp_checks/tests/test_mtu.py b/cvp_checks/tests/test_mtu.py
index 940c145..9054ba3 100644
--- a/cvp_checks/tests/test_mtu.py
+++ b/cvp_checks/tests/test_mtu.py
@@ -8,7 +8,7 @@
     testname = os.path.basename(__file__).split('.')[0]
     config = utils.get_configuration()
     skipped_ifaces = config.get(testname)["skipped_ifaces"] or \
-        ["bonding_masters", "lo", "veth", "tap", "cali"]
+        ["bonding_masters", "lo", "veth", "tap", "cali", "qv", "qb", "br-int", "vxlan"]
     total = {}
     network_info = local_salt_client.cmd(
         "L@"+','.join(nodes_in_group), 'cmd.run', ['ls /sys/class/net/'], expr_form='compound')
diff --git a/cvp_checks/tests/test_packet_checker.py b/cvp_checks/tests/test_packet_checker.py
index a583c24..f76c339 100644
--- a/cvp_checks/tests/test_packet_checker.py
+++ b/cvp_checks/tests/test_packet_checker.py
@@ -1,26 +1,24 @@
 import pytest
 import json
-import os
-from cvp_checks import utils
 
 
 def test_check_package_versions(local_salt_client, nodes_in_group):
-    output = local_salt_client.cmd("L@"+','.join(nodes_in_group), 'lowpkg.list_pkgs', expr_form='compound')
+    output = local_salt_client.cmd("L@"+','.join(nodes_in_group),
+                                   'lowpkg.list_pkgs',
+                                   expr_form='compound')
     # Let's exclude cid01 and dbs01 nodes from this check
     exclude_nodes = local_salt_client.cmd("I@galera:master or I@gerrit:client",
                                           'test.ping',
                                           expr_form='compound').keys()
-
-    if len(output.keys()) < 2:
+    total_nodes = [i for i in output.keys() if i not in exclude_nodes]
+    if len(total_nodes) < 2:
         pytest.skip("Nothing to compare - only 1 node")
 
     nodes = []
     pkts_data = []
     my_set = set()
 
-    for node in output:
-        if node in exclude_nodes:
-            continue
+    for node in total_nodes:
         nodes.append(node)
         my_set.update(output[node].keys())
 
@@ -44,19 +42,29 @@
 
 def test_check_module_versions(local_salt_client, nodes_in_group):
     pre_check = local_salt_client.cmd(
-        "L@"+','.join(nodes_in_group), 'cmd.run', ['dpkg -l | grep "python-pip "'], expr_form='compound')
+        "L@"+','.join(nodes_in_group),
+        'cmd.run',
+        ['dpkg -l | grep "python-pip "'],
+        expr_form='compound')
     if pre_check.values().count('') > 0:
         pytest.skip("pip is not installed on one or more nodes")
-    if len(pre_check.keys()) < 2:
+
+    exclude_nodes = local_salt_client.cmd("I@galera:master or I@gerrit:client",
+                                          'test.ping',
+                                          expr_form='compound').keys()
+    total_nodes = [i for i in pre_check.keys() if i not in exclude_nodes]
+
+    if len(total_nodes) < 2:
         pytest.skip("Nothing to compare - only 1 node")
-    output = local_salt_client.cmd("L@"+','.join(nodes_in_group), 'pip.freeze', expr_form='compound')
+    output = local_salt_client.cmd("L@"+','.join(nodes_in_group),
+                                   'pip.freeze', expr_form='compound')
 
     nodes = []
 
     pkts_data = []
     my_set = set()
 
-    for node in output:
+    for node in total_nodes:
         nodes.append(node)
         my_set.update([x.split("=")[0] for x in output[node]])
         output[node] = dict([x.split("==") for x in output[node]])
