Skip to content

Commit

Permalink
tests: adapt ospfapiclient test to new json output
Browse files Browse the repository at this point in the history
Following new json decoder for Opaque LSA, this patch adapts the ospfapiclient
test to the new json output.

Signed-off-by: Olivier Dugeon <[email protected]>
  • Loading branch information
odd22 committed Feb 12, 2024
1 parent 6fcc86d commit b46a1fe
Showing 1 changed file with 38 additions and 26 deletions.
64 changes: 38 additions & 26 deletions tests/topotests/ospfapi/test_ospf_clientapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def _test_add_data(tgen, apibin):
"linkStateId": "230.0.0.2",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "00000202",
"opaqueValues": {
"opaqueData": "00000202"
}
},
],
}
Expand Down Expand Up @@ -327,7 +329,9 @@ def _test_add_data(tgen, apibin):
"linkStateId": "231.0.0.1",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "00010101",
"opaqueValues": {
"opaqueData": "00010101",
}
},
],
}
Expand Down Expand Up @@ -376,7 +380,9 @@ def _test_add_data(tgen, apibin):
"linkStateId": "232.0.0.3",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "deadbeaf01234567",
"opaqueValues": {
"opaqueData": "deadbeaf01234567",
}
},
]
}
Expand Down Expand Up @@ -427,7 +433,9 @@ def _test_add_data(tgen, apibin):
"linkStateId": "232.0.0.3",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000002",
"opaqueData": "ebadf00d",
"opaqueValues": {
"opaqueData": "ebadf00d",
}
},
]
}
Expand Down Expand Up @@ -574,7 +582,7 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "76bf",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"linkStateId": "230.0.0.2",
Expand All @@ -583,7 +591,7 @@ def _test_opaque_add_del(tgen, apibin):
"checksum": "8aa2",
"length": 24,
"opaqueId": 2,
"opaqueDataLength": 4,
"opaqueLength": 4,
},
]
}
Expand All @@ -599,15 +607,15 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "5bd8",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"linkStateId": "231.0.0.2",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"checksum": "7690",
"length": 28,
"opaqueDataLength": 8,
"opaqueLength": 8,
},
],
},
Expand All @@ -621,15 +629,15 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "5ed5",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"linkStateId": "232.0.0.2",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"checksum": "d9bd",
"length": 24,
"opaqueDataLength": 4,
"opaqueLength": 4,
},
],
},
Expand Down Expand Up @@ -734,7 +742,7 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "76bf",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"linkStateId": "230.0.0.2",
Expand All @@ -744,7 +752,7 @@ def _test_opaque_add_del(tgen, apibin):
"checksum": "8aa2",
"length": 24,
"opaqueId": 2,
"opaqueDataLength": 4,
"opaqueLength": 4,
},
]
}
Expand All @@ -760,7 +768,7 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "5bd8",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"lsaAge": 3600,
Expand All @@ -770,7 +778,7 @@ def _test_opaque_add_del(tgen, apibin):
"checksum": "4fe2",
# data removed
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
],
},
Expand All @@ -785,15 +793,15 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "5ed5",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"linkStateId": "232.0.0.2",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"checksum": "d9bd",
"length": 24,
"opaqueDataLength": 4,
"opaqueLength": 4,
},
],
},
Expand Down Expand Up @@ -827,7 +835,7 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "76bf",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"linkStateId": "230.0.0.2",
Expand All @@ -837,7 +845,7 @@ def _test_opaque_add_del(tgen, apibin):
"checksum": "8aa2",
"length": 24,
"opaqueId": 2,
"opaqueDataLength": 4,
"opaqueLength": 4,
},
]
}
Expand All @@ -854,7 +862,7 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "5bd8",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"lsaAge": 3600,
Expand All @@ -864,7 +872,7 @@ def _test_opaque_add_del(tgen, apibin):
"checksum": "4fe2",
# data removed
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
],
},
Expand All @@ -879,7 +887,7 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "5ed5",
"length": 20,
"opaqueDataLength": 0,
"opaqueLength": 0,
},
{
"linkStateId": "232.0.0.2",
Expand All @@ -888,7 +896,7 @@ def _test_opaque_add_del(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "d9bd",
"length": 24,
"opaqueDataLength": 4,
"opaqueLength": 4,
},
],
},
Expand Down Expand Up @@ -1044,7 +1052,7 @@ def _test_opaque_add_restart_add(tgen, apibin):
"lsaSeqNumber": "80000001",
"checksum": "b07a",
"length": 28,
"opaqueDataLength": 8,
"opaqueLength": 8,
},
],
},
Expand Down Expand Up @@ -1100,7 +1108,7 @@ def _test_opaque_add_restart_add(tgen, apibin):
"lsaSeqNumber": "80000003",
"checksum": "cb27",
"length": 28,
"opaqueDataLength": 8,
"opaqueLength": 8,
},
],
},
Expand Down Expand Up @@ -1655,7 +1663,9 @@ def _test_opaque_link_local_lsa_crash(tgen, apibin):
"linkStateId": "230.0.0.1",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "feedaceedeadbeef",
"opaqueValues": {
"opaqueData": "feedaceedeadbeef",
}
},
],
}
Expand Down Expand Up @@ -1684,7 +1694,9 @@ def _test_opaque_link_local_lsa_crash(tgen, apibin):
"linkStateId": "230.0.0.1",
"advertisingRouter": "1.0.0.0",
"lsaSeqNumber": "80000001",
"opaqueData": "feedaceecafebeef",
"opaqueValues": {
"opaqueData": "feedaceecafebeef",
}
},
],
}
Expand Down

0 comments on commit b46a1fe

Please sign in to comment.