From 47f091766081f81853a2598cc87de6d360f9252e Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 14 Nov 2025 08:13:08 +0100 Subject: [PATCH] test: fix NETCONF backend to propagate RPC errors The put_config() retry loop was catching and printing RpcError exceptions but never re-raising them after exhausting retries. This caused tests to silently continue despite configuration failures, masking validation errors. Now properly propagates errors after all retries are exhausted, matching the error handling behavior of the RESTCONF backend. Fixes #1250 Signed-off-by: Joachim Wiberg --- test/infamy/netconf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/infamy/netconf.py b/test/infamy/netconf.py index 6fa08496..f2c7e092 100644 --- a/test/infamy/netconf.py +++ b/test/infamy/netconf.py @@ -297,14 +297,21 @@ class Device(Transport): xml = xml.replace(f"yang:operation=\"{src}\"", f"nc:operation=\"{dst}\"" if dst else "") + last_error = None for _ in range(0, 3): try: self.ncc.edit_config(xml, default_operation='merge') + last_error = None + break except RpcError as _e: + last_error = _e print(f"Failed sending edit-config RPC: {_e} Retrying ...") time.sleep(1) continue - break + + # If we exhausted all retries, raise the last error + if last_error is not None: + raise last_error def put_config_dicts(self, models): """PUT full configuration of all models to running-config"""