Skip to content

Commit e9d7ced

Browse files
committed
bgp: update BGP conformance tests
- Update existing conformance tests coming with changes made on implementation of route leak prevention. - Introduce new conformance topology (topo1-1) for BGP. Additional information can be found in holo-routing/holo-munet-topologies#7 Signed-off-by: Paul Wekesa <paul1tw1@gmail.com>
1 parent 9fb44a5 commit e9d7ced

26 files changed

Lines changed: 1594 additions & 444 deletions

File tree

holo-bgp/src/northbound/configuration.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,10 @@ impl Provider for Instance {
16281628
let nbr_trace_opts = &nbr.config.trace_opts;
16291629
let instance_trace_opts = &self.config.trace_opts;
16301630

1631-
let disabled = TraceOptionPacketType { tx: false, rx: false };
1631+
let disabled = TraceOptionPacketType {
1632+
tx: false,
1633+
rx: false,
1634+
};
16321635
let open = nbr_trace_opts
16331636
.packets
16341637
.open
@@ -1754,7 +1757,10 @@ impl Default for DistanceCfg {
17541757
let external = bgp::global::distance::external::DFLT;
17551758
let internal = bgp::global::distance::internal::DFLT;
17561759

1757-
DistanceCfg { external, internal }
1760+
DistanceCfg {
1761+
external,
1762+
internal,
1763+
}
17581764
}
17591765
}
17601766

