Add a few short snippets created for debugging
parent
a5f83863c9
commit
7f783cdbfa
@ -0,0 +1,7 @@
|
||||
Here are a few short scripts which I created for testing. They are not
|
||||
representative of any kind of use, but help testing/debugging that the happy
|
||||
path works at least a bit.
|
||||
|
||||
The `birdvisu` symlink is a quick hack, since the files were originally in the
|
||||
repository root and birdvisu had (has?) no packages created for it, so we need
|
||||
to be able to find the library somehow.
|
@ -0,0 +1 @@
|
||||
../birdvisu
|
@ -0,0 +1,13 @@
|
||||
from birdvisu import maps
|
||||
|
||||
with open('current.ospf') as actual:
|
||||
act_topo = maps.Topology.from_ospffile(actual)
|
||||
with open('reference.ospf') as reference:
|
||||
ref_topo = maps.Topology.from_ospffile(reference)
|
||||
|
||||
diff = maps.TopologyDifference(act_topo, ref_topo)
|
||||
diff.compare()
|
||||
|
||||
from pprint import pprint
|
||||
|
||||
pprint(vars(diff))
|
@ -0,0 +1,11 @@
|
||||
#!/bin/python3
|
||||
|
||||
from birdvisu import ospffile
|
||||
from pprint import pprint
|
||||
|
||||
with open('reference.ospf') as f:
|
||||
loaded = ospffile.load(f)
|
||||
|
||||
#pprint(loaded)
|
||||
|
||||
print(ospffile.dumps(loaded))
|
Loading…
Reference in New Issue