diff --git a/tests/common/devices/eos.py b/tests/common/devices/eos.py index 87f3588f5b7..8c985c6911a 100644 --- a/tests/common/devices/eos.py +++ b/tests/common/devices/eos.py @@ -5,6 +5,8 @@ import os from tests.common.devices.base import AnsibleHostBase +from tests.common.errors import RunAnsibleModuleFail +from retry import retry logger = logging.getLogger(__name__) @@ -81,6 +83,7 @@ def __str__(self): def __repr__(self): return self.__str__() + @retry(RunAnsibleModuleFail, tries=3, delay=5) def shutdown(self, interface_name): out = self.eos_config( lines=['shutdown'], @@ -92,6 +95,7 @@ def shutdown_multiple(self, interfaces): intf_str = ','.join(interfaces) return self.shutdown(intf_str) + @retry(RunAnsibleModuleFail, tries=3, delay=5) def no_shutdown(self, interface_name): out = self.eos_config( lines=['no shutdown'], @@ -222,11 +226,13 @@ def kill_bgpd(self): out = self.eos_config(lines=['agent {} shutdown'.format(agent)]) return out + @retry(RunAnsibleModuleFail, tries=3, delay=5) def start_bgpd(self): agent = 'Bgp' if self.is_multiagent() else 'Rib' out = self.eos_config(lines=['no agent {} shutdown'.format(agent)]) return out + @retry(RunAnsibleModuleFail, tries=3, delay=5) def no_shutdown_bgp(self, asn): out = self.eos_config( lines=['no shut'], @@ -234,6 +240,7 @@ def no_shutdown_bgp(self, asn): logging.info('No shut BGP [%s]' % asn) return out + @retry(RunAnsibleModuleFail, tries=3, delay=5) def no_shutdown_bgp_neighbors(self, asn, neighbors=[]): if not neighbors: return