]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: Test if IEEE floating-point encoding for bw works with older format 9469/head
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 31 Aug 2021 07:48:04 +0000 (10:48 +0300)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Tue, 31 Aug 2021 08:10:06 +0000 (11:10 +0300)
Just check if backward-compatibility works fine between uint32 / IEEE encodings.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
tests/topotests/bgp_link_bw_ip/r1/bgpd.conf
tests/topotests/bgp_link_bw_ip/r3/bgp-route-1.json [new file with mode: 0644]
tests/topotests/bgp_link_bw_ip/r3/bgpd.conf
tests/topotests/bgp_link_bw_ip/r6/bgpd.conf
tests/topotests/bgp_link_bw_ip/test_bgp_linkbw_ip.py

index 0e466871009543549e0a65d9c91f8df288de03ae..b1ec70d60b3d1652303c8c1bda3d93969197fbac 100644 (file)
@@ -8,4 +8,5 @@ router bgp 65101
  neighbor 11.1.1.2 timers 3 10
  neighbor 11.1.1.6 remote-as external
  neighbor 11.1.1.6 timers 3 10
+ neighbor 11.1.1.6 disable-link-bw-encoding-ieee
 !
diff --git a/tests/topotests/bgp_link_bw_ip/r3/bgp-route-1.json b/tests/topotests/bgp_link_bw_ip/r3/bgp-route-1.json
new file mode 100644 (file)
index 0000000..cddf127
--- /dev/null
@@ -0,0 +1,29 @@
+{
+  "prefix":"198.10.1.1/32",
+  "paths":[
+    {
+      "aspath":{
+        "string":"65303 65354",
+        "segments":[
+          {
+            "type":"as-sequence",
+            "list":[
+              65303,
+              65354
+            ]
+          }
+        ],
+        "length":2
+      },
+      "valid":true,
+      "extendedCommunity":{
+        "string":"LB:65303:125000 (1.000 Mbps)"
+      },
+      "nexthops":[
+        {
+          "ip":"11.1.3.2"
+        }
+      ]
+    }
+  ]
+}
index 3f20eb10a30ccb07a47a9709f18b020224afb3d6..cfd394936c570eb24bbb6b7f86af72d8040a3166 100644 (file)
@@ -8,4 +8,5 @@ router bgp 65202
  neighbor 11.1.1.5 timers 3 10
  neighbor 11.1.3.2 remote-as external
  neighbor 11.1.3.2 timers 3 10
+ neighbor 11.1.3.2 disable-link-bw-encoding-ieee
 !
index 18e7eb92850f04c58c9ba77a51b2f825a36a560d..89de8eeeb5c4006153cf9f46a92189696109946e 100644 (file)
@@ -14,6 +14,7 @@ router bgp 65303
  no bgp ebgp-requires-policy
  neighbor 11.1.3.1 remote-as external
  neighbor 11.1.3.1 timers 3 10
+ neighbor 11.1.3.1 disable-link-bw-encoding-ieee
  neighbor 11.1.6.2 remote-as external
  neighbor 11.1.6.2 timers 3 10
  !
index 3fcc3bec9a43d87640607c669ee4c25fc343a196..a9b4b6b03165487e39f432ebbb0af81d09acb12b 100644 (file)
@@ -270,6 +270,7 @@ def test_weighted_ecmp():
 
     r1 = tgen.gears["r1"]
     r2 = tgen.gears["r2"]
+    r3 = tgen.gears["r3"]
 
     # Configure anycast IP on additional server r9
     logger.info("Configure anycast IP on server r9")
@@ -304,6 +305,19 @@ def test_weighted_ecmp():
 
     tgen.net["r10"].cmd("ip addr add 198.10.1.1/32 dev r10-eth1")
 
+    # Check if bandwidth is properly encoded with non IEEE floatig-point (uint32) format on r3
+    logger.info(
+        "Check if bandwidth is properly encoded with non IEEE floatig-point (uint32) format on r3"
+    )
+    json_file = "{}/r3/bgp-route-1.json".format(CWD)
+    expected = json.loads(open(json_file).read())
+    test_func = partial(
+        topotest.router_json_cmp, r3, "show bgp ipv4 uni 198.10.1.1/32 json", expected
+    )
+    _, result = topotest.run_and_expect(test_func, None, count=200, wait=0.5)
+    assertmsg = "JSON output mismatch on r3"
+    assert result is None, assertmsg
+
     # Check multipath on super-spine router r1
     logger.info("Check multipath on super-spine router r1")
     json_file = "{}/r1/bgp-route-2.json".format(CWD)