fix tests for prometheus
@@ -214,6 +214,15 @@ def test_find_new_machines():
def test_Monitor_init():
monitor = Monitor(skip_rabbit=True)
+ hosts = [{'active': 0, 'record_source': 'poseidon', 'role': 'unknown', 'state': 'unknown', 'os': 'unknown', 'tenant': 'vlan1', 'port': 1, 'segment': 'switch1', 'ip': '123.123.123.123', 'mac': '00:00:00:00:00:00', 'hash': 'foo1', 'behavior': 1},
+ {'active': 1, 'record_source': 'poseidon', 'role': 'unknown', 'state': 'unknown', 'os': 'unknown', 'tenant': 'vlan1',
+ 'port': 1, 'segment': 'switch1', 'ip': '123.123.123.123', 'mac': '00:00:00:00:00:00', 'hash': 'foo2', 'behavior': 1},
+ {'active': 0, 'record_source': 'poseidon', 'role': 'unknown', 'state': 'unknown', 'os': 'unknown', 'tenant': 'vlan1',
+ 'port': 1, 'segment': 'switch1', 'ip': '123.123.123.123', 'mac': '00:00:00:00:00:00', 'hash': 'foo3', 'behavior': 1},
+ {'active': 1, 'record_source': 'poseidon1', 'role': 'unknown', 'state': 'unknown', 'os': 'unknown', 'tenant': 'vlan1',
+ 'port': 2, 'segment': 'switch1', 'ip': '2106::1', 'mac': '00:00:00:00:00:00', 'hash': 'foo4', 'behavior': 1},
+ {'active': 1, 'record_source': 'poseidon', 'role': 'unknown', 'state': 'unknown', 'os': 'unknown', 'tenant': 'vlan1', 'port': 1, 'segment': 'switch1', 'ip': '::', 'mac': '00:00:00:00:00:00', 'hash': 'foo5', 'behavior': 1}]
+ monitor.prom.update_metrics(hosts)
def test_process():
