From 5b78215b28929f346c96d8748a1e3bdaf632dc34 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Thu, 19 Aug 2021 00:01:04 +0200 Subject: [PATCH] tests: Make bgp_multiview_topo1 predictable Signed-off-by: Martin Winter --- tests/topotests/bgp_multiview_topo1/peer1/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/peer2/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/peer3/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/peer4/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/peer5/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/peer6/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/peer7/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/peer8/exa-send.py | 2 +- tests/topotests/bgp_multiview_topo1/r1/bgpd.conf | 3 +++ .../bgp_multiview_topo1/r1/show_ip_bgp_view_1-post4.1.ref | 6 +++--- .../bgp_multiview_topo1/r1/show_ip_bgp_view_1-post6.1.ref | 6 +++--- .../topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1.ref | 6 +++--- .../bgp_multiview_topo1/r1/show_ip_bgp_view_2-post4.1.ref | 4 ++-- .../bgp_multiview_topo1/r1/show_ip_bgp_view_2-post6.1.ref | 4 ++-- .../topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2.ref | 4 ++-- .../bgp_multiview_topo1/r1/show_ip_bgp_view_3-post4.1.ref | 6 +++--- .../bgp_multiview_topo1/r1/show_ip_bgp_view_3-post6.1.ref | 6 +++--- .../topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3.ref | 6 +++--- 18 files changed, 35 insertions(+), 32 deletions(-) diff --git a/tests/topotests/bgp_multiview_topo1/peer1/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer1/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer1/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer1/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/peer2/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer2/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer2/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer2/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer3/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/peer4/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer4/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer4/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer4/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/peer5/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer5/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer5/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer5/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/peer6/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer6/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer6/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer6/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/peer7/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer7/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer7/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer7/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/peer8/exa-send.py b/tests/topotests/bgp_multiview_topo1/peer8/exa-send.py index 505b08d6aa..fbb73f5b6a 100755 --- a/tests/topotests/bgp_multiview_topo1/peer8/exa-send.py +++ b/tests/topotests/bgp_multiview_topo1/peer8/exa-send.py @@ -23,7 +23,7 @@ for i in range(0, numRoutes): stdout.flush() # Announce 1 overlapping route per peer -stdout.write("announce route 10.0.1.0/24 next-hop 172.16.1.%i\n" % peer) +stdout.write("announce route 10.0.1.0/24 med %i next-hop 172.16.1.%i\n" % (peer, peer)) stdout.flush() # Loop endlessly to allow ExaBGP to continue running diff --git a/tests/topotests/bgp_multiview_topo1/r1/bgpd.conf b/tests/topotests/bgp_multiview_topo1/r1/bgpd.conf index d44c3e18e6..cd7f44ac66 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/bgpd.conf +++ b/tests/topotests/bgp_multiview_topo1/r1/bgpd.conf @@ -13,6 +13,7 @@ log file bgpd.log ! router bgp 100 view 1 bgp router-id 172.30.1.1 + bgp always-compare-med no bgp ebgp-requires-policy network 172.20.0.0/28 route-map local1 timers bgp 60 180 @@ -25,6 +26,7 @@ router bgp 100 view 1 ! router bgp 100 view 2 bgp router-id 172.30.1.1 + bgp always-compare-med no bgp ebgp-requires-policy network 172.20.0.0/28 route-map local2 timers bgp 60 180 @@ -35,6 +37,7 @@ router bgp 100 view 2 ! router bgp 100 view 3 bgp router-id 172.30.1.1 + bgp always-compare-med no bgp ebgp-requires-policy network 172.20.0.0/28 timers bgp 60 180 diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post4.1.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post4.1.ref index 6b20e1df5a..d439e8c590 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post4.1.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post4.1.ref @@ -6,9 +6,9 @@ Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.5 0 65005 i -* 172.16.1.2 0 65002 i -*> 172.16.1.1 0 65001 i +* 10.0.1.0/24 172.16.1.5 5 0 65005 i +* 172.16.1.2 2 0 65002 i +*> 172.16.1.1 1 0 65001 i *> 10.101.0.0/24 172.16.1.1 100 0 65001 i *> 10.101.1.0/24 172.16.1.1 100 0 65001 i *> 10.101.2.0/24 172.16.1.1 100 0 65001 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post6.1.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post6.1.ref index 5469eaa1cc..bf89fff143 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post6.1.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1-post6.1.ref @@ -7,9 +7,9 @@ Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.5 0 65005 i -* 172.16.1.2 0 65002 i -*> 172.16.1.1 0 65001 i +* 10.0.1.0/24 172.16.1.5 5 0 65005 i +* 172.16.1.2 2 0 65002 i +*> 172.16.1.1 1 0 65001 i *> 10.101.0.0/24 172.16.1.1 100 0 65001 i *> 10.101.1.0/24 172.16.1.1 100 0 65001 i *> 10.101.2.0/24 172.16.1.1 100 0 65001 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1.ref index 6f1b1a1036..485efa21a1 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_1.ref @@ -4,9 +4,9 @@ Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.5 0 65005 i -* 172.16.1.2 0 65002 i -*> 172.16.1.1 0 65001 i +* 10.0.1.0/24 172.16.1.5 5 0 65005 i +* 172.16.1.2 2 0 65002 i +*> 172.16.1.1 1 0 65001 i *> 10.101.0.0/24 172.16.1.1 100 0 65001 i *> 10.101.1.0/24 172.16.1.1 100 0 65001 i *> 10.101.2.0/24 172.16.1.1 100 0 65001 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post4.1.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post4.1.ref index a64927c92d..e0d6101b22 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post4.1.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post4.1.ref @@ -6,8 +6,8 @@ Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.4 0 65004 i -*> 172.16.1.3 0 65003 i +* 10.0.1.0/24 172.16.1.4 4 0 65004 i +*> 172.16.1.3 3 0 65003 i *> 10.103.0.0/24 172.16.1.3 100 0 65003 i *> 10.103.1.0/24 172.16.1.3 100 0 65003 i *> 10.103.2.0/24 172.16.1.3 100 0 65003 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post6.1.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post6.1.ref index 8d4a843b84..7f51ee2128 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post6.1.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2-post6.1.ref @@ -7,8 +7,8 @@ Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.4 0 65004 i -*> 172.16.1.3 0 65003 i +* 10.0.1.0/24 172.16.1.4 4 0 65004 i +*> 172.16.1.3 3 0 65003 i *> 10.103.0.0/24 172.16.1.3 100 0 65003 i *> 10.103.1.0/24 172.16.1.3 100 0 65003 i *> 10.103.2.0/24 172.16.1.3 100 0 65003 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2.ref index 0230d25f53..4c594821c9 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_2.ref @@ -4,8 +4,8 @@ Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.4 0 65004 i -*> 172.16.1.3 0 65003 i +* 10.0.1.0/24 172.16.1.4 4 0 65004 i +*> 172.16.1.3 3 0 65003 i *> 10.103.0.0/24 172.16.1.3 100 0 65003 i *> 10.103.1.0/24 172.16.1.3 100 0 65003 i *> 10.103.2.0/24 172.16.1.3 100 0 65003 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post4.1.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post4.1.ref index a3b9ef0888..276ca8a72e 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post4.1.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post4.1.ref @@ -6,9 +6,9 @@ Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.8 0 65008 i -* 172.16.1.7 0 65007 i -*> 172.16.1.6 0 65006 i +* 10.0.1.0/24 172.16.1.8 8 0 65008 i +* 172.16.1.7 7 0 65007 i +*> 172.16.1.6 6 0 65006 i *> 10.106.0.0/24 172.16.1.6 100 0 65006 i *> 10.106.1.0/24 172.16.1.6 100 0 65006 i *> 10.106.2.0/24 172.16.1.6 100 0 65006 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post6.1.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post6.1.ref index 117e48847a..20dacf1d9a 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post6.1.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3-post6.1.ref @@ -7,9 +7,9 @@ Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.8 0 65008 i -* 172.16.1.7 0 65007 i -*> 172.16.1.6 0 65006 i +* 10.0.1.0/24 172.16.1.8 8 0 65008 i +* 172.16.1.7 7 0 65007 i +*> 172.16.1.6 6 0 65006 i *> 10.106.0.0/24 172.16.1.6 100 0 65006 i *> 10.106.1.0/24 172.16.1.6 100 0 65006 i *> 10.106.2.0/24 172.16.1.6 100 0 65006 i diff --git a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3.ref b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3.ref index b7e8c79d3c..006df96962 100644 --- a/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3.ref +++ b/tests/topotests/bgp_multiview_topo1/r1/show_ip_bgp_view_3.ref @@ -4,9 +4,9 @@ Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path -* 10.0.1.0/24 172.16.1.8 0 65008 i -* 172.16.1.7 0 65007 i -*> 172.16.1.6 0 65006 i +* 10.0.1.0/24 172.16.1.8 8 0 65008 i +* 172.16.1.7 7 0 65007 i +*> 172.16.1.6 6 0 65006 i *> 10.106.0.0/24 172.16.1.6 100 0 65006 i *> 10.106.1.0/24 172.16.1.6 100 0 65006 i *> 10.106.2.0/24 172.16.1.6 100 0 65006 i -- 2.39.5