def genie_sdk(self, steps, section, name, continue_=True, result_status=None, processor='', health_uids=None, health_groups=None, health_sections=None, **kwargs): if 'ret_dict' in kwargs: kwargs.pop('ret_dict') # This is to remove the uut dependency of genie standalone. # Since the device we are running the sdk on is in the # kwargs we just pass the first device found as the 'uut' uut = 'uut' for _, params in kwargs.items(): uut = params.get('devices', ['uut'])[0] break sdks = list(kwargs.keys()) run_genie_sdk(self, steps, sdks, uut=uut, parameters=kwargs) # steps.result will only change to result_status if it is passed. if result_status and steps.result.name == "passed": result_status_message = 'The genie_sdk result status is changed ' \ 'from passed to {}' \ ' based on the result_status'.format(result_status) log.warning('The genie_sdk result status is changed from passed to {}' \ ' based on the result_status'.format(result_status)) getattr(steps, result_status)(result_status_message)
def simple_test_1(self, steps): """ Sample test section. Only print """ log.info("First test section ") # Run genie triggers and verifications run_genie_sdk(self, steps, ['Verify_BgpVrfAllAll', 'TriggerSleep', 'TriggerShutNoShutBgp', 'TriggerSleep', 'Verify_BgpVrfAllAll'])
def genie_sdk(self, steps, continue_=True, **kwargs): # This is to remove the uut dependency of genie standalone. # Since the device we are running the sdk on is in the # kwargs we just pass the first device found as the 'uut' uut = 'uut' for _, params in kwargs.items(): uut = params.get('devices', ['uut'])[0] break sdks = list(kwargs.keys()) run_genie_sdk(self, steps, sdks, uut=uut, parameters=kwargs)
def prepare_testcase(self, steps, section): """ Testcase Setup section """ with steps.start('bla'): print('ww') log.info("Preparing the test") log.info(section) run_genie_sdk(self, steps, ['TriggerSleep', 'TriggerShutNoShutBgp', 'TriggerSleep']) run_genie_sdk(self, steps, ['Verify_BgpVrfAllAll', 'TriggerShutNoShutBgp', 'TriggerSleep', 'TriggerShutNoShutBgpNeighbors'])
def genie_sdk(self, steps, **kwargs): with steps.start('run_genie_sdk action', continue_=True): sdks = list(kwargs.keys()) run_genie_sdk(self, steps, sdks, parameters=kwargs) return None, steps.__result__
def simple_test_1(self, steps): """ Sample test section. Only print """ log.info("This verifies interfaces on all devices") # Run genie triggers and verifications run_genie_sdk(self, steps, ['Verify_IpInterface', 'Verify_IpInterfaceBrief'])