summaryrefslogtreecommitdiff
path: root/tests/inter.py
blob: 961aa831a6ea2fe10e494bece3e2d9d8b7200821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3

# TO USE this in interfactive mode :
# python3
# >>> from inter import eq
# >>> eq['172.16.20.210'].ifaces
# {'?': ('c0:4a:00:fe:1f:87', '?', [], '[ 0 mac_seen]')}

import context
from haircontrol import discovery, data #, inspectors

discovery = discovery.Discovery() #MockInspector('../test-data/input'))
discovery.discover_lldp_hinting(data.Equipment('stg2', '172.16.0.253'))
discovery.discover_static_hinting([
    ('SW_SergeGOUSSE', '172.16.30.23'),
    ('SW_PI_EGL', '172.16.30.27'),
    ('SW_Eglise_ESTANCARBON', '172.16.30.38'),
])
discovery.discover_from_root(data.Equipment('stg', '172.16.0.254'))
discovery.compute_neighbourhood()

eq = discovery.net.equipments