Skip to content

Commit b8300ae

Browse files
author
Patryk Szulczewski
committed
one more textFSM test
1 parent ce572ef commit b8300ae

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{"interface": "Lo0", "area": "0", "ip_address_mask": "172.16.0.11/32", "cost": "1", "state": "LOOP", "neighbors_fc": "0/0"},
3+
{"interface": "Se0/0/0.100", "area": "0", "ip_address_mask": "172.16.1.1/30", "cost": "50", "state": "DOWN", "neighbors_fc": "1/1"},
4+
{"interface": "Fa0/0", "area": "0", "ip_address_mask": "10.0.0.5/24", "cost": "1", "state": "DR", "neighbors_fc": "1/1"},
5+
{"interface": "Fa0/1", "area": "11", "ip_address_mask": "10.1.2.1/24", "cost": "1", "state": "DR", "neighbors_fc": "0/0"},
6+
{"interface": "Tu1610", "area": "0", "ip_address_mask": "0.0.0.0/0", "cost": "50", "state": "P2P", "neighbors_fc": "0/0"},
7+
{"interface": "Lo5", "area": "0", "ip_address_mask": "10.48.8.5/32", "cost": "1", "state": "LOOP", "neighbors_fc": "0/0"},
8+
{"interface": "Lo4", "area": "0", "ip_address_mask": "10.48.8.4/32", "cost": "1", "state": "LOOP", "neighbors_fc": "0/0"},
9+
{"interface": "Tu1603", "area": "0", "ip_address_mask": "0.0.0.0/0", "cost": "50", "state": "DOWN", "neighbors_fc": "0/0"},
10+
{"interface": "Tu1602", "area": "0", "ip_address_mask": "0.0.0.0/0", "cost": "50", "state": "P2P", "neighbors_fc": "0/0"},
11+
{"interface": "PO4/0", "area": "0", "ip_address_mask": "10.1.232.6/30", "cost": "6", "state": "P2P", "neighbors_fc": "1/1"},
12+
{"interface": "Se3/2:0", "area": "0", "ip_address_mask": "10.1.224.218/30", "cost": "6", "state": "P2P", "neighbors_fc": "1/1"},
13+
{"interface": "Se3/1:0", "area": "0", "ip_address_mask": "10.1.225.150/30", "cost": "6", "state": "P2P", "neighbors_fc": "1/1"}
14+
]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{"interface": "Lo0", "area": "0", "ip_address_mask": "172.16.0.11/32", "cost": "1", "state": "LOOP", "neighbors_fc": "0/0"},
3+
{"interface": "Se0/0/0.100", "area": "0", "ip_address_mask": "172.16.1.1/30", "cost": "50", "state": "P2P", "neighbors_fc": "1/1"},
4+
{"interface": "Fa0/0", "area": "0", "ip_address_mask": "10.0.0.5/24", "cost": "1", "state": "BDR", "neighbors_fc": "1/1"},
5+
{"interface": "Fa0/1", "area": "11", "ip_address_mask": "10.1.2.1/24", "cost": "1", "state": "DR", "neighbors_fc": "0/0"},
6+
{"interface": "Tu1610", "area": "0", "ip_address_mask": "0.0.0.0/0", "cost": "50", "state": "P2P", "neighbors_fc": "0/0"},
7+
{"interface": "Lo5", "area": "0", "ip_address_mask": "10.48.8.5/32", "cost": "1", "state": "LOOP", "neighbors_fc": "0/0"},
8+
{"interface": "Lo4", "area": "0", "ip_address_mask": "10.48.8.4/32", "cost": "1", "state": "LOOP", "neighbors_fc": "0/0"},
9+
{"interface": "Tu1603", "area": "0", "ip_address_mask": "0.0.0.0/0", "cost": "50", "state": "DOWN", "neighbors_fc": "0/0"},
10+
{"interface": "Tu1602", "area": "0", "ip_address_mask": "0.0.0.0/0", "cost": "50", "state": "P2P", "neighbors_fc": "0/0"},
11+
{"interface": "PO4/0", "area": "0", "ip_address_mask": "10.1.232.6/30", "cost": "6", "state": "P2P", "neighbors_fc": "1/1"},
12+
{"interface": "Se3/2:0", "area": "0", "ip_address_mask": "10.1.224.218/30", "cost": "6", "state": "P2P", "neighbors_fc": "1/1"},
13+
{"interface": "Se3/1:0", "area": "0", "ip_address_mask": "10.1.225.150/30", "cost": "6", "state": "P2P", "neighbors_fc": "1/1"}
14+
]

tests/test_diff_generator.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@
131131
},
132132
)
133133

134+
textfsm_ospf_int_br_exact_match = (
135+
"textfsm_ospf_int_br",
136+
"[*].[$interface$,area,ip_address_mask,cost,state,neighbors_fc]",
137+
[],
138+
{
139+
"Se0/0/0.100": {"state": {"new_value": "DOWN", "old_value": "P2P"}},
140+
"Fa0/0": {"state": {"new_value": "DR", "old_value": "BDR"}},
141+
},
142+
)
143+
134144
eval_tests = [
135145
exact_match_of_global_peers_via_napalm_getter,
136146
exact_match_of_bgp_peer_caps_via_api,
@@ -142,6 +152,7 @@
142152
exact_match_additional_item,
143153
exact_match_changed_item,
144154
exact_match_multi_nested_list,
155+
textfsm_ospf_int_br_exact_match,
145156
]
146157

147158

0 commit comments

Comments
 (0)