From a5897c41e4d5de626fcd93067929a4c93940ce51 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 6 Aug 2020 08:29:34 -0400 Subject: [PATCH 1/3] zebra: Fix off by one error in no vni command Commit: e2bcfa3946aadc62af53cf53ff8d2f9fe7e5bab1 Introduced a off by one error in the `no vni XXX` command: @@ -2337,12 +2336,10 @@ DEFUN (no_vrf_vni_mapping, "VNI-ID\n" "prefix-routes-only\n") { - int ret = 0; int filter = 0; - char err[ERR_STR_SZ]; - vni_t vni = strtoul(argv[2]->arg, NULL, 10); ZEBRA_DECLVAR_CONTEXT(vrf, zvrf); + vni_t vni = strtoul(argv[1]->arg, NULL, 10); assert(vrf); assert(zvrf); Fix it. Fixes: #6867 Signed-off-by: Donald Sharp --- zebra/zebra_vty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 2ea04eee2e..6390b30f5a 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -2434,7 +2434,7 @@ DEFUN (no_vrf_vni_mapping, int filter = 0; ZEBRA_DECLVAR_CONTEXT(vrf, zvrf); - vni_t vni = strtoul(argv[1]->arg, NULL, 10); + vni_t vni = strtoul(argv[2]->arg, NULL, 10); assert(vrf); assert(zvrf); From 2055cbee812368064d9e4698f33f0fe59402be2c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 30 Jul 2020 09:42:52 -0400 Subject: [PATCH 2/3] tests: Add some small clues to what dut is having the issue Add a bit of a clue to the test_evpn_type5_topo1.py script to what dut is failing, when things go south. Signed-off-by: Donald Sharp --- .../test_evpn_type5_topo1.py | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py b/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py index 3cdec760f7..8892d13eff 100755 --- a/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py +++ b/tests/topotests/evpn_type5_test_topo1/test_evpn_type5_topo1.py @@ -250,8 +250,8 @@ def prerequisite_config_for_test_suite(tgen): } result = configure_vxlan(tgen, vxlan_input) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step("Configure bridge interface") @@ -268,8 +268,8 @@ def prerequisite_config_for_test_suite(tgen): } } result = configure_brctl(tgen, topo, brctl_input) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step("Configure default routes") @@ -406,8 +406,8 @@ def test_RD_verification_manual_and_auto_p0(request): result = verify_attributes_for_evpn_routes( tgen, topo, dut, input_routes, rd="auto", rd_peer="e1" ) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step( @@ -437,8 +437,8 @@ def test_RD_verification_manual_and_auto_p0(request): result = verify_attributes_for_evpn_routes( tgen, topo, dut, input_routes, rd="50.50.50.50:50" ) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step( @@ -472,8 +472,8 @@ def test_RD_verification_manual_and_auto_p0(request): result = verify_attributes_for_evpn_routes( tgen, topo, dut, input_routes, rd="100.100.100.100:100" ) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step( @@ -672,8 +672,8 @@ def test_RT_verification_manual_p0(request): result = verify_attributes_for_evpn_routes( tgen, topo, dut, input_routes, rt="100:100" ) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step( @@ -711,8 +711,8 @@ def test_RT_verification_manual_p0(request): result = verify_attributes_for_evpn_routes( tgen, topo, dut, input_routes, rt=["100:100", "500:500"] ) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step( @@ -834,8 +834,8 @@ def test_RT_verification_manual_p0(request): result = verify_attributes_for_evpn_routes( tgen, topo, dut, input_routes, rt=["100:100", "500:500"] ) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step("Delete RT export value 100:100 for vrf RED on Edge-1") @@ -1277,14 +1277,14 @@ def test_evpn_routes_from_VNFs_p1(request): for dut in ["d1", "d2"]: input_routes = {key: topo["routers"][key] for key in ["r1"]} result = verify_evpn_routes(tgen, topo, dut, input_routes) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) input_routes = {key: topo["routers"][key] for key in ["r2"]} result = verify_evpn_routes(tgen, topo, dut, input_routes) - assert result is True, "Testcase {} :Failed \n Error: {}".format( - tc_name, result + assert result is True, "Testcase {} on {} :Failed \n Error: {}".format( + tc_name, dut, result ) step( @@ -1861,7 +1861,7 @@ def test_bgp_attributes_for_evpn_address_family_p1(request, attribute): temp[dut]["bgp"].append({"local_as": as_num, "delete": True}) result = create_router_bgp(tgen, topo, input_dict_2) - assert result is True, "Testcase {} :Failed \n Error: {}".format( + assert result is True, "Testcase {} on d1 :Failed \n Error: {}".format( tc_name, result ) From dbb0ba05aa3206e209b4b17b471fdc0b90412601 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 30 Jul 2020 09:43:42 -0400 Subject: [PATCH 3/3] tests: `no learning` is not accepted The vxlan `ip... ` command is failing because we are passing in `no learning` and that is failing. Signed-off-by: Donald Sharp --- tests/topotests/lib/common_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 156a5f7ea4..e4d72ea2d7 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -2281,7 +2281,7 @@ def configure_vxlan(tgen, input_dict): cmd = "{} local {}".format(cmd, local_addr) if learning == "no": - cmd = "{} {} learning".format(cmd, learning) + cmd = "{} nolearning".format(cmd) elif learning == "yes": cmd = "{} learning".format(cmd)