From: Ashish Pant Date: Wed, 16 Oct 2019 23:48:50 +0000 (+0530) Subject: tests: Update cli error list and retry function X-Git-Tag: base_7.3~240^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=6d32a6a18ad0c0e560a9c873a066059856f14467;p=matthieu%2Ffrr.git tests: Update cli error list and retry function Signed-off-by: Ashish Pant Add cli error returned for invalid bgp-community-list command Fix retry function to avoid retries when expected is False --- diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index 7e0a894c38..38b97cba2d 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -44,7 +44,7 @@ from lib.topotest import interface_set_status FRRCFG_FILE = "frr_json.conf" FRRCFG_BKUP_FILE = "frr_json_initial.conf" -ERROR_LIST = ["Malformed", "Failure", "Unknown"] +ERROR_LIST = ["Malformed", "Failure", "Unknown", "Incomplete"] ROUTER_LIST = [] #### @@ -709,9 +709,9 @@ def retry(attempts=3, wait=2, return_is_str=True, initial_wait=0): kwargs.pop('expected') ret = func(*args, **kwargs) logger.debug("Function returned %s" % ret) - if return_is_str and isinstance(ret, bool): + if return_is_str and isinstance(ret, bool) and _expected: return ret - elif return_is_str and _expected is False: + if isinstance(ret, str) and _expected is False: return ret if _attempts == i: