diff --git a/tests/topotests/bgp_rpki_topo1/r1/rtrd.py b/tests/topotests/bgp_rpki_topo1/r1/rtrd.py index d34539a8f9..bca58a66ac 100755 --- a/tests/topotests/bgp_rpki_topo1/r1/rtrd.py +++ b/tests/topotests/bgp_rpki_topo1/r1/rtrd.py @@ -273,6 +273,9 @@ class RTRConnHandler(socketserver.BaseRequestHandler): def handle_error(self, buf: bytes): dbg(f">Error: {str(buf)}") + self.server.shutdown() + self.server.stopped = True + raise ConnectionError("Received an RPKI error packet from FRR. Exiting") def handle(self): while True: diff --git a/tests/topotests/bgp_rpki_topo1/test_bgp_rpki_topo1.py b/tests/topotests/bgp_rpki_topo1/test_bgp_rpki_topo1.py index e6b2c4c4f2..36bc0b7200 100644 --- a/tests/topotests/bgp_rpki_topo1/test_bgp_rpki_topo1.py +++ b/tests/topotests/bgp_rpki_topo1/test_bgp_rpki_topo1.py @@ -112,6 +112,11 @@ def test_show_bgp_rpki_prefixes(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) + for rname in ["r1", "r3"]: + logger.info("{}: checking if rtrd is running".format(rname)) + if rtrd_process.poll() is not None: + pytest.skip(tgen.errors) + rname = "r2" step("Check RPKI prefix table") @@ -149,6 +154,11 @@ def test_show_bgp_rpki_prefixes_no_rpki_cache(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) + for rname in ["r1", "r3"]: + logger.info("{}: checking if rtrd is running".format(rname)) + if rtrd_process.poll() is not None: + pytest.skip(tgen.errors) + def _show_rpki_no_connection(rname): output = json.loads( tgen.gears[rname].vtysh_cmd("show rpki cache-connection json") @@ -180,6 +190,11 @@ def test_show_bgp_rpki_prefixes_reconnect(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) + for rname in ["r1", "r3"]: + logger.info("{}: checking if rtrd is running".format(rname)) + if rtrd_process.poll() is not None: + pytest.skip(tgen.errors) + step("Restore RPKI server configuration") rname = "r2" @@ -224,6 +239,11 @@ def test_show_bgp_rpki_route_map(): if tgen.routers_have_failure(): pytest.skip(tgen.errors) + for rname in ["r1", "r3"]: + logger.info("{}: checking if rtrd is running".format(rname)) + if rtrd_process.poll() is not None: + pytest.skip(tgen.errors) + step("Apply RPKI valid route-map on neighbor") rname = "r2"