@@ -1899,7 +1905,10 @@ impl Default for AsPathOptions {
18991905

19001906
impl Default for TraceOptionPacketResolved {
19011907
fn default() -> TraceOptionPacketResolved {
1902-
let disabled = TraceOptionPacketType { tx: false, rx: false };
1908+
let disabled = TraceOptionPacketType {
1909+
tx: false,
1910+
rx: false,
1911+
};
19031912
TraceOptionPacketResolved {
19041913
open: disabled,
19051914
update: disabled,
@@ -1915,6 +1924,9 @@ impl Default for TraceOptionPacketType {
19151924
let tx = bgp::global::trace_options::flag::send::DFLT;
19161925
let rx = bgp::global::trace_options::flag::receive::DFLT;
19171926

1918-
TraceOptionPacketType { tx, rx }
1927+
TraceOptionPacketType {
1928+
tx,
1929+
rx,
1930+
}
19191931
}
19201932
}

holo-bgp/src/northbound/yang.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ impl ToYang for AsPathSegmentType {
194194
impl ToYang for RouteOrigin {
195195
fn to_yang(&self) -> Cow<'static, str> {
196196
match self {
197-
RouteOrigin::Neighbor { remote_addr, .. } => remote_addr.to_string().into(),
197+
RouteOrigin::Neighbor {
198+
remote_addr, ..
199+
} => remote_addr.to_string().into(),
198200
RouteOrigin::Protocol(protocol) => protocol.to_yang(),
199201
}
200202
}

holo-bgp/tests/conformance/topologies/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,11 @@ async fn topology2_1() {
2222
run_test_topology::<Instance>("topo2-1", &rt_name).await;
2323
}
2424
}
25+
26+
#[tokio::test]
27+
async fn topology3_1() {
28+
for rt_num in 1..=6 {
29+
let rt_name = format!("rt{rt_num}");
30+
run_test_topology::<Instance>("topo2-1", &rt_name).await;
31+
}
32+
}

holo-bgp/tests/conformance/topologies/topo1-1/rt1/output/northbound-state.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@
203203
"attr-sets": {
204204
"attr-set": [
205205
{
206-
"index": "9414355416643581871",
206+
"index": "6200596107836267356",
207207
"attributes": {
208208
"origin": "incomplete"
209209
}
210210
},
211211
{
212-
"index": "2801120095642840682",
212+
"index": "15949557430493803600",
213213
"attributes": {
214214
"origin": "incomplete",
215215
"as-path": {
@@ -226,7 +226,7 @@
226226
}
227227
},
228228
{
229-
"index": "4544931297767258070",
229+
"index": "9697831912366637563",
230230
"attributes": {
231231
"origin": "incomplete",
232232
"as-path": {
@@ -243,7 +243,7 @@
243243
}
244244
},
245245
{
246-
"index": "119013827277143083",
246+
"index": "1428082829873600617",
247247
"attributes": {
248248
"origin": "incomplete",
249249
"as-path": {
@@ -274,25 +274,25 @@
274274
"prefix": "1.1.1.1/32",
275275
"origin": "ietf-routing:direct",
276276
"path-id": 0,
277-
"attr-index": "9414355416643581871"
277+
"attr-index": "6200596107836267356"
278278
},
279279
{
280280
"prefix": "2.2.2.2/32",
281281
"origin": "10.0.1.2",
282282
"path-id": 0,
283-
"attr-index": "4544931297767258070"
283+
"attr-index": "9697831912366637563"
284284
},
285285
{
286286
"prefix": "3.3.3.3/32",
287287
"origin": "10.0.2.3",
288288
"path-id": 0,
289-
"attr-index": "2801120095642840682"
289+
"attr-index": "15949557430493803600"
290290
},
291291
{
292292
"prefix": "4.4.4.4/32",
293293
"origin": "10.0.2.3",
294294
"path-id": 0,
295-
"attr-index": "2801120095642840682"
295+
"attr-index": "15949557430493803600"
296296
}
297297
]
298298
}
@@ -307,19 +307,19 @@
307307
{
308308
"prefix": "2.2.2.2/32",
309309
"path-id": 0,
310-
"attr-index": "4544931297767258070",
310+
"attr-index": "9697831912366637563",
311311
"eligible-route": true
312312
},
313313
{
314314
"prefix": "3.3.3.3/32",
315315
"path-id": 0,
316-
"attr-index": "119013827277143083",
316+
"attr-index": "1428082829873600617",
317317
"eligible-route": true
318318
},
319319
{
320320
"prefix": "4.4.4.4/32",
321321
"path-id": 0,
322-
"attr-index": "119013827277143083",
322+
"attr-index": "1428082829873600617",
323323
"eligible-route": true
324324
}
325325
]
@@ -331,20 +331,20 @@
331331
{
332332
"prefix": "2.2.2.2/32",
333333
"path-id": 0,
334-
"attr-index": "4544931297767258070",
334+
"attr-index": "9697831912366637563",
335335
"eligible-route": true
336336
},
337337
{
338338
"prefix": "3.3.3.3/32",
339339
"path-id": 0,
340-
"attr-index": "119013827277143083",
340+
"attr-index": "1428082829873600617",
341341
"eligible-route": true,
342342
"reject-reason": "iana-bgp-rib-types:as-path-longer"
343343
},
344344
{
345345
"prefix": "4.4.4.4/32",
346346
"path-id": 0,
347-
"attr-index": "119013827277143083",
347+
"attr-index": "1428082829873600617",
348348
"eligible-route": true,
349349
"reject-reason": "iana-bgp-rib-types:as-path-longer"
350350
}
@@ -357,19 +357,19 @@
357357
{
358358
"prefix": "1.1.1.1/32",
359359
"path-id": 0,
360-
"attr-index": "9414355416643581871",
360+
"attr-index": "6200596107836267356",
361361
"eligible-route": true
362362
},
363363
{
364364
"prefix": "3.3.3.3/32",
365365
"path-id": 0,
366-
"attr-index": "2801120095642840682",
366+
"attr-index": "15949557430493803600",
367367
"eligible-route": true
368368
},
369369
{
370370
"prefix": "4.4.4.4/32",
371371
"path-id": 0,
372-
"attr-index": "2801120095642840682",
372+
"attr-index": "15949557430493803600",
373373
"eligible-route": true
374374
}
375375
]
@@ -381,19 +381,19 @@
381381
{
382382
"prefix": "1.1.1.1/32",
383383
"path-id": 0,
384-
"attr-index": "9414355416643581871",
384+
"attr-index": "6200596107836267356",
385385
"eligible-route": true
386386
},
387387
{
388388
"prefix": "3.3.3.3/32",
389389
"path-id": 0,
390-
"attr-index": "2801120095642840682",
390+
"attr-index": "15949557430493803600",
391391
"eligible-route": true
392392
},
393393
{
394394
"prefix": "4.4.4.4/32",
395395
"path-id": 0,
396-
"attr-index": "2801120095642840682",
396+
"attr-index": "15949557430493803600",
397397
"eligible-route": true
398398
}
399399
]
@@ -408,13 +408,13 @@
408408
{
409409
"prefix": "3.3.3.3/32",
410410
"path-id": 0,
411-
"attr-index": "2801120095642840682",
411+
"attr-index": "15949557430493803600",
412412
"eligible-route": true
413413
},
414414
{
415415
"prefix": "4.4.4.4/32",
416416
"path-id": 0,
417-
"attr-index": "2801120095642840682",
417+
"attr-index": "15949557430493803600",
418418
"eligible-route": true
419419
}
420420
]
@@ -426,13 +426,13 @@
426426
{
427427
"prefix": "3.3.3.3/32",
428428
"path-id": 0,
429-
"attr-index": "2801120095642840682",
429+
"attr-index": "15949557430493803600",
430430
"eligible-route": true
431431
},
432432
{
433433
"prefix": "4.4.4.4/32",
434434
"path-id": 0,
435-
"attr-index": "2801120095642840682",
435+
"attr-index": "15949557430493803600",
436436
"eligible-route": true
437437
}
438438
]
@@ -444,13 +444,13 @@
444444
{
445445
"prefix": "1.1.1.1/32",
446446
"path-id": 0,
447-
"attr-index": "9414355416643581871",
447+
"attr-index": "6200596107836267356",
448448
"eligible-route": true
449449
},
450450
{
451451
"prefix": "2.2.2.2/32",
452452
"path-id": 0,
453-
"attr-index": "4544931297767258070",
453+
"attr-index": "9697831912366637563",
454454
"eligible-route": true
455455
}
456456
]
@@ -462,13 +462,13 @@
462462
{
463463
"prefix": "1.1.1.1/32",
464464
"path-id": 0,
465-
"attr-index": "9414355416643581871",
465+
"attr-index": "6200596107836267356",
466466
"eligible-route": true
467467
},
468468
{
469469
"prefix": "2.2.2.2/32",
470470
"path-id": 0,
471-
"attr-index": "4544931297767258070",
471+
"attr-index": "9697831912366637563",
472472
"eligible-route": true
473473
}
474474
]

0 commit comments

Comments
 (0)