first commit!
diff --git a/cvp_checks/tests/test_default_gateway.py b/cvp_checks/tests/test_default_gateway.py
new file mode 100644
index 0000000..57a6d7b
--- /dev/null
+++ b/cvp_checks/tests/test_default_gateway.py
@@ -0,0 +1,29 @@
+import json
+import pytest
+
+from cvp_checks import utils
+
+
+@pytest.mark.parametrize(
+ "group",
+ utils.get_groups(utils.get_configuration(__file__))
+)
+def test_check_default_gateways(local_salt_client, group):
+ config = utils.get_configuration(__file__)
+ netstat_info = local_salt_client.cmd(
+ group, 'cmd.run', ['ip r | sed -n 1p'], expr_form='pcre')
+
+ gateways = {}
+ nodes = netstat_info.keys()
+
+ for node in nodes:
+ if netstat_info[node] not in gateways:
+ gateways[netstat_info[node]] = [node]
+ else:
+ gateways[netstat_info[node]].append(node)
+
+ assert len(gateways.keys()) == 1, \
+ "There were found few gateways within group {group}: {gw}".format(
+ group=group,
+ gw=json.dumps(gateways, indent=4)
+ )