]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: add test for SRv6 End.DT46 behavior
authorCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Sat, 23 Jul 2022 16:21:24 +0000 (18:21 +0200)
committerCarmine Scarpitta <carmine.scarpitta@uniroma2.it>
Tue, 18 Oct 2022 14:08:23 +0000 (16:08 +0200)
This commit adds a new test case to the
test_zebra_seg6local_route topotest. The new test case performs two
operations:
* try to install a seg6local route with an End.DT46 action
* verify that the route is created correctly

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
tests/topotests/zebra_seg6local_route/r1/routes.json
tests/topotests/zebra_seg6local_route/r1/setup.sh
tests/topotests/zebra_seg6local_route/test_zebra_seg6local_route.py

index 4cb1c4ae13311ece15c929a4f9bf1a71152186a8..e39192256607f45859c22f5bc76bf0debe288ef1 100644 (file)
             "seg6local": { "action": "End.DX4" }
         }]
     }]
+  },
+  {
+    "in": {
+      "dest": "5::1",
+      "context": "End_DT46 10"
+    },
+    "out":[{
+        "prefix":"5::1/128",
+        "protocol":"sharp",
+        "selected":true,
+        "destSelected":true,
+        "distance":150,
+        "metric":0,
+        "installed":true,
+        "table":254,
+        "nexthops":[{
+            "flags":3,
+            "fib":true,
+            "active":true,
+            "directlyConnected":true,
+            "interfaceName": "dum0",
+            "seg6local": { "action": "End.DT46" }
+        }]
+    }],
+    "required_kernel": "5.14"
   }
 ]
index 691adb0a1966a87e422d7e7c3b12d92396e7951e..ec27ec95b8425fb10387c020df8fdb0f0cd5482d 100644 (file)
@@ -1,3 +1,6 @@
 ip link add dum0 type dummy
 ip link set dum0 up
+ip link add vrf10 type vrf table 10
+ip link set vrf10 up
 sysctl -w net.ipv6.conf.dum0.disable_ipv6=0
+sysctl -w net.vrf.strict_mode=1
index d9cca5cd93320f2a14150d3d29f8ea8fde197feb..66d3b6d9172d7be81e3080c19ed1d3531fd86f5d 100755 (executable)
@@ -38,6 +38,7 @@ sys.path.append(os.path.join(CWD, "../"))
 from lib import topotest
 from lib.topogen import Topogen, TopoRouter, get_topogen
 from lib.topolog import logger
+from lib.common_config import required_linux_kernel_version
 
 pytestmark = [pytest.mark.sharpd]
 
@@ -93,6 +94,15 @@ def test_zebra_seg6local_routes():
 
         logger.info("CHECK {} {}".format(dest, context))
 
+        if manifest.get("required_kernel") is not None:
+            if required_linux_kernel_version(manifest["required_kernel"]) is not True:
+                logger.info(
+                    "Kernel requirements are not met. Skipping {} {}".format(
+                        dest, context
+                    )
+                )
+                continue
+
         r1.vtysh_cmd(
             "sharp install seg6local-routes {} nexthop-seg6local dum0 {} 1".format(
                 dest, context