MCPcopy Create free account
hub / github.com/FDio/vpp / test_replace

Method test_replace

test/test_ip6.py:3223–3347  ·  view source on GitHub ↗

IP Table Replace

(self)

Source from the content-addressed store, hash-verified

3221 i.unconfig_ip6()
3222
3223 def test_replace(self):
3224 """IP Table Replace"""
3225
3226 MRouteItfFlags = VppEnum.vl_api_mfib_itf_flags_t
3227 MRouteEntryFlags = VppEnum.vl_api_mfib_entry_flags_t
3228 N_ROUTES = 20
3229 links = [self.pg0, self.pg1, self.pg2, self.pg3]
3230 routes = [[], [], [], []]
3231
3232 # the sizes of 'empty' tables
3233 for t in self.tables:
3234 self.assertEqual(len(t.dump()), 2)
3235 self.assertEqual(len(t.mdump()), 5)
3236
3237 # load up the tables with some routes
3238 for ii, t in enumerate(self.tables):
3239 for jj in range(1, N_ROUTES):
3240 uni = VppIpRoute(
3241 self,
3242 "2001::%d" % jj if jj != 0 else "2001::",
3243 128,
3244 [
3245 VppRoutePath(
3246 links[ii].remote_hosts[0].ip6, links[ii].sw_if_index
3247 ),
3248 VppRoutePath(
3249 links[ii].remote_hosts[1].ip6, links[ii].sw_if_index
3250 ),
3251 ],
3252 table_id=t.table_id,
3253 ).add_vpp_config()
3254 multi = VppIpMRoute(
3255 self,
3256 "::",
3257 "ff:2001::%d" % jj,
3258 128,
3259 MRouteEntryFlags.MFIB_API_ENTRY_FLAG_NONE,
3260 [
3261 VppMRoutePath(
3262 self.pg0.sw_if_index,
3263 MRouteItfFlags.MFIB_API_ITF_FLAG_ACCEPT,
3264 proto=FibPathProto.FIB_PATH_NH_PROTO_IP6,
3265 ),
3266 VppMRoutePath(
3267 self.pg1.sw_if_index,
3268 MRouteItfFlags.MFIB_API_ITF_FLAG_FORWARD,
3269 proto=FibPathProto.FIB_PATH_NH_PROTO_IP6,
3270 ),
3271 VppMRoutePath(
3272 self.pg2.sw_if_index,
3273 MRouteItfFlags.MFIB_API_ITF_FLAG_FORWARD,
3274 proto=FibPathProto.FIB_PATH_NH_PROTO_IP6,
3275 ),
3276 VppMRoutePath(
3277 self.pg3.sw_if_index,
3278 MRouteItfFlags.MFIB_API_ITF_FLAG_FORWARD,
3279 proto=FibPathProto.FIB_PATH_NH_PROTO_IP6,
3280 ),

Callers

nothing calls this directly

Calls 13

VppIpRouteClass · 0.90
VppRoutePathClass · 0.90
VppIpMRouteClass · 0.90
VppMRoutePathClass · 0.90
find_route_in_dumpFunction · 0.90
find_mroute_in_dumpFunction · 0.90
mdumpMethod · 0.80
appendMethod · 0.80
replace_beginMethod · 0.80
replace_endMethod · 0.80
dumpMethod · 0.45
add_vpp_configMethod · 0.45

Tested by

no test coverage detected