]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Add a route-map test to ensure it accepts an unknown intf name
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 4 Apr 2020 12:14:03 +0000 (08:14 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 8 Apr 2020 13:10:54 +0000 (09:10 -0400)
Add a test to route-amps to ensure that it accepts an unknown interface
name.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
tests/topotests/all-protocol-startup/r1/bgpd.conf
tests/topotests/all-protocol-startup/r1/ospf6d.conf
tests/topotests/all-protocol-startup/r1/ospfd.conf
tests/topotests/all-protocol-startup/r1/ripd.conf
tests/topotests/all-protocol-startup/r1/ripngd.conf
tests/topotests/all-protocol-startup/r1/show_route_map.ref [new file with mode: 0644]
tests/topotests/all-protocol-startup/r1/zebra.conf
tests/topotests/all-protocol-startup/test_all_protocol_startup.py

index 4614287f27f9fb4b53f98c4b8d4ab0b7441be744..34cbd086dd68419d1e2600bda2a573f483a86f8c 100644 (file)
@@ -45,3 +45,6 @@ route-map bgp-map permit 20
 line vty
 !
 
+route-map LIES deny 10
+  match interface notpresent
+!
\ No newline at end of file
index 941d3016c77aecac800e9356c3a7b7f320971299..5c6f071644e07e9a5f08020574c160d807592f3b 100644 (file)
@@ -14,3 +14,6 @@ router ospf6
 !
 line vty
 !
+route-map LIES deny 10
+ match interface notpresent
+!
index 549f36fab430efa412dce3f79456924da2ab511d..bac9f616205d18fb90724f525a83ad4338046a46 100644 (file)
@@ -11,3 +11,6 @@ router ospf
 !
 line vty
 !
+route-map LIES deny 10
+ match interface notpresent
+!
index 4b35630b3664b7b8cb63bbb6b8e72c0b65857d08..ace76088738a81b42997a28337d636c7e89fee28 100644 (file)
@@ -10,3 +10,6 @@ router rip
 line vty
 !
 
+route-map LIES deny 10
+ match interface notpresent
+!
index 199fe15ab9cd1c8573be5247d6b9cdb27174032c..2e0aef3a14574a4ee469814add9bffdbabfcdcec 100644 (file)
@@ -9,3 +9,6 @@ router ripng
 line vty
 !
 
+route-map LIES deny 10
+ match interface notpresent
+!
diff --git a/tests/topotests/all-protocol-startup/r1/show_route_map.ref b/tests/topotests/all-protocol-startup/r1/show_route_map.ref
new file mode 100644 (file)
index 0000000..2578608
--- /dev/null
@@ -0,0 +1,73 @@
+ZEBRA:
+route-map: LIES Invoked: 0 Optimization: enabled
+ deny, sequence 10 Invoked 0
+  Match clauses:
+    interface notpresent
+  Set clauses:
+  Call clause:
+  Action:
+    Exit routemap
+RIP:
+route-map: LIES Invoked: 0 Optimization: enabled
+ deny, sequence 10 Invoked 0
+  Match clauses:
+    interface notpresent
+  Set clauses:
+  Call clause:
+  Action:
+    Exit routemap
+RIPNG:
+route-map: LIES Invoked: 0 Optimization: enabled
+ deny, sequence 10 Invoked 0
+  Match clauses:
+    interface notpresent
+  Set clauses:
+  Call clause:
+  Action:
+    Exit routemap
+OSPF:
+route-map: LIES Invoked: 0 Optimization: enabled
+ deny, sequence 10 Invoked 0
+  Match clauses:
+    interface notpresent
+  Set clauses:
+  Call clause:
+  Action:
+    Exit routemap
+OSPF6:
+route-map: LIES Invoked: 0 Optimization: enabled
+ deny, sequence 10 Invoked 0
+  Match clauses:
+    interface notpresent
+  Set clauses:
+  Call clause:
+  Action:
+    Exit routemap
+BGP:
+route-map: LIES Invoked: 0 Optimization: enabled
+ deny, sequence 10 Invoked 0
+  Match clauses:
+    interface notpresent
+  Set clauses:
+  Call clause:
+  Action:
+    Exit routemap
+route-map: bgp-map Invoked: 0 Optimization: enabled
+ permit, sequence 10 Invoked 0
+  Match clauses:
+  Set clauses:
+    community 100:100 additive
+    local-preference 100
+  Call clause:
+  Action:
+    Exit routemap
+ permit, sequence 20 Invoked 0
+  Match clauses:
+  Set clauses:
+    metric 10
+    local-preference 200
+  Call clause:
+  Action:
+    Exit routemap
+ISIS:
+SHARP:
index fbf827604f2f1e43ff6e0d56324d0427e55cb1db..48799bf5dfb9361b2f0620b0fb0eefb21de53a04 100644 (file)
@@ -100,3 +100,6 @@ ipv6 forwarding
 line vty
 !
 
+route-map LIES deny 10
+  match interface notpresent
+!
index a671e14e07f02b3d1b2b41a5b2eeb2e6decf8808..5f23525a1b0e4e1c77adff681c814c1c0eeea56d 100755 (executable)
@@ -891,7 +891,38 @@ def test_bgp_ipv6():
     # For debugging after starting FRR/Quagga daemons, uncomment the next line
     # CLI(net)
 
+def test_route_map():
+    global fatal_error
+    global net
+
+    if (fatal_error != ""):
+        pytest.skip(fatal_error)
+
+    thisDir = os.path.dirname(os.path.realpath(__file__))
+
+    print("\n\n** Verifying some basic routemap forward references\n")
+    print("*******************************************************\n")
+    failures = 0
+    for i in range(1, 2):
+        refroutemap = '%s/r%s/show_route_map.ref' % (thisDir, i)
+        if os.path.isfile(refroutemap):
+            expected = open(refroutemap).read().rstrip()
+            expected = ('\n'.join(expected.splitlines()) + '\n').splitlines(1)
+
+            actual = net['r%s' %i].cmd('vtysh -c "show route-map" 2> /dev/null').rstrip()
+            actual = ('\n'.join(actual.splitlines()) + '\n').splitlines(1)
+
+            diff = topotest.get_textdiff(actual, expected,
+                                         title1="actual show route-map",
+                                         title2="expected show route-map")
+
+            if diff:
+                sys.stderr.write('r%s failed show route-map command Check:\n%s\n' % (i, diff))
+                failures += 1
+            else:
+                print("r%s ok" %i)
 
+            assert failures == 0, "Show route-map command failed for router r%s:\n%s" % (i, diff)
 
 def test_mpls_interfaces():
     global fatal_error