blob: 36ca70e4a3e648456085e66fde734787997da2b6 [file] [log] [blame]
import json
import pytest
import os
import utils
def test_check_default_gateways(local_salt_client, nodes_in_group):
netstat_info = local_salt_client.cmd(
"L@"+','.join(nodes_in_group), 'cmd.run', ['ip r | sed -n 1p'], expr_form='compound')
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: {gw}".format(
gw=json.dumps(gateways, indent=4)
)