From e44932cfa71cd58a3bc21b382c7248bd9d94ee66 Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Tue, 10 Sep 2024 15:10:26 +0200 Subject: [PATCH 1/3] tests: bgp_set_aspath_exclude check rule modif crash Check that the following does not cause a crash: > route-map r2 permit 6 > set as-path exclude 65555 > set as-path exclude as-path-access-list NON-EXISTING Signed-off-by: Louis Scalbert (cherry picked from commit f102fb7aef6cf7b8b8aa3c47e4514a1a130207ed) --- .../test_bgp_set_aspath_exclude.py | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py b/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py index 85e7b9676d0e..e8627bf5e11d 100644 --- a/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py +++ b/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py @@ -208,7 +208,26 @@ def test_no_bgp_set_aspath_exclude_access_list(): """ conf route-map r2 permit 6 - no set as-path exclude as-path-access-list SECOND + set as-path exclude 65555 + """ + ) + + r1.vtysh_cmd( + """ +clear bgp * + """ + ) + + test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_3) + _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + + assert result is None, "Failed to renegotiate with peers 2" + + r1.vtysh_cmd( + """ +conf + route-map r2 permit 6 + set as-path exclude as-path-access-list NON-EXISTING """ ) From 464e7fc5623523de6bb4f061f8814e31209640ca Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Tue, 10 Sep 2024 15:10:26 +0200 Subject: [PATCH 2/3] tests: bgp_set_aspath_exclude check rule modif No need to do 'no set as-path exclude' to replace the current rule by another. The code is supposed to support the replacement. Signed-off-by: Louis Scalbert (cherry picked from commit e9c4b33119b3a2313a42eff5e17e5716c7a7af88) --- .../bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py b/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py index e8627bf5e11d..972d312fcc34 100644 --- a/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py +++ b/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py @@ -128,7 +128,6 @@ def test_bgp_set_aspath_exclude_access_list(): conf bgp as-path access-list FIRST permit ^65 route-map r2 permit 6 - no set as-path exclude as-path-access-list SECOND set as-path exclude as-path-access-list FIRST """ ) @@ -147,7 +146,6 @@ def test_bgp_set_aspath_exclude_access_list(): """ conf route-map r2 permit 6 - no set as-path exclude as-path-access-list FIRST set as-path exclude as-path-access-list SECOND """ ) From df1504522da573216a519aca55d0d1c4c3b08c3b Mon Sep 17 00:00:00 2001 From: Louis Scalbert Date: Wed, 11 Sep 2024 18:02:52 +0200 Subject: [PATCH 3/3] tests: bgp_set_aspath_exclude extend timers Extend timers in bgp_set_aspath_exclude in case of high load on the CI. Signed-off-by: Louis Scalbert (cherry picked from commit 2328d171211e97a96d0b30dcdd1282f1eab215dd) --- .../test_bgp_set_aspath_exclude.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py b/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py index 972d312fcc34..903c917703c4 100644 --- a/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py +++ b/tests/topotests/bgp_set_aspath_exclude/test_bgp_set_aspath_exclude.py @@ -108,7 +108,7 @@ def test_bgp_set_aspath_exclude(): pytest.skip(tgen.errors) test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_1) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5) assert result is None, "Failed overriding incoming AS-PATH with route-map" @@ -139,7 +139,7 @@ def test_bgp_set_aspath_exclude_access_list(): ) test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_2) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5) assert result is None, "Failed change of exclude rule in route map" r1.vtysh_cmd( @@ -152,7 +152,7 @@ def test_bgp_set_aspath_exclude_access_list(): # tgen.mininet_cli() test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_1) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5) assert result is None, "Failed reverting exclude rule in route map" @@ -180,7 +180,7 @@ def test_no_bgp_set_aspath_exclude_access_list(): ) test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_3) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5) assert result is None, "Failed to removing current accesslist" @@ -198,7 +198,7 @@ def test_no_bgp_set_aspath_exclude_access_list(): ) test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_4) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5) assert result is None, "Failed to renegotiate with peers 2" @@ -217,7 +217,7 @@ def test_no_bgp_set_aspath_exclude_access_list(): ) test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_3) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5) assert result is None, "Failed to renegotiate with peers 2" @@ -236,7 +236,7 @@ def test_no_bgp_set_aspath_exclude_access_list(): ) test_func = functools.partial(bgp_converge, tgen.gears["r1"], expected_3) - _, result = topotest.run_and_expect(test_func, None, count=30, wait=0.5) + _, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5) assert result is None, "Failed to renegotiate with peers 2"