def verify_initial_state(self, uut, abstract, steps): '''Verify if the feature is enabled And Verify the configuration and device state is back to what it was at the begining of the trigger Args: uut (`obj`): Device object. steps (`step obj`): aetest step object Returns: None Raises: pyATS Results ''' try: CheckFeatureStatus.check_feature_status( device=uut, expect='enabled', feature_name=self.feature_name, abstract=abstract) except Exception as e: self.failed('{n} is not enabled'.format(n=self.feature_name), from_exception=e) try: self.post_snap = self.mapping.verify_with_initial(\ device=uut, abstract=abstract, steps=steps) except Exception as e: self.failed("Failed to restore", from_exception=e)
def verify_disable(self, uut, abstract): ''' Verify if the feature is disabled Args: uut (`obj`): Device object. abstract (`obj`): Abstract object. Returns: None Raises: Failed: The feature is not disabled as expected ''' # check if the feature is disabled # Not using Ops but parsers because two reason # 1) disable/enable feature and 'show feature' only support by NXOS # 2) 'show feature' is more accurate command to check the feature # status rather then Ops commands. try: CheckFeatureStatus.check_feature_status( device=uut, expect='disabled', feature_name=self.feature_name, abstract=abstract) except Exception as e: self.failed('{n} is not disabled'.format(n=self.feature_name), from_exception=e)