]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Update cli error list and retry function
authorAshish Pant <ashish12pant@gmail.com>
Wed, 16 Oct 2019 23:48:50 +0000 (05:18 +0530)
committerAshish Pant <ashish12pant@gmail.com>
Thu, 17 Oct 2019 03:47:03 +0000 (09:17 +0530)
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Add cli error returned for invalid bgp-community-list command

Fix retry function to avoid retries when expected is False

tests/topotests/lib/common_config.py

index 7e0a894c38938496cf7017becdf4d2247809b4df..38b97cba2d77b8486417c68d34994f0163f272d5 100644 (file)
@@ -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: