diff --git a/pkgs/clean-pkg/changelog/2023/november.rst b/pkgs/clean-pkg/changelog/2023/november.rst new file mode 100644 index 000000000..23bcb654c --- /dev/null +++ b/pkgs/clean-pkg/changelog/2023/november.rst @@ -0,0 +1,15 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* clean + * clean.py + * Updated import to get BaseCleaner from pyats.clean + +* iosxe + * Implemented image_override setting for copy_to_linux and copy_to_device clean stages + +* clean/stages/iosxe/stages.py + * Updated image mapping logic for Copytodevice stage + + diff --git a/pkgs/clean-pkg/sdk_generator/output/github_clean.json b/pkgs/clean-pkg/sdk_generator/output/github_clean.json index c5c12b959..af71d178c 100644 --- a/pkgs/clean-pkg/sdk_generator/output/github_clean.json +++ b/pkgs/clean-pkg/sdk_generator/output/github_clean.json @@ -98,7 +98,7 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/stages.py#L969" }, "uid": "ChangeBootVariable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L41" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L38" }, "nxos": { "doc": "This stage configures boot variables of the device using the following steps:\n\n - Delete existing boot variables.\n - Configure boot variables using the provided 'images'.\n - Write memory.\n - Verify the boot variables are as expected.\n\nStage Schema\n------------\nchange_boot_variable:\n\n images:\n\n kickstart (list, optional): The kickstart image file\n\n system (list): The system image file\n\n copy_vdc_all (bool, optional): If True copy onto all VDCs. Defaults to False.\n\n timeout (int, optional): Execute timeout in seconds. Defaults to 300.\n\n max_time (int, optional): Maximum time in seconds allowed for verifications.\n Defaults to 300.\n\n check_interval (int, optional): How often to check verifications in seconds.\n Defaults to 60.\n\n standby_copy_max_time (int, optional): Maximum time in seconds allowed for\n copying to standby RP. Defaults to 300.\n\n standby_copy_check_interval (int, optional): How often to check if the copy\n to the standby RP is complete. Defaults to 20.\n\n current_running_image (bool, optional): Set the boot variable to the currently\n running image from the show version command instead of the image provided.\n Defaults to False.\n\nExample\n-------\nchange_boot_variable:\n images:\n kickstart: bootflash:/kisckstart.gbin\n system: bootflash:/system.gbin\n copy_vdc_all: True\n timeout: 150\n max_time: 300\n check_interval: 20\n standby_copy_max_time: 100\n standby_copy_check_interval: 10\n", @@ -213,7 +213,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "CopyToDevice", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1359" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1356" } }, "CopyToLinux": { @@ -323,7 +323,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "InstallImage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L516" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L513" }, "iosxr": { "ncs540": { @@ -359,7 +359,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "InstallPackages", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L766" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L763" } }, "InstallRemoveInactive": { @@ -368,7 +368,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "InstallRemoveInactive", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L461" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L458" } }, "LoadPies": { @@ -431,7 +431,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "Reload", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L850" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L847" } }, "RevertVmSnapshot": { @@ -456,7 +456,7 @@ "module_name": "stages.stages", "package": "genie.libs.clean", "uid": "RommonBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1097" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L1094" } }, "RunConfigure": { @@ -521,7 +521,7 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/sdwan/stages.py#L395" }, "uid": "TftpBoot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L192" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py#L189" }, "iosxr": { "doc": "This stage boots a new image onto your device using the tftp booting\nmethod.\n\nStage Schema\n------------\ntftp_boot:\n\n image (list): Image to boot with\n\n ip_address (list): Management ip address to configure to reach to the\n tftp server\n\n subnet_mask (str): Management subnet mask\n\n gateway (str): Management gateway\n\n tftp_server (str): Tftp server that is reachable with management interface\n\n timeout (int, optional): Max time during which tftp boot must\n complete. Defaults to 600.\n\n config_reg_timeout (int, optional): Max time to set config-register.\n Defaults to 30.\n\n device_reload_sleep (int, optional): Time in seconds to wait after\n reloading the device. Defaults to 20.\n\n recovery_username (str, optional): Enable username for device\n required after bootup. Defaults to None.\n\n recovery_password (str, optional): Enable password for device\n required after bootup. Defaults to None.\n\nExample\n-------\ntftp_boot:\n image:\n - /auto/some-location/that-this/image/asr9k-mini-px.vm\n ip_address: [10.1.7.126, 10.1.7.127]\n gateway: 10.1.7.1\n subnet_mask: 255.255.255.0\n tftp_server: 11.1.7.251\n timeout: 1200\n config_reg_timeout: 60\n device_reload_sleep: 300\n recovery_username: admin\n recovery_password: nbv_12345\n\nNote: There is more than one ip address, one for each supervisor.\n", diff --git a/pkgs/clean-pkg/src/genie/libs/clean/__init__.py b/pkgs/clean-pkg/src/genie/libs/clean/__init__.py index ec6a5fdad..9c9bae4eb 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/__init__.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '23.10' +__version__ = '23.11' __author__ = 'Cisco Systems Inc.' __contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.' diff --git a/pkgs/clean-pkg/src/genie/libs/clean/clean.py b/pkgs/clean-pkg/src/genie/libs/clean/clean.py index 433254265..a98711765 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/clean.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/clean.py @@ -11,7 +11,7 @@ from pyats.aetest.container import TestContainer from pyats.log.utils import banner from pyats.aetest import processors -from pyats.kleenex.bases import BaseCleaner +from pyats.clean.bases import BaseCleaner from pyats.aetest.parameters import ParameterDict from pyats.aetest.sections import TestSection diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py index 1b3b31cef..05efa6621 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/image_handler.py @@ -187,20 +187,24 @@ def update_tftp_boot(self, number=''): def update_copy_to_linux(self, number=''): '''Update clean section 'copy_to_linux' with image information''' - files = self.device.clean.setdefault('copy_to_linux' + number, {}). \ - setdefault('origin', {}).setdefault('files', []) + origin = self.device.clean.setdefault('copy_to_linux' + number, {}). \ + setdefault('origin', {}) - files.clear() - files.extend(self.image + self.packages + self.other) + if self.override_stage_images: + origin.update({'files': self.image + self.packages + self.other}) + else: + origin.setdefault('files', self.image + self.packages + self.other) def update_copy_to_device(self, number=''): '''Update clean stage 'copy_to_device' with image information''' - files = self.device.clean.setdefault('copy_to_device' + number, {}). \ - setdefault('origin', {}).setdefault('files', []) + origin = self.device.clean.setdefault('copy_to_device' + number, {}). \ + setdefault('origin', {}) - files.clear() - files.extend(self.image + self.packages + self.other) + if self.override_stage_images: + origin.update({'files': self.image + self.packages + self.other}) + else: + origin.setdefault('files', self.image + self.packages + self.other) def update_change_boot_variable(self, number=''): '''Update clean stage 'change_boot_variable' with image information''' diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py index 91e4ff21c..7fb80b7a2 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py @@ -12,16 +12,13 @@ # pyATS from pyats.async_ import pcall from pyats.utils.fileutils import FileUtils -from pyats.utils.fileutils import FileUtils # Genie from genie.abstract import Lookup from genie.libs import clean from genie.libs.clean.recovery.recovery import _disconnect_reconnect -from genie.metaparser.util.schemaengine import Optional, Required, Any from genie.utils import Dq from genie.metaparser.util.schemaengine import Optional, Required, Any, Or, ListOf -from genie.utils import Dq from genie.utils.timeout import Timeout from genie.libs.clean import BaseStage from genie.libs.sdk.libs.abstracted_libs.iosxe.subsection import get_default_dir @@ -1641,18 +1638,21 @@ def copy_to_device(self, steps, device, origin, destination, except Exception as e: step.failed("Failed to verify the running image") + # To get the system image + dest_file_path = out.get("version", {}).get('system_image', "") + # if the device is in bundle mode and user passed install_image stage this step will not be executed. if "BUNDLE" in Dq(out).get_values("mode") and "install_image" in device.clean.order: step.skipped(f"The device is in bundle mode and install_image stage is passed in clean file. Skipping the verify running image check.") + elif 'packages.conf' in dest_file_path and any('change_boot_variable' in order_name for order_name in device.clean.order): + step.passed(f"The device is in install mode and change_boot_variable stage is passed in clean file. Continuing with the copy process.") else: - # To get the image version + # To handle the image mapping image_version = out.get("version", {}).get("xe_version", "") image_match = re.search(image_version, file) if image_match: - dest_file_path = out.get("version", {}).get('system_image', "") - if 'packages.conf' not in dest_file_path: - image_mapping = self.history['CopyToDevice'].parameters.setdefault('image_mapping', {}) - image_mapping.update({origin['files'][index]: dest_file_path}) + image_mapping = self.history['CopyToDevice'].parameters.setdefault('image_mapping', {}) + image_mapping.update({origin['files'][index]: dest_file_path}) self.skipped(f"The image file provided is same as the current running image {image_version} on the device.\n\ Setting the destination image to {dest_file_path}. Skipping the copy process.") diff --git a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py index c7129ddcf..20a6cbde4 100644 --- a/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py +++ b/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/tests/test_image_handler.py @@ -180,6 +180,12 @@ def setUp(self): 'install_packages': { 'packages': ['/path/to/my/package.bin'] }, + 'copy_to_linux': { + 'origin': {'files': ['/path/to/my/package.bin']} + }, + 'copy_to_device': { + 'origin': {'files': ['/path/to/my/image.bin']} + }, } images = ['/path/to/image.bin', '/path/to/package.bin'] @@ -222,6 +228,17 @@ def test_image_override_install_packages(self): self.image_handler.update_section('install_packages') self.assertEqual(self.image_handler.device.clean['install_packages'], {'packages': ['/path/to/package.bin']}) + def test_image_override_copy_to_linux(self): + self.image_handler.override_stage_images = True + self.image_handler.update_section('copy_to_linux') + self.assertEqual(self.image_handler.device.clean['copy_to_linux'], {'origin': {'files': ['/path/to/image.bin', '/path/to/package.bin']}}) + + def test_image_override_copy_to_device(self): + self.image_handler.override_stage_images = True + self.image_handler.update_section('copy_to_device') + self.assertEqual(self.image_handler.device.clean['copy_to_device'], {'origin': {'files': ['/path/to/image.bin', '/path/to/package.bin']}}) + + def test_image_no_override_tftp_boot(self): self.image_handler.override_stage_images = False @@ -259,5 +276,16 @@ def test_image_no_override_install_packages(self): self.image_handler.update_section('install_packages') self.assertEqual(self.image_handler.device.clean['install_packages'], {'packages': ['/path/to/my/package.bin']}) + def test_image_no_override_copy_to_linux(self): + self.image_handler.override_stage_images = False + self.image_handler.update_section('copy_to_linux') + self.assertEqual(self.image_handler.device.clean['copy_to_linux'], {'origin': {'files': ['/path/to/my/package.bin']}}) + + def test_image_no_override_copy_to_device(self): + self.image_handler.override_stage_images = False + self.image_handler.update_section('copy_to_device') + self.assertEqual(self.image_handler.device.clean['copy_to_device'], {'origin': {'files': ['/path/to/my/image.bin']}}) + + if __name__ == '__main__': unittest.main() diff --git a/pkgs/conf-pkg/changelog/2023/november.rst b/pkgs/conf-pkg/changelog/2023/november.rst new file mode 100644 index 000000000..c9c9f2a3a --- /dev/null +++ b/pkgs/conf-pkg/changelog/2023/november.rst @@ -0,0 +1,18 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* nxos + * Added macsec conf + * added macsec cli for conf model + + +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* nxos + * keychain + * fixed typo for crypto algorithm AES_256_CMAC + + diff --git a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py index 7f7a4c8c9..5e50089eb 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/__init__.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/__init__.py @@ -12,7 +12,7 @@ ''' # metadata -__version__ = '23.10' +__version__ = '23.11' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/conf-pkg/src/genie/libs/conf/keychains/keychains.py b/pkgs/conf-pkg/src/genie/libs/conf/keychains/keychains.py index ca7ec6d14..ff6619aba 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/keychains/keychains.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/keychains/keychains.py @@ -173,6 +173,12 @@ class CRYPTO_ALGO(Enum): default=None, type=(None, managedattribute.test_istype(int)), doc='Set key lifetime duration') + + local_timezone = managedattribute( + name='local_timezone', + default=None, + type=(None, managedattribute.test_istype(bool)), + doc='Specify time in local timezone or not') # ========================================================= # build_config diff --git a/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/keychains.py b/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/keychains.py index e61272f5a..b44610ba7 100644 --- a/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/keychains.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/keychains.py @@ -245,11 +245,37 @@ def build_config(self, 'crypto_algo').value == 'aes-128-cmac': key_string_str += ' cryptographic-algorithm AES_128_CMAC' elif attributes.value( - 'crypto_algo').value == 'aes-128-cmac': + 'crypto_algo').value == 'aes-256-cmac': key_string_str += ' cryptographic-algorithm AES_256_CMAC' configurations.append_line( attributes.format(key_string_str)) + + # key chain macsec + # key + # send-lifetime duration + # or + # send-lifetime infinite + # or + # send-lifetime local infinite + # or + # send-lifetime local duration + if attributes.value('lifetime_start'): + + if attributes.value('local_timezone'): + #send-lifetime local duration + lifetime_str = 'send-lifetime local {lifetime_start}' + else: + # send-lifetime duration + lifetime_str = 'send-lifetime {lifetime_start}' + + if attributes.value('lifetime_duration'): + lifetime_str += ' duration {lifetime_duration}' + else: + lifetime_str += ' infinite' + + configurations.append_line( + attributes.format(lifetime_str)) return str(configurations) @@ -344,7 +370,7 @@ def build_config(self, 'crypto_algo').value == 'aes-128-cmac': key_string_str += ' cryptographic-algorithm AES_128_CMAC' elif attributes.value( - 'crypto_algo').value == 'aes-128-cmac': + 'crypto_algo').value == 'aes-256-cmac': key_string_str += ' cryptographic-algorithm AES_256_CMAC' configurations.append_line( @@ -357,8 +383,12 @@ def build_config(self, 'lifetime_start') and attributes.value( 'lifetime_duration'): - # send-lifetime duration - lifetime_str = 'send-lifetime {lifetime_start} duration {lifetime_duration}' + if attributes.value('local_timezone'): + #send-lifetime local duration + lifetime_str = 'send-lifetime local {lifetime_start} duration {lifetime_duration}' + else: + # send-lifetime duration + lifetime_str = 'send-lifetime {lifetime_start} duration {lifetime_duration}' configurations.append_line( attributes.format(lifetime_str)) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/tests/test_keychains.py b/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/tests/test_keychains.py index b7a4a7f57..eb09156aa 100755 --- a/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/tests/test_keychains.py +++ b/pkgs/conf-pkg/src/genie/libs/conf/keychains/nxos/tests/test_keychains.py @@ -92,6 +92,10 @@ def test_ms_keychains_cfg(self): '2'].key_enc_type = 7 keychains.device_attr[dev1].ms_keychain_attr['1'].key_id_attr[ '2'].crypto_algo = 'aes-128-cmac' + keychains.device_attr[dev1].ms_keychain_attr['1'].key_id_attr[ + '2'].lifetime_start = '22:10:50 May 10 2023' + keychains.device_attr[dev1].ms_keychain_attr['1'].key_id_attr[ + '2'].lifetime_duration = 60 cfgs = keychains.build_config(apply=False) self.assertCountEqual(cfgs.keys(), [dev1.name]) @@ -100,6 +104,7 @@ def test_ms_keychains_cfg(self): str(cfgs[dev1.name]), '\n'.join([ 'key chain 1 macsec', ' key 2', ' key-octet-string 7 test cryptographic-algorithm AES_128_CMAC', + ' send-lifetime 22:10:50 May 10 2023 duration 60', ' exit', ' exit' ])) diff --git a/pkgs/conf-pkg/src/genie/libs/conf/macsec/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/macsec/__init__.py new file mode 100644 index 000000000..0eacc1964 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/macsec/__init__.py @@ -0,0 +1 @@ +from .macsec import * \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/macsec/macsec.py b/pkgs/conf-pkg/src/genie/libs/conf/macsec/macsec.py new file mode 100644 index 000000000..a7c0cebe0 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/macsec/macsec.py @@ -0,0 +1,232 @@ + +# Python +from enum import Enum + +# Genie +from genie.decorator import managedattribute +from genie.libs.conf.base import MAC +from genie.libs.conf.base.feature import consolidate_feature_args +from genie.conf.base.base import DeviceFeature, InterfaceFeature, LinkFeature +from genie.conf.base.attributes import DeviceSubAttributes, SubAttributesDict,\ + AttributesHelper, KeyedSubAttributes,\ + InterfaceSubAttributes + +__all__ = ( + 'Macsec', +) + +# Macsec +# +-- DeviceAttributes +# +-- MacsecPolicyAttributes +# +-- InterfaceAttributes + +class CHIPHER_SUITE(Enum): + gcm_aes_128 = 'GCM-AES-128' + gcm_aes_xpn_128 = 'GCM-AES-XPN-128' + gcm_aes_256 = 'GCM-AES-256' + gcm_aes_xpn_256 = 'GCM-AES-XPN-256' + +class CONF_OFFSET(Enum): + conf_offset_0 = 'CONF-OFFSET-0' + conf_offset_30 = 'CONF-OFFSET-30' + conf_offset_50 = 'CONF-OFFSET-50' + +class SECURITY_POLICY(Enum): + should_secure = 'should-secure' + must_secure = 'must-secure' + + +class Macsec(DeviceFeature, LinkFeature): + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + + # ========================================================================== + # CONF CLASS STRUCTURE + # ========================================================================== + + # +- DeviceAttributes + class DeviceAttributes(DeviceSubAttributes): + + # +- DeviceAttributes + # +- MacsecPolicyAttributes + class MacsecPolicyAttributes(KeyedSubAttributes): + def __init__(self, parent, key): + self.macsec_policy_name=key + super().__init__(parent) + + + macsec_policy_attr = managedattribute( + name='macsec_policy_attr', + read_only=True, + doc=MacsecPolicyAttributes.__doc__) + + @macsec_policy_attr.initter + def macsec_policy_attr(self): + return SubAttributesDict(self.MacsecPolicyAttributes, parent=self) + + # +- DeviceAttributes + # +- MacsecPolicyAttributes + # +- InterfaceAttributes + class InterfaceAttributes(KeyedSubAttributes): + def __init__(self, parent, key): + self.interface_name=key + super().__init__(parent) + + interface_attr = managedattribute( + name='interface_attr', + read_only=True, + doc=InterfaceAttributes.__doc__) + + @interface_attr.initter + def interface_attr(self): + return SubAttributesDict(self.InterfaceAttributes, parent=self) + + device_attr = managedattribute( + name='device_attr', + read_only=True, + doc=DeviceAttributes.__doc__) + + @device_attr.initter + def device_attr(self): + return SubAttributesDict(self.DeviceAttributes, parent=self) + + # ===========================================# + # managedattributes + # ===========================================# + # macsec feature enable attribute + enabled = managedattribute( + name='enabled', + default=None, + type=(None, managedattribute.test_istype(bool))) + + #macsec policy attributes + key_server_priority = managedattribute(name='key_server_priority', + default=None, + type=(None, managedattribute.test_istype(int)), + doc='Configure key server priority') + + cipher_suite = managedattribute(name='cipher_suite', + default=None, + type=(None, CHIPHER_SUITE), + doc='Set cipher suite algorithm') + + #can be single or multiple values possible, can't use Enum class as type. + enforce_cipher_suite = managedattribute(name='enforce', + default=False, + type=(None, managedattribute.test_istype(str)), + doc='Enable/disable enforce cipher-suite ') + + conf_offset = managedattribute(name='conf_offset', + default=None, + type=(None, CONF_OFFSET), + doc='Configure offset value') + + include_icv_indicator = managedattribute(name='include_icv_indicator', + default=None, + type=(None, managedattribute.test_istype(bool)), + doc='Enable/disable ICV') + + security_policy = managedattribute(name='security_policy', + default=None, + type=(None, SECURITY_POLICY), + doc='Configure security policy') + + window_size = managedattribute(name='window_size', + default=None, + type=(None, managedattribute.test_istype(int)), + doc='Configure replay protection window size') + + sak_expiry_time = managedattribute(name='sak_expiry_time', + default=None, + type=(None, managedattribute.test_istype(int)), + doc='Configure SAK expiry timer') + + include_sci = managedattribute(name='include_sci', + default=None, + type=(None, managedattribute.test_istype(bool)), + doc='Enable/disable include-sci') + + #macsec interface level attributes + key_chain = managedattribute(name='key_chain', + default=None, + type=(None, managedattribute.test_istype(str)), + doc='Configure key chain name') + + fallback_key_chain = managedattribute(name='fallback_key_chain', + default=None, + type=(None, managedattribute.test_istype(str)), + doc='Configure fallback key chain name') + + macsec_policy_name = managedattribute(name='macsec_policy_name', + default=None, + type=(None, managedattribute.test_istype(str)), + doc='Configure macsec policy name') + + eapol_mac_address = managedattribute(name='eapol_mac_address', + default=None, + type=(None, MAC), + doc='Configure eapol mac address') + eapol_broadcast_mac_address = managedattribute(name='eapol_broadcast_mac_address', + default=False, + type=(None, managedattribute.test_istype(bool)), + doc='Configure eapol broadcast mac address') + + ether_type = managedattribute(name='ether_type', + default=None, + type=(None, managedattribute.test_istype(str)), + doc='Configure ethernet type') + + interface_name = managedattribute(name='interface_name', + default=None, + type=(None, managedattribute.test_istype(str)), + doc='Interface name to apply config') + + # ========================================================= + # build_config + # ========================================================= + def build_config(self, + devices=None, + interfaces=None, + links=None, + apply=True, + attributes=None, + **kwargs): + attributes = AttributesHelper(self, attributes) + cfgs = {} + + devices, interfaces, links = \ + consolidate_feature_args(self, devices, interfaces, links) + + for key, sub, attributes2 in attributes.mapping_items('device_attr', + keys=devices, + sort=True): + cfgs[key] = sub.build_config(apply=False, attributes=attributes2) + if apply: + for device_name, cfg in sorted(cfgs.items()): + self.testbed.config_on_devices(cfg, fail_invalid=True) + else: + return cfgs + + def build_unconfig(self, + devices=None, + interfaces=None, + links=None, + apply=True, + attributes=None, + **kwargs): + attributes = AttributesHelper(self, attributes) + cfgs = {} + + devices, interfaces, links = \ + consolidate_feature_args(self, devices, interfaces, links) + for key, sub, attributes2 in attributes.mapping_items('device_attr', + keys=devices, + sort=True): + cfgs[key] = sub.build_unconfig(apply=False, attributes=attributes2) + + if apply: + for device_name, cfg in sorted(cfgs.items()): + self.testbed.config_on_devices(cfg, fail_invalid=True) + else: + return cfgs diff --git a/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/__init__.py b/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/__init__.py new file mode 100644 index 000000000..e5bf36e79 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/__init__.py @@ -0,0 +1,6 @@ +try: + from genie import abstract + abstract.declare_token(__name__) +except Exception as e: + import warnings + warnings.warn('Could not declare abstraction token: ' + str(e)) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/macsec.py b/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/macsec.py new file mode 100644 index 000000000..73624d3b9 --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/macsec.py @@ -0,0 +1,194 @@ +''' + Macsec Genie Conf Object Implementation for NXOS - CLI. +''' + +# Python +from abc import ABC + +#Genie +from genie.conf.base.attributes import AttributesHelper +from genie.conf.base.cli import CliConfigBuilder +from genie.conf.base.config import CliConfig + + +# Macsec +# +- DeviceAttributes +# +- MacsecPolicyAttributes +# +- InterfaceAttributes + +class Macsec(ABC): + class DeviceAttributes(ABC): + def build_config(self, apply=True, attributes=None, unconfig=False, + **kwargs): + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + #self.interface_config = CliConfigBuilder(unconfig=unconfig) + + # feature macsec + if attributes.value('enabled'): + if unconfig is False: + configurations.append_line( + attributes.format('feature macsec')) + + # Make sure that only enabled was provided in attributes + # If wildcard, then delete everything + elif unconfig is True and\ + attributes.attributes == {'enabled': {True: None}} or \ + attributes.iswildcard: + configurations.append_line('no feature macsec', raw=True) + if apply: + if configurations: + self.device.configure(configurations) + else: + return CliConfig(device=self.device, unconfig=unconfig, + cli_config=configurations) + + # +- DeviceAttributes + # +- MacsecPolicyAttributes + for sub, attributes2 in attributes.mapping_values('macsec_policy_attr', + sort=True, + keys=self.macsec_policy_attr): + configurations.append_block( + sub.build_config(apply=False, + attributes=attributes2, + unconfig=unconfig)) + + + # # Add InterfaceAttribute configuration + for sub, attributes2 in attributes.mapping_values('interface_attr', + sort=True, + keys=self.interface_attr): + configurations.append_block( + sub.build_config(apply=False, + attributes=attributes2, + unconfig=unconfig)) + if apply: + if configurations: + self.device.configure(configurations) + else: + return CliConfig(device=self.device, unconfig=unconfig, + cli_config=configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) + + # +- DeviceAttributes + # +- MacsecPolicyAttributes + class MacsecPolicyAttributes(ABC): + def build_config(self, apply=True, attributes=None, unconfig=False, **kwargs): + assert not apply + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + # macsec policy + with configurations.submode_context( + attributes.format('macsec policy {macsec_policy_name}', force=True)): + + if unconfig and attributes.iswildcard: + configurations.submode_unconfig() + + #macsec policy + # key-server-priority 30 + if attributes.value('key_server_priority'): + configurations.append_line(attributes.format('key-server-priority {key_server_priority}')) + + # macsec policy + # cipher-suite GCM-AES-128|GCM-AES-256|GCM-AES-XPN-128|GCM-AES-XPN-256 + if attributes.value('cipher_suite'): + cipher_suite = attributes.value('cipher_suite') + configurations.append_line(attributes.format('cipher-suite {cipher_suite.value}')) + + # cipher-suite enforce GCM-AES-128 GCM-AES-256 GCM-AES-XPN-128 GCM-AES-XPN-256 + if attributes.value('enforce_cipher_suite'): + enforce_cipher_suite = ' '.join(attributes.value('enforce_cipher_suite').split(',')) + configurations.append_line(attributes.format(f'cipher-suite enforce-peer {enforce_cipher_suite}')) + + #macsec policy + # conf-offset CONF-OFFSET-50|CONF-OFFSET-30|CONF-OFFSET-0 + if attributes.value('conf_offset'): + configurations.append_line(attributes.format('conf-offset {conf_offset.value}')) + + #macsec policy + # security-policy must-secure|should-secure + if attributes.value('security_policy'): + configurations.append_line(attributes.format('security-policy {security_policy.value}')) + + #macsec policy + # sak-expiry-time 60 + if attributes.value('sak_expiry_timer'): + configurations.append_line(attributes.format('sak-expiry-time {sak_expiry_timer}')) + + #macsec policy + # include-icv-indicator + if attributes.value('include_icv_indicator') is True: + configurations.append_line(attributes.format('include-icv-indicator')) + if attributes.value('include_icv_indicator') is False: + configurations.append_line(attributes.format('no include-icv-indicator')) + + #macsec policy + # include-sci + if attributes.value('include_sci') is True: + configurations.append_line(attributes.format('include-sci')) + if attributes.value('include_sci') is False: + configurations.append_line(attributes.format('no include-sci')) + + #macsec policy + # window-size 10000 + if attributes.value('window_size'): + configurations.append_line(attributes.format('window-size {window_size}')) + + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) + + class InterfaceAttributes(ABC): + def build_config(self, apply=True, attributes=None, unconfig=False, **kwargs): + assert not apply + assert not kwargs, kwargs + attributes = AttributesHelper(self, attributes) + configurations = CliConfigBuilder(unconfig=unconfig) + + # interface Ethernet1/1 + with configurations.submode_context( + attributes.format('interface {interface_name}', force=True)): + + # macsec keychain KC1 policy MP1 + if attributes.value('key_chain') and attributes.value('macsec_policy_name'): + if not attributes.value('fallback_key_chain'): + configurations.append_line(attributes.format('macsec keychain {key_chain} policy {macsec_policy_name}')) + else: + # macsec keychain KC1 policy MP1 fallback-keychain KC2 + configurations.append_line(attributes.format( + 'macsec keychain {key_chain} policy {macsec_policy_name} fallback-keychain {fallback_key_chain}' + )) + + if attributes.value('eapol_mac_address'): + #eapol mac-address
+ if not attributes.value('ether_type'): + configurations.append_line(attributes.format('eapol mac-address {eapol_mac_address} ')) + #eapol mac-address
ethertype 0x888ef + else: + configurations.append_line(attributes.format( + 'eapol mac-address {eapol_mac_address} ethertype 0x{ether_type}') + ) + + if attributes.value('eapol_broadcast_mac_address'): + #eapol mac-address broadcast-address + if not attributes.value('ether_type'): + configurations.append_line(attributes.format('eapol mac-address broadcast-address')) + #eapol mac-address broadcast-address ethertype 0x888ef + else: + configurations.append_line(attributes.format( + 'eapol mac-address broadcast-address ethertype 0x{ether_type}') + ) + + return str(configurations) + + def build_unconfig(self, apply=True, attributes=None, **kwargs): + return self.build_config(apply=apply, attributes=attributes, + unconfig=True, **kwargs) \ No newline at end of file diff --git a/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/test/test_macsec.py b/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/test/test_macsec.py new file mode 100644 index 000000000..b7fd342db --- /dev/null +++ b/pkgs/conf-pkg/src/genie/libs/conf/macsec/nxos/test/test_macsec.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python + +# import python +import unittest + +# import genie +from genie.tests.conf import TestCase +from genie.conf import Genie +from genie.conf.base import Testbed, Device, Interface + +# import genie.libs +from genie.libs.conf.macsec import Macsec + +class test_macsec(TestCase): + def test_macsec_cfg(self): + Genie.testbed = testbed = Testbed() + dev1 = Device(testbed=testbed, name='PE1', os='nxos') + + macsec = Macsec() + + self.assertIs(macsec.testbed, testbed) + dev1.add_feature(macsec) + + macsec.device_attr[dev1].macsec_policy_attr['MP1'].key_server_priority = 32 + macsec.device_attr[dev1].macsec_policy_attr['MP1'].cipher_suite = 'GCM-AES-128' + macsec.device_attr[dev1].macsec_policy_attr['MP1'].conf_offset = 'CONF-OFFSET-30' + macsec.device_attr[dev1].macsec_policy_attr['MP1'].security_policy = 'must-secure' + macsec.device_attr[dev1].macsec_policy_attr['MP1'].sak_expiry_timer = 70 + macsec.device_attr[dev1].macsec_policy_attr['MP1'].include_icv_indicator = True + macsec.device_attr[dev1].macsec_policy_attr['MP1'].include_sci = False + macsec.device_attr[dev1].macsec_policy_attr['MP1'].window_size = 100000 + + cfgs = macsec.build_config(apply=False) + self.assertCountEqual(cfgs.keys(), [dev1.name]) + self.maxDiff = None + + self.assertMultiLineEqual( + str(cfgs[dev1.name]), '\n'.join([ + 'macsec policy MP1', ' key-server-priority 32', ' cipher-suite GCM-AES-128', + ' conf-offset CONF-OFFSET-30', + ' security-policy must-secure', + ' sak-expiry-time 70', + ' include-icv-indicator', + ' no include-sci', + ' window-size 100000', + ' exit' + ])) + + un_cfgs = macsec.build_unconfig(apply=False) + self.assertCountEqual(un_cfgs.keys(), [dev1.name]) + self.maxDiff = None + self.assertEqual(str(un_cfgs[dev1.name]), + '\n'.join(['no macsec policy MP1'])) + + def test_macsec_cipher_enforce_cfg(self): + Genie.testbed = testbed = Testbed() + dev1 = Device(testbed=testbed, name='PE1', os='nxos') + + macsec = Macsec() + + self.assertIs(macsec.testbed, testbed) + dev1.add_feature(macsec) + macsec.device_attr[dev1].macsec_policy_attr['MP2'].enforce_cipher_suite = 'GCM-AES-256' + + cfgs = macsec.build_config(apply=False) + self.assertCountEqual(cfgs.keys(), [dev1.name]) + self.maxDiff = None + + self.assertMultiLineEqual( + str(cfgs[dev1.name]), '\n'.join([ + 'macsec policy MP2', ' cipher-suite enforce-peer GCM-AES-256', + ' exit' + ])) + + un_cfgs = macsec.build_unconfig(apply=False) + self.assertCountEqual(un_cfgs.keys(), [dev1.name]) + self.maxDiff = None + self.assertEqual(str(un_cfgs[dev1.name]), + '\n'.join(['no macsec policy MP2'])) + + + def test_macsec_interface_cfg(self): + Genie.testbed = testbed = Testbed() + dev1 = Device(testbed=testbed, name='PE1', os='nxos') + + macsec = Macsec() + + self.assertIs(macsec.testbed, testbed) + dev1.add_feature(macsec) + + macsec.device_attr[dev1].interface_attr['Eth1/1'].macsec_policy_name = 'MP1' + macsec.device_attr[dev1].interface_attr['Eth1/1'].key_chain = 'KC1' + macsec.device_attr[dev1].interface_attr['Eth1/1'].eapol_mac_address = '0001.0002.0003' + macsec.device_attr[dev1].interface_attr['Eth1/1'].ether_type = '888E' + + cfgs = macsec.build_config(apply=False) + self.assertCountEqual(cfgs.keys(), [dev1.name]) + self.maxDiff = None + + self.assertMultiLineEqual( + str(cfgs[dev1.name]), '\n'.join([ + 'interface Eth1/1', ' macsec keychain KC1 policy MP1', + ' eapol mac-address 0001.0002.0003 ethertype 0x888E', + ' exit' + ])) + + un_cfgs = macsec.build_unconfig(apply=False) + self.assertCountEqual(un_cfgs.keys(), [dev1.name]) + self.maxDiff = None + self.assertMultiLineEqual( + str(un_cfgs[dev1.name]), '\n'.join([ + 'interface Eth1/1', ' no macsec keychain KC1 policy MP1', + ' no eapol mac-address 0001.0002.0003 ethertype 0x888E', + ' exit' + ])) + +if __name__ == '__main__': + unittest.main() diff --git a/pkgs/filetransferutils-pkg/changelog/2023/november.rst b/pkgs/filetransferutils-pkg/changelog/2023/november.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py index c6a01cf31..459d3824e 100644 --- a/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py +++ b/pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/__init__.py @@ -9,7 +9,7 @@ ''' -__version__ = '23.10' +__version__ = '23.11' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/health-pkg/changelog/2023/november.rst b/pkgs/health-pkg/changelog/2023/november.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/health-pkg/src/genie/libs/health/__init__.py b/pkgs/health-pkg/src/genie/libs/health/__init__.py index f4b78b40b..9c8fc2782 100644 --- a/pkgs/health-pkg/src/genie/libs/health/__init__.py +++ b/pkgs/health-pkg/src/genie/libs/health/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '23.10' +__version__ = '23.11' __author__ = 'Cisco Systems Inc.' __contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.' diff --git a/pkgs/ops-pkg/changelog/2023/november.rst b/pkgs/ops-pkg/changelog/2023/november.rst new file mode 100644 index 000000000..4bbeab6d2 --- /dev/null +++ b/pkgs/ops-pkg/changelog/2023/november.rst @@ -0,0 +1,9 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* nxos + * platform + * fixed issue where new lc type without `ethernet` in the name would be incorrectly categorized as a `oc` slot type. + + diff --git a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py index fd1ed0c6e..a547e353e 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/__init__.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/__init__.py @@ -7,7 +7,7 @@ ''' # metadata -__version__ = '23.10' +__version__ = '23.11' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/platform.py b/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/platform.py index fe2dd613b..296ed6a7c 100644 --- a/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/platform.py +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/platform.py @@ -228,7 +228,11 @@ def learn(self): self.slot['rp'][str(slot_number)]['rp_kickstart_boot_image'] = self.rp_kickstart_boot_image except Exception: pass - self.slot['rp'][str(slot_number)]['rp_uptime'] = self.rp_uptime + try: + self.slot['rp'][str(slot_number) + ]['rp_uptime'] = self.rp_uptime + except Exception: + pass if 'lc' in self.slot: delete_dup_lc = [] @@ -247,8 +251,7 @@ def learn(self): if self.module['lc'][key][mod_name]['serial_number'] == serial: linecard_status = self.module['lc'][key][mod_name]['status'] self.slot['lc'][item].update({'state':linecard_status}) - if 'sup' not in self.slot['lc'][item]['name'].lower() and\ - 'ethernet' not in self.slot['lc'][item]['name'].lower(): + if not any(x in self.slot['lc'][item]['name'].lower() for x in ['sup', 'ethernet', 'eth']): self.slot.setdefault('oc',{}).setdefault(item, {}).update(self.slot['lc'][item]) self.slot['oc'][item].update({'state':linecard_status}) diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/tests/mando4_platform_output.py b/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/tests/mando4_platform_output.py new file mode 100644 index 000000000..d72bf31e9 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/tests/mando4_platform_output.py @@ -0,0 +1,544 @@ +class PlatformOutput(object): + showVersion = { + "platform": { + "hardware": { + "bootflash": "33429824 kB", + "chassis": "Nexus9000 C9804", + "cpu": "Intel(R) Xeon(R) CPU D-1530 @ 2.40GHz", + "device_name": "sanity140-eor1", + "memory": "32723048 kB", + "model": "Nexus9000 C9804", + "processor_board_id": "FOC2622N2SD", + "rp": "Supervisor Module", + "slots": "4", + }, + "kernel_uptime": {"days": 0, "hours": 12, "minutes": 17, "seconds": 8}, + "name": "Nexus", + "os": "NX-OS", + "reason": "Unknown", + "software": { + "bios_compile_time": "05/20/2023", + "bios_version": "01.11", + "system_compile_time": "11/30/2023 12:00:00 " "[10/12/2023 12:14:14]", + "system_image_file": "bootflash:///sanity.image", + "system_version": "10.4(2) [build " + "10.4(1)IMG9(0.166)] [Feature " + "Release]", + }, + "system_version": "10.4(2)", + } + } + + showInventory = { + "name": { + "Chassis": { + "description": "Nexus9000 C9804 (4 Slot) Chassis", + "pid": "N9K-C9804", + "serial_number": "FOX2639PNDS", + "slot": "None", + "vid": "V00", + }, + "Fan 1": { + "description": "Nexus9000 C9804 (4 Slot) Chassis Fan " "Module", + "pid": "N9K-C9804-FAN-A", + "serial_number": "FOC2641NZY2", + "slot": "None", + "vid": "V00", + }, + "Fan 2": { + "description": "Nexus9000 C9804 (4 Slot) Chassis Fan " "Module", + "pid": "N9K-C9804-FAN-A", + "serial_number": "FOC2641NZXW", + "slot": "None", + "vid": "V00", + }, + "Fan 3": { + "description": "Nexus9000 C9804 (4 Slot) Chassis Fan " "Module", + "pid": "N9K-C9804-FAN-A", + "serial_number": "FOC2641NZXL", + "slot": "None", + "vid": "V00", + }, + "Fan 4": { + "description": "Nexus9000 C9804 (4 Slot) Chassis Fan " "Module", + "pid": "N9K-C9804-FAN-A", + "serial_number": "FOC2641NZXQ", + "slot": "None", + "vid": "V00", + }, + "Power Supply 1": { + "description": "Nexus9000 C9804 (4 Slot) Chassis " "Power Supply", + "pid": "NXK-HV-6.3KW30A-A", + "serial_number": "DTM26350138", + "slot": "None", + "vid": "V01", + }, + "Power Supply 2": { + "description": "Nexus9000 C9804 (4 Slot) Chassis " "Power Supply", + "pid": "NXK-HV-6.3KW30A-A", + "serial_number": "DTM2635013E", + "slot": "None", + "vid": "V01", + }, + "Power Supply 3": { + "description": "Nexus9000 C9804 (4 Slot) Chassis " "Power Supply", + "pid": "NXK-HV-6.3KW30A-A", + "serial_number": "DTM26350134", + "slot": "None", + "vid": "V01", + }, + "Power Supply 4": { + "description": "Nexus9000 C9804 (4 Slot) Chassis " "Power Supply", + "pid": "NXK-HV-6.3KW30A-A", + "serial_number": "DTM26350132", + "slot": "None", + "vid": "V01", + }, + "Power Supply 5": { + "description": "Nexus9000 C9804 (4 Slot) Chassis " "Power Supply", + "pid": "NXK-HV-6.3KW30A-A", + "serial_number": "DTM2635012Z", + "slot": "None", + "vid": "V01", + }, + "Power Supply 6": { + "description": "Nexus9000 C9804 (4 Slot) Chassis " "Power Supply", + "pid": "NXK-HV-6.3KW30A-A", + "serial_number": "DTM2635014J", + "slot": "None", + "vid": "V01", + }, + "Slot 1": { + "description": "34x100G QSFP28 + 14x400G QSFP56-DD Eth " "Module", + "pid": "N9K-X98900CD-A", + "serial_number": "FOC2646NEQV", + "slot": "1", + "vid": "V00", + }, + "Slot 21": { + "description": "4-slot Fabric Module", + "pid": "N9K-C9804-FM-A", + "serial_number": "FOC2646NESC", + "slot": "21", + "vid": "V00", + }, + "Slot 24": { + "description": "4-slot Fabric Module", + "pid": "N9K-C9804-FM-A", + "serial_number": "FOC2646NERR", + "slot": "24", + "vid": "V00", + }, + "Slot 27": { + "description": "Supervisor Module", + "pid": "N9K-C9800-SUP-A", + "serial_number": "FOC2622N2SD", + "slot": "27", + "vid": "V01", + }, + "Slot 28": { + "description": "Supervisor Module", + "pid": "N9K-C9800-SUP-A", + "serial_number": "FOC2622N2SN", + "slot": "28", + "vid": "V01", + }, + "Slot 4": { + "description": "34x100G QSFP28 + 14x400G QSFP56-DD Eth " "Module", + "pid": "N9K-X98900CD-A", + "serial_number": "FOC2646NEQQ", + "slot": "4", + "vid": "V00", + }, + } + } + + showInstallActive = { + "active_packages": { + "active_package_module_0": { + "active_package_name": "app_hosting-1.0.0.0-10.4.2.lib32_64_n9000" + } + }, + "boot_images": {}, + } + + showRedundancyStatus = { + "redundancy_mode": {"administrative": "HA", "operational": "HA"}, + "supervisor_1": { + "internal_state": "Active with HA standby", + "redundancy_state": "Active", + "supervisor_state": "Active", + }, + "supervisor_2": { + "internal_state": "HA standby", + "redundancy_state": "Standby", + "supervisor_state": "HA standby", + }, + } + + showBoot = { + "current_boot_variable": { + "sup_number": { + "sup-1": {"system_variable": "bootflash:/sanity.image"}, + "sup-2": { + "boot_poap": "Disabled", + "system_variable": "bootflash:/sanity.image", + }, + } + }, + "next_reload_boot_variable": { + "sup_number": { + "sup-1": {"system_variable": "bootflash:/sanity.image"}, + "sup-2": { + "boot_poap": "Disabled", + "system_variable": "bootflash:/sanity.image", + }, + } + }, + } + + showModule = { + "slot": { + "lc": { + "1": { + "34x100G QSFP28 + 14x400G QSFP56-DD Eth Module": { + "hardware": "1.0", + "mac_address": "24-2a-04-9a-5e-00 " "to " "24-2a-04-9a-5e-ff", + "model": "N9K-X98900CD-A", + "online_diag_status": "Pass", + "ports": "48", + "serial_number": "FOC2646NEQV", + "slot": "1", + "slot/world_wide_name": "LC1", + "software": "10.4(1)IMG9(0.166)", + "status": "ok", + } + }, + "21": { + "4-slot Fabric Module": { + "hardware": "1.0", + "mac_address": "NA", + "model": "N9K-C9804-FM-A", + "online_diag_status": "Pass", + "ports": "0", + "serial_number": "FOC2646NESC", + "slot": "21", + "slot/world_wide_name": "FM3", + "software": "NA", + "status": "ok", + } + }, + "24": { + "4-slot Fabric Module": { + "hardware": "1.0", + "mac_address": "NA", + "model": "N9K-C9804-FM-A", + "online_diag_status": "Pass", + "ports": "0", + "serial_number": "FOC2646NERR", + "slot": "24", + "slot/world_wide_name": "FM6", + "software": "NA", + "status": "ok", + } + }, + "4": { + "34x100G QSFP28 + 14x400G QSFP56-DD Eth Module": { + "hardware": "1.0", + "mac_address": "24-2a-04-9a-68-00 " "to " "24-2a-04-9a-68-ff", + "model": "N9K-X98900CD-A", + "online_diag_status": "Pass", + "ports": "48", + "serial_number": "FOC2646NEQQ", + "slot": "4", + "slot/world_wide_name": "LC4", + "software": "10.4(1)IMG9(0.166)", + "status": "ok", + } + }, + }, + "rp": { + "27": { + "Supervisor Module": { + "hardware": "1.0", + "mac_address": "04-bd-97-31-cf-a8 " "to " "04-bd-97-31-cf-af", + "model": "N9K-C9800-SUP-A", + "online_diag_status": "Pass", + "ports": "0", + "serial_number": "FOC2622N2SD", + "slot": "27", + "slot/world_wide_name": "SUP1", + "software": "10.4(1)IMG9(0.166)", + "status": "active", + } + }, + "28": { + "Supervisor Module": { + "hardware": "1.0", + "mac_address": "04-bd-97-31-cf-b0 " "to " "04-bd-97-31-cf-b7", + "model": "N9K-C9800-SUP-A", + "online_diag_status": "Pass", + "ports": "0", + "serial_number": "FOC2622N2SN", + "slot": "28", + "slot/world_wide_name": "SUP2", + "software": "10.4(1)IMG9(0.166)", + "status": "ha-standby", + } + }, + }, + } + } + + directory = { + "files": { + ".patch/": {"size": "4096", "date": "Apr 20 2017", "time": "10:23:05"}, + "20170202_074746_poap_7537_init.log": { + "size": "1398", + "date": "Feb 02 2017", + "time": "00:48:18", + }, + "ethpm_act_logs.log": { + "size": "251599", + "date": "Mar 15 2017", + "time": "10:35:50", + }, + "ethpm_im_tech.log": { + "size": "1171318", + "date": "Mar 15 2017", + "time": "10:35:55", + }, + "ethpm_mts_details.log": { + "size": "3837", + "date": "Mar 15 2017", + "time": "10:35:50", + }, + "ethpm_syslogs.log": { + "size": "81257", + "date": "Mar 15 2017", + "time": "10:35:50", + }, + "ethpm_tech.log": { + "size": "3930383", + "date": "Mar 15 2017", + "time": "10:35:55", + }, + "fault-management-logs/": { + "size": "24576", + "date": "Apr 21 2017", + "time": "04:18:28", + }, + "lost+found/": {"size": "4096", "date": "Nov 23 2016", "time": "08:25:40"}, + "n7000-s2-debug-sh.10.81.0.125.gbin": { + "size": "4073830", + "date": "Apr 20 2017", + "time": "10:19:08", + }, + "virtual-instance-stby-sync/": { + "size": "4096", + "date": "Apr 20 2017", + "time": "10:28:55", + }, + }, + "dir": "bootflash:", + "disk_used_space": "108449792", + "disk_free_space": "1674481664", + "disk_total_space": "1782931456", + } + + showVdcDetail = { + "vdc": { + "1": { + "boot_order": "1", + "create_time": "Mon Oct 30 11:49:04 2023", + "dual_sup_ha_policy": "SWITCHOVER", + "ha_policy": "RELOAD", + "mac_address": "98:a2:c0:0d:fc:41", + "name": "sanity140-eor1", + "reload_count": "0", + "restart_count": "0", + "state": "active", + "supported_linecards": "None", + "type": "Ethernet", + } + } + } + + showVdcMembershipStatus = { + "virtual_device": { + "0": {"membership": {"Unallocated": {}}}, + "1": { + "membership": { + "sanity140-eor1": { + "Eth1/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/10": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/11": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/12": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/13": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/14": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/15": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/16": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/17": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/18": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/19": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/20": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/21": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/22": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/23": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/24": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/25": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/26": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/27(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/27/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/27/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/27/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/27/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/28": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/29": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/30": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/31": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/32": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/33(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/33/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/33/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/33/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/33/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/34": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/35": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/36": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/37": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/38": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/39": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/40": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/41": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/42": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/43": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/44": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/45(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/45/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/45/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/45/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/45/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/46": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/47": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/48": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/5": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/6": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/7": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/8": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth1/9": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/10": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/11": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/12(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/12/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/12/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/12/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/12/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/13": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/14": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/15": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/16": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/17": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/18": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/19": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/20": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/21(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/21/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/21/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/21/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/21/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/22": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/23": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/24": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/25(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/25/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/25/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/25/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/25/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/26": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/27(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/27/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/27/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/27/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/27/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/28": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/29": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/3(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/3/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/3/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/3/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/3/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/30": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/31": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/32": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/33": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/34": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/35": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/36": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/37": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/38": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/39": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/40": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/41": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/42": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/43": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/44": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/45": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/46": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/47": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/48": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/5": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/6": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/7": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/8": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/9(b)": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/9/1": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/9/2": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/9/3": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + "Eth4/9/4": {"vd_ms_status": "OK", "vd_ms_type": "Ethernet"}, + } + } + }, + } + } + + slot = { + "lc": { + "1": { + "name": "34x100G QSFP28 + 14x400G QSFP56-DD Eth Module", + "sn": "FOC2646NEQV", + "state": "ok", + }, + "4": { + "name": "34x100G QSFP28 + 14x400G QSFP56-DD Eth Module", + "sn": "FOC2646NEQQ", + "state": "ok", + }, + }, + "oc": { + "21": {"name": "4-slot Fabric Module", "sn": "FOC2646NESC", "state": "ok"}, + "24": {"name": "4-slot Fabric Module", "sn": "FOC2646NERR", "state": "ok"}, + }, + "rp": { + "27": { + "name": "N9K-C9800-SUP-A", + "redundancy_state": "active", + "rp_boot_image": "bootflash:/sanity.image", + "sn": "FOC2622N2SD", + "state": "active", + }, + "28": { + "name": "N9K-C9800-SUP-A", + "redundancy_state": "ha-standby", + "rp_boot_image": "bootflash:/sanity.image", + "sn": "FOC2622N2SN", + "state": "ha-standby", + }, + }, + } diff --git a/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/tests/test_platform_1.py b/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/tests/test_platform_1.py new file mode 100644 index 000000000..0ace111b7 --- /dev/null +++ b/pkgs/ops-pkg/src/genie/libs/ops/platform/nxos/tests/test_platform_1.py @@ -0,0 +1,64 @@ +# Python +import unittest + +# Ats +from pyats.topology import Device + +# Genie package +from genie.ops.base import Base +from genie.ops.base.maker import Maker + +# Genie Xbu_shared +from genie.libs.ops.platform.nxos.platform import Platform +from genie.libs.ops.platform.nxos.tests.mando4_platform_output import PlatformOutput +from genie.libs.parser.nxos.show_platform import ShowVersion, \ + ShowInventory, \ + ShowInstallActive, \ + ShowSystemRedundancyStatus, \ + ShowRedundancyStatus, \ + ShowBoot, \ + ShowModule, \ + Dir, \ + ShowVdcDetail, \ + ShowVdcCurrent, \ + ShowVdcMembershipStatus + + +class test_platform_all(unittest.TestCase): + + def setUp(self): + self.device = Device(name='aDevice') + self.device.os = 'nxos' + self.device.mapping = {} + self.device.mapping['cli'] = 'cli' + self.device.connectionmgr.connections['cli'] = '5' + + def test_sample(self): + + f = Platform(device=self.device) + + f.maker.outputs[ShowInventory] = \ + {'': PlatformOutput.showInventory} + f.maker.outputs[ShowModule] = \ + {'': PlatformOutput.showModule} + f.maker.outputs[ShowVdcDetail] = \ + {'': PlatformOutput.showVdcDetail} + f.maker.outputs[ShowVdcMembershipStatus] = \ + {'': PlatformOutput.showVdcMembershipStatus} + f.maker.outputs[Dir] = \ + {'': PlatformOutput.directory} + f.maker.outputs[ShowBoot] = \ + {'': PlatformOutput.showBoot} + f.maker.outputs[ShowVersion] = \ + {'': PlatformOutput.showVersion} + f.maker.outputs[ShowInstallActive] = \ + {'': PlatformOutput.showInstallActive} + f.maker.outputs[ShowRedundancyStatus] = \ + {'': PlatformOutput.showRedundancyStatus} + + f.learn() + self.assertEqual(f.slot, PlatformOutput.slot) + + +if __name__ == '__main__': + unittest.main() diff --git a/pkgs/robot-pkg/changelog/2023/november.rst b/pkgs/robot-pkg/changelog/2023/november.rst new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py index 3d1e88780..607daa599 100644 --- a/pkgs/robot-pkg/src/genie/libs/robot/__init__.py +++ b/pkgs/robot-pkg/src/genie/libs/robot/__init__.py @@ -8,7 +8,7 @@ ''' # metadata -__version__ = '23.10' +__version__ = '23.11' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.' diff --git a/pkgs/sdk-pkg/changelog/2023/november.rst b/pkgs/sdk-pkg/changelog/2023/november.rst new file mode 100644 index 000000000..c8c19a6b7 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/2023/november.rst @@ -0,0 +1,140 @@ +-------------------------------------------------------------------------------- + Add +-------------------------------------------------------------------------------- + +* linux + * Added API get_snmp_snmpwalk_version3 + * API added to 'snmpwalk -v {version} -u {username} {passprs} {passphrase} {var} {security_level} {security} {security_method}' + * Added API configure_pki_authenticate_certificate + * API added to configure_pki_authenticate_certificate(certificate={cert}, label_name={tp1_name}) + + +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- + +* iosxe + * Added unconfigure_interface_speed + * New API to unconfigure interface speed + * Added clear_ipv6_neighbors + * New API to clear ipv6 neighbors + * Added unconfigure_filter_vlan_list + * API for unconfigure filter vlan list + * Added configure_access_map_match_ip_mac_address + * API for configure access map match ip mac address + * Added configure_acl_protocol_port + * API for configure acl protocol port + * Added configure_ip_acl_with_any + * API for configure ip acl with any + * Added configure_shutdown_vlan_interface_range + * API to shut the vlan interface range {vlan_id_from}-{vlan_id_to} + * Added configure_no_shutdown_vlan_interface_range + * API to unshut the vlan interface range {vlan_id_from}-{vlan_id_to} + * Added execute_crypto_pki_server + * added api to execute crypto pki server + * Added execute_test_opssl_nonblockingsession_client + * added api to execute opssl nonblockingsession client + * Added execute_test_opssl_nonblockingsession_server_stop + * added api to execute opssl nonblockingsession server stop + * Added execute_test_opssl_nonblockingsession_server_start + * added api to execute opssl nonblockingsession server start + * Updated configure_pki_trustpoint + * Updated configure pki trustpoint + * Added configure_spanning_tree_mst_priority + * New API to configure spanning tree mst priority + * Added hw_module_sub_slot_reload + * added api to hw_module_sub_slot_reload + * Added configure_ospf_vrf_lite + * New API for configuring vrf-lite capabilty under OSPF {ospf_process_id} + * Added unconfigure_time_range + * API to unconfigure time-range + * Added configure_device_tracking_logging + * API to configure device tracking logging + * Added unconfigure_device_tracking_logging + * API to unconfigure device tracking logging + * Added configure_object_group + * API to configure object group + * Added configure_telemetry_ietf_parameters + * Added unconfigure_ip_dhcp_snooping_limit_rate + * API for unconfiguring dhcp snooping rate limit + * Added configure_ip_dhcp_snooping_verify_mac_address + * API for configuring dhcp snooping verify mac_address + * Added unconfigure_ip_dhcp_snooping_verify_mac_address + * API for unconfiguring dhcp snooping verify mac_address + * Added configure_dhcp_snooping_verify_no_relay_agent_address + * API for configuring dhcp snooping verify no_relay_agent_address + * Added unconfigure_dhcp_snooping_verify_no_relay_agent_address + * API for unconfiguting dhcp snooping verify no_relay_agent_address + * Added configure_dhcp_snooping_track_server_dhcp_acks + * API for configure dhcp snooping track server dhcp-acks + * Added unconfigure_dhcp_snooping_track_server_dhcp_acks + * API for unconfigure dhcp snooping track server dhcp-acks + * Added enable_cpp_system_default_on_device + * New API to enable cpp system-default on device + * Added enable_switchport_protected_on_interface + * New API to enable switchport protected on interface + * Added clear_ip_pim_rp_mapping + * New API to clear ip pim rp-mapping + * Added configure_event_manager + * API to configure event manager with applet name + * Added execute_event_manager_run_with_reload + * API to execute event manager with embeded applet name + * Added get_snmp_snmpwalk_sysname + * API to get snmp snmpwalk sysname description + +* added execute_clear_control_plane + * New API to execute clear control-plane all on device + + +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- + +* iosxe + * Modify configure_pki_export + * added return vlaue as self signed certificate + * Modify api configure_pki_enroll + * added the serial number in subject name as an argument + * Modified execute_reload_fast + * Modified the exeute_reload_fast API + * Modified execute_install_one_shot + * Modified the execute_install_one_shot API to upgrade the image using reloadfast + * Modified request_system_shell + * Fixed the dialog,added new statement to handle shell prompt. + * Modified platform exclude values for reload.py trigger + * Modified platform exclude values for switchover.py trigger + +* genie.libs.sdk + * Modified process_sequencial_operational_state to set sequence to False as we are no longer trimming reponses + +* blitz + * Fix to enclose list entries within square brackets when building GNMI request + * changed reference of "try_lock" function from yangexec to netconf_util. + * Modified configure_replace action + * added 'timeout' argument + * Modified restore_config_snapshot action + * added 'timeout' argument + * Modified save_config_snapshot action + * added 'timeout' argument + * Modified + * Netconf subscriptions were not tracked and did not account for multiple streams. + * Fixed negative test handling for netconf. + +* linux + * Modify kill_processes API + * added `sudo` argument + +* processor + * Modified check_memory_leaks processor for IOSXE + * added 'timeout' argument + +* abstracted_libs + * Modified restore_configuration function + * added 'timeout' argument + * Modified save_configuration function + * added 'timeout' argument + +* utils + * Modified copy_to_device/copy_from_device to support obtaining proxy device from servers section + + diff --git a/pkgs/sdk-pkg/changelog/changelog_add_iosxe_configure_scp_ssh_20231017.rst b/pkgs/sdk-pkg/changelog/changelog_add_iosxe_configure_scp_ssh_20231017.rst new file mode 100644 index 000000000..ff5d0eb76 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_add_iosxe_configure_scp_ssh_20231017.rst @@ -0,0 +1,13 @@ +-------------------------------------------------------------------------------- + New +-------------------------------------------------------------------------------- +* IOSXE + * Added configure_ip_scp_server_enable + * New API to configure ip scp server enable + * Added unconfigure_ip_scp_server_enable + * New API to unconfigure ip scp server enable + * Added configure_ip_ssh_source_interface + * New API to configure ip ssh source-interface + * Added unconfigure_ip_ssh_source_interface + * New API to unconfigure ip ssh source-interface + diff --git a/pkgs/sdk-pkg/changelog/changelog_fix_ut_request_system_shell_20231127104030.rst b/pkgs/sdk-pkg/changelog/changelog_fix_ut_request_system_shell_20231127104030.rst new file mode 100644 index 000000000..3ba451865 --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_fix_ut_request_system_shell_20231127104030.rst @@ -0,0 +1,6 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* sdk-pkg + * iosxe + * Fix UT in request_system_shell \ No newline at end of file diff --git a/pkgs/sdk-pkg/changelog/changelog_tahigash_fix_tgn_action_20231031093800.rst b/pkgs/sdk-pkg/changelog/changelog_tahigash_fix_tgn_action_20231031093800.rst new file mode 100644 index 000000000..73181935b --- /dev/null +++ b/pkgs/sdk-pkg/changelog/changelog_tahigash_fix_tgn_action_20231031093800.rst @@ -0,0 +1,5 @@ +-------------------------------------------------------------------------------- + Fix +-------------------------------------------------------------------------------- +* Blitz + * Fixed `tgn` action for Blitz \ No newline at end of file diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json index e6cd8c236..f2893e77e 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_apis.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_apis.json @@ -77,7 +77,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "arithmetic_operations", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3931" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3943" } }, "assign_default_ipv4_sgacl": { @@ -228,7 +228,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "change_pki_server_state", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L868" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L877" } }, "change_power_cycler_state": { @@ -395,11 +395,11 @@ }, "clear_controllers_ethernet_controller": { "iosxe": { - "doc": " API to clear controllers ethernet-controller\n Args:\n device ('obj'): Device object\n interface ('str', Optional): Interface name to clear controllers\n Returns:\n None\n Raises:\n SubCommandFailure\n ", - "module_name": "controllers.clear", + "doc": " clear controllers ethernet-controller\n Args:\n device ('obj'): device to execute on\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "clear_controllers_ethernet_controller", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/controllers/clear.py#L7" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/utils.py#L505" } }, "clear_counters": { @@ -534,7 +534,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_dlep_client", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1742" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1744" } }, "clear_dlep_neighbor": { @@ -543,7 +543,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_dlep_neighbor", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1764" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1766" } }, "clear_dmvpn": { @@ -804,7 +804,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "clear_ip_mfib_counters", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1502" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1540" } }, "clear_ip_mroute_all": { @@ -861,6 +861,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/utils.py#L44" } }, + "clear_ip_pim_rp_mapping": { + "iosxe": { + "doc": " clear ip pim rp-mapping\n Args:\n device (`obj`): Device object\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.execute", + "package": "genie.libs.sdk.apis", + "uid": "clear_ip_pim_rp_mapping", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1706" + } + }, "clear_ip_reflexive_list": { "iosxe": { "doc": " #clear ip reflexive-list ?\n * Delete all reflexive ACLs\n WORD Delete a specific reflexive ACL\n Args:\n device (`obj`): Device object\n option ('str'): Which data to clear. By Default will clear all reflexive-list. \n For WORD need to pass reflexive-list name(eg:REF1) to delete particular reflexive-list.\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -924,6 +933,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py#L36" } }, + "clear_ipv6_neighbors": { + "iosxe": { + "doc": "\n clear ipv6 neighbors\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubcommandFailure: Failed executing command\n ", + "module_name": "ipv6.clear", + "package": "genie.libs.sdk.apis", + "uid": "clear_ipv6_neighbors", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py#L103" + } + }, "clear_ipv6_nhrp": { "iosxe": { "doc": " clear_ipv6_nhrp\n Args:\n device (`obj`): Device object\n counters('boolean', optional): NHRP Counters, default is False\n shortcut('boolean', optional): NHRP shortcut entries, default is False\n stats('boolean', optional): Clears all IPv6 Stats Information for all Interfaces, default is False\n vrf('str', optional) : VRF name, default is None\n timeout('int', optional): timeout for exec command execution, default is 30\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -1020,7 +1038,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_lne_ftpse_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1783" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1785" } }, "clear_logging": { @@ -1239,7 +1257,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_pdm_steering_policy", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1839" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1841" } }, "clear_platform_qos_dscp_cos_counters_interface": { @@ -1284,7 +1302,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_ppp_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1800" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1802" } }, "clear_pppoe_all": { @@ -1293,7 +1311,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "clear_pppoe_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1820" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1822" } }, "compare_archive_config_dicts": { @@ -1329,7 +1347,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "compared_with_running_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1532" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1544" } }, "concurrent_ssh_sessions": { @@ -2002,7 +2020,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "config_smart_authorisation_request", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1409" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1447" } }, "config_smart_save_license_usage": { @@ -2011,7 +2029,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "config_smart_save_license_usage", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1389" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1427" } }, "config_speed_nonego_on_interface": { @@ -2338,6 +2356,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L1532" } }, + "configure_access_map_match_ip_mac_address": { + "iosxe": { + "doc": " Configuring access map match ip mac address\n\n Args:\n device ('obj'): device to use\n vlan_access_name ('str'): name of vlan to access \n vlaue ('str'): describe mac (or) ip\n acl_name ('str'): name of acl_name\n action ('str'): forward (or) drop\n Returns:\n None\n\n Raises: \n SubCommandFailure\n ", + "module_name": "acl.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_access_map_match_ip_mac_address", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2038" + } + }, "configure_access_session_acl_default_passthrough": { "iosxe": { "doc": " Configure access-session acl deafult passthrough\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raise:\n SubCommandFailure: Failed to configure access-session acl default passthrough on device\n ", @@ -2446,6 +2473,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L250" } }, + "configure_acl_protocol_port": { + "iosxe": { + "doc": " Configure acl protocol port\n\n Args:\n device ('obj'): device to use\n ip_protocol_version ('str'): define ip (or) ipv6\n acl_name ('str'): name of acl\n acl_action ('str'): permit (or) deny\n protocol ('str'): protocol details\n port_operation ('str'): name of port operation ex: range , eq, gt, lt\n src_port (int): src port details\n dst_port (int): dst port details\n Returns:\n None\n\n Raises: \n SubCommandFailure\n ", + "module_name": "acl.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_acl_protocol_port", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2063" + } + }, "configure_acl_with_ip_any": { "iosxe": { "doc": " configure ACL\n Args:\n device (`obj`): Device object\n acl_name ('str'): ACL name\n action ('str')Optional: Permit or Deny\n ", @@ -4088,7 +4124,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_cts_manual", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L919" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L922" } }, "configure_cts_role_based_monitor": { @@ -4223,7 +4259,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_default_vtp_version", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1046" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1045" } }, "configure_default_vxlan": { @@ -4334,6 +4370,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L1837" } }, + "configure_device_tracking_logging": { + "iosxe": { + "doc": "Configure device tracking logging\n Args:\n device (obj): Device object.\n logging_type (str): Type of logging to configure ex:'packet','theft',or'resolution-veto' (default is 'drop')\n Returns:\n None\n Raises:\n SubCommandFailure\n ValueError: If an invalid logging_type is provided.\n ", + "module_name": "device_tracking.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_device_tracking_logging", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py#L143" + } + }, "configure_device_tracking_on_interface": { "iosxe": { "doc": " Configure device-tracking on interface\n Args:\n device ('obj'): device object\n interface ('str'): interface name\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configure device-tracking on interface\n ", @@ -4376,7 +4421,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_dhcp_channel_group_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L863" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L866" } }, "configure_dhcp_pool": { @@ -4385,7 +4430,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_dhcp_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1231" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1234" } }, "configure_dhcp_pool_dns_server": { @@ -4412,7 +4457,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_dhcp_relay_information", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L585" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L588" } }, "configure_dhcp_relay_short_lease": { @@ -4421,7 +4466,25 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_dhcp_relay_short_lease", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L673" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L676" + } + }, + "configure_dhcp_snooping_track_server_dhcp_acks": { + "iosxe": { + "doc": " Configure DHCP snooping server track dhcp_acks on global\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed Configuring DHCP snooping server track dhcp_acks\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_dhcp_snooping_track_server_dhcp_acks", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1619" + } + }, + "configure_dhcp_snooping_verify_no_relay_agent_address": { + "iosxe": { + "doc": " Configure DHCP snooping verify no-relay-agent-address on global\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed Configuring DHCP snooping verify no-relay-agent-address.\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_dhcp_snooping_verify_no_relay_agent_address", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1585" } }, "configure_dhcpv6_guard_policy": { @@ -4520,7 +4583,7 @@ "module_name": "macsec.configure", "package": "genie.libs.sdk.apis", "uid": "configure_disable_sci_dot1q_clear", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L814" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L775" } }, "configure_distribute_prefix_list_under_ospf": { @@ -4892,6 +4955,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L6748" } }, + "configure_event_manager": { + "iosxe": { + "doc": " Configures event manager applet\n Args:\n device ('obj'): device to use\n event ('str'): Name of the Event Manager applet\n description('str'): description is name of event applet name \n event_run_option('str'): event run specific action name (maxrun, ratelimlit, sync ..)\n event_run_value('str'): event run action values (maxrun: <0-3675744>, sync:...) \n action_name('str'): Lable name \n action_option('str'): action need to provide to perform system (reload,syslog,track ....)\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_event_manager", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5478" + } + }, "configure_event_manager_applet": { "iosxe": { "doc": " Configures event manager applet\n Args:\n device ('obj'): device to use\n event ('str'): event manager applet name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -5816,7 +5888,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_interface_ip_dhcp_relay_information_option_vpn_id", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1147" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1150" } }, "configure_interface_ip_dhcp_relay_source_interface_intf_id": { @@ -5825,7 +5897,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_interface_ip_dhcp_relay_source_interface_intf_id", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1187" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1190" } }, "configure_interface_ip_nbar": { @@ -6203,7 +6275,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_interface_range_dhcp_channel_group_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1464" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1469" } }, "configure_interface_range_no_switchport": { @@ -6554,7 +6626,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_interface_vlan_range_priority", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L942" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L941" } }, "configure_interface_vlan_standby_ip": { @@ -6680,6 +6752,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L1825" } }, + "configure_ip_acl_with_any": { + "iosxe": { + "doc": " Configuring ip ACL with any\n Example: ip access-lists extended ip_acl\n permit ip any any\n Args:\n device ('obj'): device to use\n acl_name ('str'): name of the ACL to which the entry belongs\n acl_action ('str'): (permit | deny) permits or denies Layer 2 traffic\n Returns:\n None\n Raises: \n SubCommandFailure\n ", + "module_name": "acl.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_acl_with_any", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py#L2092" + } + }, "configure_ip_arp_inspection_filter": { "iosxe": { "doc": " Clears ip arp inspection\n Args:\n device (`obj`): Device object\n arp_name (`str`): allowed_acl\n vlan_id ('str'): vlan id\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -6740,7 +6821,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_client", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L437" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L440" } }, "configure_ip_dhcp_client_vendor_class": { @@ -6749,7 +6830,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_client_vendor_class", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L493" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L496" } }, "configure_ip_dhcp_exclude_vrf": { @@ -6758,7 +6839,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_exclude_vrf", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1052" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1055" } }, "configure_ip_dhcp_pool": { @@ -6767,7 +6848,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L819" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L822" } }, "configure_ip_dhcp_pool_host": { @@ -6776,7 +6857,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_pool_host", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L983" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L986" } }, "configure_ip_dhcp_restrict_next_hop": { @@ -6785,7 +6866,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_restrict_next_hop", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1074" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1077" } }, "configure_ip_dhcp_snooping": { @@ -6803,7 +6884,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_snooping_database", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L304" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L307" } }, "configure_ip_dhcp_snooping_information_option": { @@ -6812,7 +6893,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_snooping_information_option", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L777" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L780" } }, "configure_ip_dhcp_snooping_information_option_allow_untrusted": { @@ -6821,7 +6902,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_snooping_information_option_allow_untrusted", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L729" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L732" } }, "configure_ip_dhcp_snooping_information_option_allow_untrusted_global": { @@ -6830,7 +6911,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_snooping_information_option_allow_untrusted_global", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1428" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1433" } }, "configure_ip_dhcp_snooping_limit": { @@ -6839,7 +6920,16 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ip_dhcp_snooping_limit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1123" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1126" + } + }, + "configure_ip_dhcp_snooping_verify_mac_address": { + "iosxe": { + "doc": " Configure ip_dhcp_snooping_verify_mac_address\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed configuring DHCP snooping verify mac-address\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_dhcp_snooping_verify_mac_address", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1568" } }, "configure_ip_dlep": { @@ -7355,6 +7445,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4707" } }, + "configure_ip_scp_server_enable": { + "iosxe": { + "doc": " Configure ip scp server enable\n Args:\n device ('obj'): Device object\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_scp_server_enable", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5410" + } + }, "configure_ip_scp_username": { "iosxe": { "doc": " Configure username for scp\n Args:\n device ('obj'): Device object\n username ('str'): username\n Raises:\n SubCommandFailure\n ", @@ -7391,6 +7490,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4098" } }, + "configure_ip_ssh_source_interface": { + "iosxe": { + "doc": " Configure ip ssh source-interface {interface}\n Args:\n device ('obj'): Device object\n interface (`str`): Interface name\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ip_ssh_source_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5434" + } + }, "configure_ip_ssh_version": { "iosxe": { "doc": " Configure ip ssh version\n Args:\n device ('obj'): Device object\n version('str'): ssh version\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -7541,7 +7649,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ipv4_object_group_network", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L476" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L519" } }, "configure_ipv4_object_group_service": { @@ -7550,7 +7658,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ipv4_object_group_service", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L534" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L577" } }, "configure_ipv4_ogacl_ip": { @@ -7559,7 +7667,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ipv4_ogacl_ip", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L653" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L696" } }, "configure_ipv4_ogacl_on_interface": { @@ -7568,7 +7676,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ipv4_ogacl_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L705" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L748" } }, "configure_ipv4_ogacl_service": { @@ -7577,7 +7685,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ipv4_ogacl_service", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L623" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L666" } }, "configure_ipv4_ogacl_src_dst_nw": { @@ -7586,7 +7694,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "configure_ipv4_ogacl_src_dst_nw", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L593" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L636" } }, "configure_ipv4_server_under_gkm_group": { @@ -8556,7 +8664,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "configure_license_smart_transport_callhome", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L74" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L79" } }, "configure_license_smart_transport_cslu": { @@ -8583,7 +8691,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "configure_license_smart_transport_smart", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L40" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L43" } }, "configure_license_smart_url": { @@ -9522,7 +9630,7 @@ "module_name": "macsec.configure", "package": "genie.libs.sdk.apis", "uid": "configure_mka_macsec", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L740" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L701" } }, "configure_mka_policy": { @@ -9983,7 +10091,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "configure_netconf_yang", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L91" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L97" } }, "configure_netconf_yang_intelligent_sync": { @@ -10058,6 +10166,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L134" } }, + "configure_no_shutdown_vlan_interface_range": { + "iosxe": { + "doc": "\n Args:\n device ('obj'): Device object\n vlan_id_from ('int') : <1-4094> Vlan interface number staring from\n vlan_id_to ('int') : <1-4094> Vlan interface number end to\n Returns:\n None\n Raises:\n SubcommandFailure: Failed executing command\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_no_shutdown_vlan_interface_range", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1223" + } + }, "configure_ntp_iburst": { "iosxe": { "doc": " Configure ntp iburst using ip address\n\n Args:\n device ('obj'): Device object\n route ('str'): IP address to configure\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -10124,6 +10241,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/evpn/configure.py#L661" } }, + "configure_object_group": { + "iosxe": { + "doc": "Configure object group service name\n Args:\n device ('obj'): device object\n group ('str'): group name\n object_group_name ('str'): object-group name\n protocol('str') : eg: tcp,udp,tcp-udp,eigrp\n option ('str') : eg: lt,eq,gt\n port ('str') : eg: telnet,ssh\n network_option ('str') : eg: host,range\n ip_address_1 ('str') : eg: 1.1.1.1 test\n ip_address_2 ('str') : eg 2.2.2.2 /24\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "ogacl.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_object_group", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L476" + } + }, "configure_object_list_schema_transfer_for_bulkstat": { "iosxe": { "doc": " Configure object list, schema and transfer for bulkstat\n Args:\n device ('obj'): device to use\n type_('str'): object-list Configure an Object List\n schema Configure Schema definition\n transfer Configure Transfer Parameters\n object_name('str', optional): WORD Name of object list, default value is None\n schema_name('str', optional): WORD Name of the schema, default value is None\n transfer_name('str', optional): WORD Name of bulk transfer, default value is None\n oid_value_list:('list', optional): WORD Object name or OID list, default value is None\n poll_interval('int', optional): Periodicity for the polling of objects in this schema in\n Minutes. (Default value is 5 Mins), default value is None\n snmp_interface('str', optional): Specify instance as ifDescr, default value is None\n format_('str', optional): An ASCII format containing schema definitions, default value is None\n transfer_interval('int', optional): Periodicity for the transfer of bulk data in Minutes, default value is None\n buffer_size('int', optional): Bulkstat data file maximum size(Default size is 2048 bytes), default value is None\n primary_url('str', optional): WORD URL of primary destination, default value is None\n enable('str', optional): Start Data Collection for this Configuration, default value is None\n logging_on('str', optional): Modify message logging facilities, default value is None\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -10329,6 +10455,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L362" } }, + "configure_ospf_vrf_lite": { + "iosxe": { + "doc": "Configure vrf-lite capabilty for OSPF process.\n Args:\n device (`obj`): Device object\n ospf_process_id (`str`): OSPF Process ID (1-65535)\n vrf_name (`str`): VRF name (Eg : 'vrf1')\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "ospf.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_ospf_vrf_lite", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L2762" + } + }, "configure_ospfv3": { "iosxe": { "doc": "configure ospf ip bfd\n\n Args:\n device (`obj`): Device object\n pid (`str`): Ospfv3 process id\n router_id (`str`, optional): Router id, default value is None\n vrf('str', optional): vrf id for ospf process\n nsr (`Bool`, optional): Nsr to be configured, default value is None\n graceful_restart (`Bool`, optional): Graceful restart to be\n configured,default value is None\n address_family (`str`, optional): Address family to be configured,\n default value is None\n bfd ('str', optional) : bfd name, default value is None\n traffic_type('str' optional) : type of traffic\n adjacency('bool' optional): option to log adjacency changes\n redistribute('bool' optional): option to redistribute routes\n route_method('str' optional): route type to be redistributed\n metric('int' optional): route metric\n metric-type('int' optional): route metric type\n\n Return:\n None\n\n Raises:\n SubCommandFailure\n ", @@ -10443,7 +10578,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pae", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L6" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L7" } }, "configure_parameter_map": { @@ -10524,16 +10659,16 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_authenticate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L624" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L631" } }, "configure_pki_authenticate_certificate": { "iosxe": { - "doc": " Pastes certificate on device\n\n Args:\n device (`obj`): Device object\n certificate ('str'): Certificate to be pasted\n label_name ('str'): Label name\n\n Returns:\n None\n\n Raise:\n SubCommandFailure: Failed to paste certificate on device\n ", - "module_name": "eaptls.configure", + "doc": " Pastes certificate on device\n Args:\n device (`obj`): Device object\n certificate ('str'): Certificate to be pasted\n label_name ('str'): Label name\n Returns:\n None\n Raise:\n SubCommandFailure: Failed to paste certificate on device\n ", + "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_authenticate_certificate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/eaptls/configure.py#L38" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L907" } }, "configure_pki_enroll": { @@ -10542,7 +10677,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_enroll", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L554" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L559" } }, "configure_pki_enroll_certificate": { @@ -10556,11 +10691,11 @@ }, "configure_pki_export": { "iosxe": { - "doc": "\n Configuring crypto pki export\n Args:\n device ('obj'): Device object\n tp_name ('str'): Name of the trustpoint\n export_type ('str'): Type of import [certificate, pkcs12, pem]\n pkcs_media_type ('str'): Filesytem for importing pkcs12 file\n pkcs_file ('str'): Pkcs file name that needs import\n pkcs_url ('str'): pkcs file url\n file_password ('str'): Passphrase used to protect the pkcs12 file\n pem_option ('str'): Different Pem import options\n pem_media_type ('str'): Filesytem for importing pem file\n pem_file ('str'): pem file name that needs import\n pem_url ('str'): pem file url\n prvt_key_encry ('str'): Encrypt the private key\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "doc": "\n Configuring crypto pki export\n Args:\n device ('obj'): Device object\n tp_name ('str'): Name of the trustpoint\n export_type ('str'): Type of import [certificate, pkcs12, pem]\n pkcs_media_type ('str'): Filesytem for importing pkcs12 file\n pkcs_file ('str'): Pkcs file name that needs import\n pkcs_url ('str'): pkcs file url\n file_password ('str'): Passphrase used to protect the pkcs12 file\n pem_option ('str'): Different Pem import options\n pem_media_type ('str'): Filesytem for importing pem file\n pem_file ('str'): pem file name that needs import\n pem_url ('str'): pem file url\n prvt_key_encry ('str'): Encrypt the private key\n Returns:\n certificate\n Raises:\n SubCommandFailure\n ", "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_export", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L784" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L791" } }, "configure_pki_export_pem": { @@ -10578,16 +10713,16 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_import", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L662" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L669" } }, "configure_pki_trustpoint": { "iosxe": { - "doc": " Configures Trustpoint related config on device\n\n Args:\n device ('obj'): device to use\n key_type ('str'): Key type to be generated\n label_name ('str'): Label name\n modulus_size ('str'): Modulus size to be configured\n enrollment_type ('str'): Enrollment type to be configured\n subject_line ('str'): Subject Line to be configured\n revocation_check ('str'): Revocation check to be configured\n storage_type ('str'): Storage type to be configured\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", + "doc": " Configures Trustpoint related config on device\n\n Args:\n device ('obj'): device to use\n key_type ('str', Optional): Key type to be generated. Defaults to None\n label_name ('str', Optional): Label name. Defaults to None\n modulus_size ('str', Optional): Modulus size to be configured. Defaults to None\n enrollment_type ('str', Optional): Enrollment type to be configured. Defaults to None\n subject_line ('str', Optional): Subject Line to be configured. Defaults to None\n revocation_check ('str', Optional): Revocation check to be configured. Defaults to None\n storage_type ('str', Optional): Storage type to be configured. Defaults to None\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", "module_name": "macsec.configure", "package": "genie.libs.sdk.apis", "uid": "configure_pki_trustpoint", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L667" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L855" } }, "configure_platform": { @@ -11047,6 +11182,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L277" } }, + "configure_qfp_drop_threshold": { + "iosxe": { + "doc": "\n Configure drop warning threshold for the qfp. If drop_id is\n unspecified, configure the total drop threshold, else\n configure the per-cause drop threshold.\n Args:\n device ('obj'): device object\n threshold ('int'): threshold value\n drop_id ('int'): drop cause ID for which to set threshold\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_qfp_drop_threshold", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5362" + } + }, "configure_qos_policy": { "iosxe": { "doc": " Configures the qos_policy on interface\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n access_type ('str') : type of interface or VC\n policy_name ('str') : name of the policy\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -11665,7 +11809,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "configure_service_dhcp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1292" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1296" } }, "configure_service_instance": { @@ -11884,6 +12028,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py#L75" } }, + "configure_shutdown_vlan_interface_range": { + "iosxe": { + "doc": "\n Args:\n device ('obj'): Device object\n vlan_id_from ('int') : <1-4094> Vlan interface number staring from\n vlan_id_to ('int') : <1-4094> Vlan interface number end to\n Returns:\n None\n Raises:\n SubcommandFailure: Failed executing command\n ", + "module_name": "vlan.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_shutdown_vlan_interface_range", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1197" + } + }, "configure_sks_client": { "iosxe": { "doc": " Configures SKS client\n Args:\n device (`obj`): Device object\n sks_client_config_block_name ('str'): Name of the SKS-Client config block.\n ip_mode ('str'): ip mode (ipv4/ipv6)\n server_IP_address ('str'): Server ipv4/ipv6 address\n server_port_number ('str'): Port configuration\n psk_identity ('str'): Key identity\n password ('str'): Unencrypted password\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -12172,6 +12325,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L613" } }, + "configure_spanning_tree_mst_priority": { + "iosxe": { + "doc": "configure spanning-tree mst 0 priority 4096\n Args:\n device ('obj') : Device object\n instance_range('int') : MST instance range, example: 0-3,5,7-9\n range('int') : <0-61440> bridge priority in increments of 4096\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to configures spanning-tree mst 0 priority 4096\n ", + "module_name": "spanning_tree.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_spanning_tree_mst_priority", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py#L818" + } + }, "configure_spanning_tree_portfast": { "iosxe": { "doc": " Configures Spanning Tree Portfast\n Args:\n device ('obj') : device to use\n default ('boolean', optional) : Options are True/False. Default is False\n bpdugaurd ('boolean',optional) : Options are True/Flase. Default is False\n bpdufilter ('boolean', optional) : Options are True/False. Default is False\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -12664,7 +12826,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_switchport_trunk_pruning_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1148" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1147" } }, "configure_switchport_trunk_pruning_vlan_except": { @@ -12673,7 +12835,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_switchport_trunk_pruning_vlan_except", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L969" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L968" } }, "configure_switchport_trunk_vlan": { @@ -12807,13 +12969,22 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/mpls/configure.py#L1004" } }, + "configure_telemetry_ietf_parameters": { + "iosxe": { + "doc": "\n Configure telemetry ietf subscription with sub_id on device\n Args:\n device (`obj`): Device object\n sub_id('int'): <0-2147483647> Subscription Identifier\n stream('str'): Stream type\n receiver_ip('str'): IP of the receiving server\n receiver_port('int'): Port of the receiving service on the server\n protocol('str'): The protocol over which telemetry updates are sent\n filter_value('str', Optional): The xpath filter. Default 'xpath'\n encoding('str', Optional): Encoding format. Default 'encode-kvgpb'\n update_policy('str', Optional): Update policy type - 'periodic' or 'on-update'. Default 'periodic'\n periodic_update_interval('int', Optional): The interval at which updates are sent in centiseconds. Default 500\n source_address('str', Optional): Source address for updates\n source_vrf('str', Optional): Source vrf for updates\n Returns:\n None\n Raises:\n SubCommandFailure : Failed configuring device\n ", + "module_name": "telemetry.configure", + "package": "genie.libs.sdk.apis", + "uid": "configure_telemetry_ietf_parameters", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L152" + } + }, "configure_telemetry_ietf_subscription": { "iosxe": { "doc": " configure telemetry ietf subscription with sub_id on device\n Args:\n device (`obj`): Device object\n sub_id('int'): <0-2147483647> Subscription Identifier\n Returns:\n None\n Raises:\n SubCommandFailure : Failed configuring device\n ", "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "configure_telemetry_ietf_subscription", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L125" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L133" } }, "configure_template": { @@ -13146,7 +13317,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vlan_group_list", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1011" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1010" } }, "configure_vlan_name": { @@ -13155,7 +13326,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vlan_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1061" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1060" } }, "configure_vlan_shutdown": { @@ -13362,7 +13533,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vtp_pruning", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1118" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1117" } }, "configure_vtp_trunk_interface": { @@ -13371,7 +13542,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "configure_vtp_trunk_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L992" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L991" } }, "configure_vtp_version": { @@ -13416,7 +13587,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "convert_server_to_linux_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1478" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1490" } }, "copy_config_from_tftp_to_media": { @@ -13434,7 +13605,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "copy_data_to_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L123" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L127" } }, "copy_file": { @@ -13502,7 +13673,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "copy_from_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1024" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1030" }, "nxos": { "aci": { @@ -13620,7 +13791,7 @@ }, "create_dhcp_pool": { "iosxe": { - "doc": " Create DHCP pool\n Args:\n device ('obj'): device to use\n pool_name ('str'): name of the pool to be created\n network ('str'): IP of the network pool\n mask ('str'): Subnet mask of the network pool\n router_id ('str'): Default router ID\n Returns:\n None\n Raises:\n SubCommandFailure: Failed creating dhcp pool\n ", + "doc": " Create DHCP pool\n Args:\n device ('obj'): device to use\n pool_name ('str'): name of the pool to be created\n network ('str'): IP of the network pool\n mask ('str'): Subnet mask of the network pool\n router_id ('str'): Default router ID\n lease_days ('str'): Number of days for the lease\n lease_hrs ('str'): Number of hours for the lease\n lease_mins ('str'): Number of minutes for the lease\n Returns:\n None\n Raises:\n SubCommandFailure: Failed creating dhcp pool\n ", "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "create_dhcp_pool", @@ -13642,7 +13813,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "create_dhcp_pool_withoutrouter", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L375" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L378" } }, "create_dir_file_system": { @@ -13829,7 +14000,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "delete_directory", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1916" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1918" } }, "delete_file_on_device": { @@ -13847,7 +14018,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "delete_file_on_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1376" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1388" } }, "delete_files": { @@ -14017,7 +14188,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "device_recovery_boot", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4294" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4306" } }, "device_tracking_attach_policy": { @@ -14053,7 +14224,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "diff_configuration", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1549" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1561" } }, "disable_aaa_authentication_login": { @@ -14170,7 +14341,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_dhcp_compatibility_suboption", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1360" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1364" } }, "disable_dhcp_ldra": { @@ -14188,7 +14359,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_dhcp_relay_information_option", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L649" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L652" } }, "disable_dhcp_smart_relay": { @@ -14197,7 +14368,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_dhcp_smart_relay", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L567" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L570" } }, "disable_dhcp_snooping": { @@ -14206,7 +14377,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_dhcp_snooping", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L286" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L289" } }, "disable_dhcp_snooping_glean": { @@ -14215,7 +14386,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_dhcp_snooping_glean", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L97" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L100" } }, "disable_dhcp_snooping_option_82": { @@ -14224,7 +14395,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_dhcp_snooping_option_82", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L197" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L200" } }, "disable_dhcp_snooping_vlan": { @@ -14233,7 +14404,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_dhcp_snooping_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L156" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L159" } }, "disable_dot1x_sysauthcontrol": { @@ -14278,7 +14449,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "disable_ip_dhcp_auto_broadcast", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L475" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L478" } }, "disable_ip_igmp_snooping_report_suppression": { @@ -14395,7 +14566,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "dynamic_diff_create_running_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1619" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1631" } }, "dynamic_diff_parameterized_running_config": { @@ -14404,7 +14575,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "dynamic_diff_parameterized_running_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1571" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1583" } }, "enable_aaa_authentication_login": { @@ -14481,6 +14652,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/bgp/configure.py#L1439" } }, + "enable_cpp_system_default_on_device": { + "iosxe": { + "doc": " Enable cpp system-default on device\n Args:\n device ('obj'): Device object\n Returns:\n None\n Raises:\n SubCommandFailure : Failed to enable cpp system-default on device\n ", + "module_name": "cpp.configure", + "package": "genie.libs.sdk.apis", + "uid": "enable_cpp_system_default_on_device", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/configure.py#L13" + } + }, "enable_cts_enforcement": { "iosxe": { "doc": " Enable cts role-based enforcement\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to enable cts role-based enforcement\n ", @@ -14541,7 +14721,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_dhcp_compatibility_suboption", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1342" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1346" } }, "enable_dhcp_ldra": { @@ -14559,7 +14739,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_dhcp_relay_information_option", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L625" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L628" } }, "enable_dhcp_smart_relay": { @@ -14568,7 +14748,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_dhcp_smart_relay", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L550" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L553" } }, "enable_dhcp_snooping": { @@ -14577,7 +14757,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_dhcp_snooping", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L136" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L139" } }, "enable_dhcp_snooping_glean": { @@ -14586,7 +14766,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_dhcp_snooping_glean", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L78" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L81" } }, "enable_dhcp_snooping_option_82": { @@ -14595,7 +14775,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_dhcp_snooping_option_82", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L269" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L272" } }, "enable_dhcp_snooping_vlan": { @@ -14604,7 +14784,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_dhcp_snooping_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L116" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L119" } }, "enable_dot1x_sysauthcontrol": { @@ -14660,7 +14840,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_ip_dhcp_auto_broadcast", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L456" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L459" } }, "enable_ip_dhcp_snooping_trust": { @@ -14669,7 +14849,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "enable_ip_dhcp_snooping_trust", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L243" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L246" } }, "enable_ip_igmp_snooping_report_suppression": { @@ -14807,6 +14987,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L1236" } }, + "enable_switchport_protected_on_interface": { + "iosxe": { + "doc": " Enable switchport protected on interface\n Args:\n device ('obj'): Device object\n interface ('str'): interface name to enable switchport protected\n Returns:\n None\n Raises:\n SubCommandFailure : Failed to enable switchport protected on interface\n ", + "module_name": "interface.configure", + "package": "genie.libs.sdk.apis", + "uid": "enable_switchport_protected_on_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9595" + } + }, "enable_switchport_trunk_on_interface": { "iosxe": { "doc": " Enable switchport trunk on interface\n Args:\n device ('obj'): Device object\n interface ('str'): interface name to enable switchport trunk\n Returns:\n None\n Raises:\n SubCommandFailure : Failed to enable switchport trunk on interface\n ", @@ -14867,7 +15056,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "exclude_ip_dhcp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L176" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L179" } }, "execute": { @@ -14939,7 +15128,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_archive_tar", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1458" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1496" } }, "execute_by_jinja2": { @@ -15032,6 +15221,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/execute.py#L48" } }, + "execute_clear_control_plane": { + "iosxe": { + "doc": " execute clear control-plane all in switch\n Args:\n device ('obj'): Device object\n Returns:\n Execution output\n Raises:\n SubCommandFailure\n ", + "module_name": "cpp.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_clear_control_plane", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/execute.py#L15" + } + }, "execute_clear_dns_statistics": { "iosxe": { "doc": " Execute test CLI to Clear umbrella dns querey/response statistics\n Args:\n device ('obj'): device to use\n Returns:\n clear statistics execution command\n Raises:\n SubCommandFailure: test ngdns cli\n ", @@ -15056,7 +15254,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_install_label", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L611" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L615" } }, "execute_clear_install_state": { @@ -15065,7 +15263,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_install_state", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L537" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L541" } }, "execute_clear_ip_igmp_group": { @@ -15074,7 +15272,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_ip_igmp_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1596" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1634" } }, "execute_clear_ip_nat_translation": { @@ -15101,7 +15299,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_clear_ipv6_mld_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1573" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1611" } }, "execute_clear_line": { @@ -15326,7 +15524,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_create_rollback_description", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L511" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L515" } }, "execute_create_rollback_label": { @@ -15335,7 +15533,16 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_create_rollback_label", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L485" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L489" + } + }, + "execute_crypto_pki_server": { + "iosxe": { + "doc": " Config execute crypto pki server\n Args:\n device ('obj'): device object\n certificate_req ('str'): certificate request options like \n server_name('str'): CA Server Name\n copy_certificate(str): CA certificate copy \n sleep_time(int) : sleep time\n Return:\n None\n Raises:\n SubCommandFailure: Failed execute device\n ", + "module_name": "macsec.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_crypto_pki_server", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/execute.py#L12" } }, "execute_deactivate_pie": { @@ -15460,7 +15667,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_dir_file_system", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1432" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1470" } }, "execute_erase_ap": { @@ -15472,6 +15679,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/cheetah/ap/execute.py#L22" } }, + "execute_event_manager_run_with_reload": { + "iosxe": { + "doc": " Execute event manager with Embedded Event Manager policy name \n Args:\n device ('obj'): device to use\n embedded_event_name ('str'): Embedded Event Manager policy name \n username ('str'): username \n password ('str'): password \n sleep_time : sleep time\n Returns:\n True if reload successful else False\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_event_manager_run_with_reload", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1724" + } + }, "execute_format": { "iosxe": { "doc": " Execute 'format ' on the device\n Args:\n device ('obj'): Device object\n timeout ('int'): Max time to for format to complete in seconds\n file_sys ('str'): File system should be formatted\n file_sys_type ('str', optinal): File system type. Ex: FAT32, ext2. Default is None\n Returns:\n None\n Raises:\n SubCommandFailure : Failed to format the file system on device\n ", @@ -15496,7 +15712,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_abort", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L665" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L669" } }, "execute_install_activate": { @@ -15514,7 +15730,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_add", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L335" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L339" } }, "execute_install_application_bootflash": { @@ -15532,7 +15748,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_auto_abort_timer_stop", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L587" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L591" } }, "execute_install_commit": { @@ -15541,7 +15757,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_commit", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L436" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L440" } }, "execute_install_controller_group_firmware": { @@ -15559,7 +15775,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_deactivate", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L729" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L733" } }, "execute_install_label": { @@ -15573,7 +15789,7 @@ }, "execute_install_one_shot": { "iosxe": { - "doc": "\n Performs install one shot on the device\n Args:\n device ('obj'): Device object\n file_path ('str, optional'): Path of the image\n prompt ('bool, optional'): True sets the command to ask for prompt and\n False sets the prompt level to none\n issu ('bool, optional'): Force the operation to use issu technique\n negative_test ('bool, optional'): Flag for install add pass/Fail cases\n timeout ('int, optional'): Timeout value\n connect_timeout ('int, optional'): Time to wait before sending the prompt\n (when pattern \"Press RETURN to get \n started\" matches)\n Returns:\n True if install one shot is successful\n False if install one shot is not successful\n Raises:\n Exception\n ", + "doc": "\n Performs install one shot on the device\n Args:\n device ('obj'): Device object\n file_path ('str, optional'): Path of the image\n prompt ('bool, optional'): True sets the command to ask for prompt and\n False sets the prompt level to none\n issu ('bool, optional'): Force the operation to use issu technique\n negative_test ('bool, optional'): Flag for install add pass/Fail cases\n timeout ('int, optional'): Timeout value\n connect_timeout ('int, optional'): Time to wait before sending the prompt\n (when pattern \"Press RETURN to get \n started\" matches))\n reloadfast('bool, optional'): Force the operation to use reloadfast.\n Returns:\n True if install one shot is successful\n False if install one shot is not successful\n Raises:\n Exception\n ", "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_one_shot", @@ -15595,7 +15811,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_package_reload_fast", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L914" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L918" } }, "execute_install_pie": { @@ -15631,7 +15847,7 @@ "module_name": "install.execute", "package": "genie.libs.sdk.apis", "uid": "execute_install_rollback", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L823" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py#L827" } }, "execute_install_switch_group_firmware": { @@ -15712,7 +15928,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_more_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1617" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1655" } }, "execute_more_file_count": { @@ -15739,7 +15955,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_platform_virtualization", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1642" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1680" } }, "execute_power_cycle_device": { @@ -15807,7 +16023,7 @@ }, "execute_reload_fast": { "iosxe": { - "doc": " execute Halt and perform a cold restart for XFSU device\n\n Args:\n device ('obj'): device to use\n fast_type ('fast_type', Optional): type can be \"enhanced\" or none based on versio\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to execute Halt and perform a cold restart for XFSU device\n ", + "doc": " Execute Halt and perform a cold restart for XFSU device\n\n Args:\n device ('obj'): device to use\n fast_type ('fast_type', Optional): type can be \"enhanced\" or none based on version\n username ('username', Optional): Console username\n password ('password', Optional): Console Password\n timeout ('int, optional'): Timeout value (Default value - 600s)\n prompt_wait_time ('int, optional'): Time to wait before sending the prompt(Default value - 10s)\n Returns:\n True if reload fast is successful\n Raises:\n SubCommandFailure: Failed to execute Halt and perform a cold restart for XFSU device\n ", "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_reload_fast", @@ -15969,7 +16185,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "execute_switch_card_OIR_power_force", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1522" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1560" } }, "execute_switch_clear_stack_mode": { @@ -16062,6 +16278,33 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/umbrella_odns/execute.py#L3" } }, + "execute_test_opssl_nonblockingsession_client": { + "iosxe": { + "doc": "\n Execute test opssl nonblockingsession client\n Args:\n device ('obj'): device object\n version('int'): server versions\n host_ip_addr('int'): peer's IP address\n port_number('int'): port number for connect or accept <1-10000> \n num_connections('int'): Number of connections <1-50> \n num_messages('int'): number of messages before sending close notification <1-100> \n pre_key('int'): Pre-shared key <16-134217727>\n identity_check('int'): Disable/Enable Server Identity Check <0-1> \n identity_label('int'): Identity TrustPoint label \n verfiy_label('str'): Verification TrustPoint label\n Return:\n None\n Raises:\n SubCommandFailure: Failed configuring device\n ", + "module_name": "macsec.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_test_opssl_nonblockingsession_client", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/execute.py#L49" + } + }, + "execute_test_opssl_nonblockingsession_server_start": { + "iosxe": { + "doc": " Execute opssl nonblockingsession server tls1.2 start\n Args:\n device ('obj'): device object\n version('str'): server versions\n test_server('str'): OPSSL test-server \n host_ip_addr(int): host IP address\n port_number('int'): port number for connect or accept <1-10000> \n pre_key('int'): Pre-shared key <16-134217727> \n identity_check('int'): Disable/Enable Server Identity Check <0-1> \n identity_label('str'): Identity TrustPoint label\n verfiy_label ('str'): Verification TrustPoint label\n Return:\n None\n Raises:\n SubCommandFailure: Failed execute device\n ", + "module_name": "macsec.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_test_opssl_nonblockingsession_server_start", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/execute.py#L97" + } + }, + "execute_test_opssl_nonblockingsession_server_stop": { + "iosxe": { + "doc": " Execute opssl nonblockingsession server stop\n Args:\n device ('obj'): device object\n session_mode ('str'): Session modes \n version('str'): server versions\n test_server('str'): OPSSL test-server \n Return:\n None\n Raises:\n SubCommandFailure: Failed execute device\n ", + "module_name": "macsec.execute", + "package": "genie.libs.sdk.apis", + "uid": "execute_test_opssl_nonblockingsession_server_stop", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/execute.py#L78" + } + }, "execute_test_platform_hardware_fantray": { "iosxe": { "doc": " \n Args:\n device ('obj'): device to use \n switch_mode ('str'): switch mode on/off\n\t switch_number ('int'): switch number 1/2\n ", @@ -16238,7 +16481,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "format_directory", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1941" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1943" } }, "fp_switchover": { @@ -16859,7 +17102,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_bool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4076" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4088" } }, "get_boot_variables": { @@ -17263,7 +17506,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_connected_alias", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3673" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3685" } }, "get_connection": { @@ -17272,7 +17515,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_connection", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3001" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3013" } }, "get_controller_name": { @@ -17353,7 +17596,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_device_connections_info", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3373" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3385" } }, "get_device_tracking_counters_vlan_faults": { @@ -17416,7 +17659,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_devices", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3048" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3060" } }, "get_devices_simple": { @@ -17425,7 +17668,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_devices_simple", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3198" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3210" } }, "get_dhcpv4_binding_address_list": { @@ -17497,7 +17740,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_dict_items", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1805" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1817" } }, "get_diffs_platform": { @@ -17597,7 +17840,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_file_size_from_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1197" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1209" } }, "get_file_timestamp": { @@ -17849,7 +18092,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_interface_attr_from_yaml", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3328" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3340" } }, "get_interface_capabilities_multiple_media_types": { @@ -17912,7 +18155,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_interface_from_yaml", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3222" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3234" } }, "get_interface_ifindex": { @@ -17960,7 +18203,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_interface_interfaces", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2000" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2012" }, "iosxe": { "doc": " Get interface and device\n\n Args:\n device ('obj'): Device object\n link_name ('str'): link name\n opposite ('bool'): find opposite device interface\n num ('int'): num of interface to return\n\n Returns:\n topology dictionary\n\n Raises:\n None\n ", @@ -18385,7 +18628,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_interface_type_from_yaml", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3287" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3299" } }, "get_interface_with_mask": { @@ -18421,7 +18664,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_interfaces", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1938" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1950" } }, "get_interfaces_description": { @@ -18856,7 +19099,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_list_items", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1756" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1768" } }, "get_list_length": { @@ -18865,7 +19108,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_list_length", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4116" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4128" } }, "get_lldp_neighbors_info": { @@ -18904,7 +19147,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_local_ip", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4049" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4061" } }, "get_log_message_time": { @@ -18931,7 +19174,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_longest_server_address", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1356" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1368" } }, "get_mac_aging_timer": { @@ -20159,7 +20402,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_power_cyclers", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2027" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2039" } }, "get_processes_five_seconds_cpu_usage": { @@ -20566,7 +20809,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_running_config_all", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3384" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3396" } }, "get_running_config_dict": { @@ -20998,7 +21241,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_single_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4003" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4015" } }, "get_slice_id_of_interface": { @@ -21096,6 +21339,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py#L11" } }, + "get_snmp_snmpwalk_sysname": { + "linux": { + "doc": " Get snmpwalk version 3 sysname output from SNMP device\n Args:\n device (`obj`): SNMP device\n ip_address (`str`): IP address of hostname specified\n oid (`str`): Oid includes given OID in the search range\n username (`str`): security username \n passphrase (`str`): authentication protocol pass phrase\n security_level (`str`): set security level \n dir('str',Optional): change path to given directory path. Defaults to None\n security_method (`str`): authentication protocol to set \n algorithm (`str`,Optional): privacy protocol .Defaults to None\n private_passphrase (`str`,Optional) : privacy protocol pass phrase. Defaults to None\n version (`str`): specifies SNMP version to use\n option (`str`,Optional): Optional command. Defaults to None\n Returns:\n (`str`): Executed output of SNMP command\n Raises:\n SubCommandFailure\n ", + "module_name": "snmp.get", + "package": "genie.libs.sdk.apis", + "uid": "get_snmp_snmpwalk_sysname", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py#L182" + } + }, "get_snmp_snmpwalk_v3": { "linux": { "doc": " Get snmpwalk version 3 output from SNMP device\n\n Args:\n device (`obj`): SNMP device\n ip_address (`str`): IP address\n oid (`str`): Oid code\n username (`str`): username\n passphrase (`str`): SNMP passphrase\n security_level (`str`): security level\n security_method (`str`): security method\n algorithm (`str`): algorithm\n private_passphrase (`str`) : private passphrase\n version (`str`): SNMP version\n option (`str`): Optional command\n Returns:\n out (`str`): Executed output of SNMP command\n Raises:\n SubCommandFailure\n ", @@ -21105,6 +21357,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py#L96" } }, + "get_snmp_snmpwalk_version3": { + "linux": { + "doc": " Get snmpwalk version 3 output from SNMP device\n Args:\n device (`obj`): SNMP device\n ip_address (`str`): IP address\n oid (`str`): Oid code\n username (`str`): username\n passprs ('str'): SNMP passphrase type\n passphrase (`str`): SNMP passphrase\n var ('str'): var type\n security ('str'): security type\n security_level (`str`): security level\n security_method (`str`): security method\n algorithm (`str`): algorithm\n private_passphrase (`str`) : private passphrase\n version (`str`): SNMP version \n option (`str`): Optional command\n Returns:\n out (`str`): Executed output of SNMP command\n Raises:\n SubCommandFailure\n ", + "module_name": "snmp.get", + "package": "genie.libs.sdk.apis", + "uid": "get_snmp_snmpwalk_version3", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py#L132" + } + }, "get_software_version": { "iosxe": { "doc": "\n Get software version information of a device\n Args:\n device (obj): Device object\n Returns:\n str: Device software version information as str\n Raises:\n None\n ", @@ -21204,7 +21465,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_structure_output", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3743" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3755" } }, "get_supported_elliptic_curves": { @@ -21402,7 +21663,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_testcase_name", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4094" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4106" } }, "get_the_number_of_telemetry_report_in_system": { @@ -21429,7 +21690,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_tolerance_min_max", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2244" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2256" } }, "get_total_asics_cores": { @@ -21585,7 +21846,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "get_username_password", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1506" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1518" } }, "get_valid_config_from_running_config": { @@ -21866,6 +22127,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L420" } }, + "hw_module_sub_slot_reload": { + "iosxe": { + "doc": " hw-module sub-slot {slot} reload force\n Args:\n device (`obj`): Device object\n sub_slot (`str`): sub_slot\n\n Returns:\n Shutdown Status\n\n Raises:\n SubCommandFailure : Failed configuring device\n ", + "module_name": "hw_module.execute", + "package": "genie.libs.sdk.apis", + "uid": "hw_module_sub_slot_reload", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/execute.py#L36" + } + }, "hw_module_switch_num_usbflash_security_password": { "iosxe": { "doc": " configure hw-module switch usbflash1 security enable or diasble password\n Args:\n device ('obj'): device to use\n switch_number ('str'): switch number\n action ('str') : enable or disable\n pwd ('str') : password\n\n Returns:\n None\n Raises:\n SubCommandFailure exception\n ", @@ -22321,7 +22591,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "is_process_started", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L268" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L272" } }, "is_push_present_in_route": { @@ -22461,7 +22731,7 @@ }, "kill_processes": { "linux": { - "doc": " Kills the processes with given PIDs \n Args:\n pids ('list'): List of PIDs\n ex.) pids = [12, 15, 16]\n Raise:\n None\n Returns:\n Failed (list): List of pids that failed to be killed\n ", + "doc": " Kills the processes with given PIDs \n Args:\n pids ('list'): List of PIDs\n ex.) pids = [12, 15, 16]\n sudo ('bool): Whether or not to use sudo\n Raise:\n None\n Returns:\n Failed (list): List of pids that failed to be killed\n ", "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "kill_processes", @@ -22537,7 +22807,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "load_dict_from_json_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2799" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2811" } }, "load_jinja": { @@ -22573,7 +22843,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "modify_filename", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1263" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1275" } }, "modify_pbr_route_map": { @@ -22609,7 +22879,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "number_to_string", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1706" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1718" } }, "nxapi_method_nxapi_cli": { @@ -22727,7 +22997,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "pkill_process", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L83" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L87" } }, "platform_software_fed_fnf_sw_stats_clear": { @@ -22826,7 +23096,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "read_data_from_device", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L175" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L179" } }, "reconnect_device": { @@ -22988,7 +23258,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "remove_dhcp_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L48" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L51" } }, "remove_dhcp_pool_ipv6": { @@ -23006,7 +23276,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "remove_dhcp_snooping_binding", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L214" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L217" } }, "remove_dhcpv6_guard_policy": { @@ -23410,7 +23680,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "repeat_command_save_output", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2164" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2176" } }, "request_chassis_routing_engine_master_switch": { @@ -23455,7 +23725,7 @@ "module_name": "platform.execute", "package": "genie.libs.sdk.apis", "uid": "request_platform_software_package_expand", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1545" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py#L1583" } }, "request_platform_software_process_core": { @@ -23478,7 +23748,7 @@ }, "request_system_shell": { "iosxe": { - "doc": "\n Request platform software system shell\n Args:\n device ('obj'): Device object\n switch_type ('str', optional): Switch type. Ex: active, standby, 0. Default is None.\n processor_slot ('str', optional): Processor slot. Ex: R0. Default is None.\n uname ('bool', optional): To execute uname -a in shell. Default is False.\n exit ('bool', optional): To exit from shell prompt. Default is True.\n command ('str', optional): command to execute in shell prompt\n\n Returns:\n Cli output\n Raises:\n SubCommandFailure\n ", + "doc": "\n Request platform software system shell\n Args:\n device ('obj'): Device object\n switch_type ('str', optional): Switch type. Ex: active, standby, 0. Default is None.\n processor_slot ('str', optional): Processor slot. Ex: R0. Default is None.\n uname ('bool', optional): To execute uname -a in shell. Default is False.\n exit ('bool', optional): To exit from shell prompt. Default is True.\n command ('str', optional): command to execute in shell prompt\n timeout ('int', optional): Timeout in seconds for waiting for the console. Default is None.\n\n Returns:\n Cli output\n Raises:\n SubCommandFailure\n ", "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "request_system_shell", @@ -23566,7 +23836,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "sanitize", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4403" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4415" } }, "save_dict_to_json_file": { @@ -23575,7 +23845,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "save_dict_to_json_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2756" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2768" } }, "save_info_to_file": { @@ -23584,7 +23854,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "save_info_to_file", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1646" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1658" } }, "save_running_config": { @@ -23687,7 +23957,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "send_email", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2211" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2223" } }, "set_clock": { @@ -23847,7 +24117,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "slugify", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2143" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2155" } }, "snmp_server_engine_id_local": { @@ -23935,7 +24205,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "start_routem_process", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L194" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L198" } }, "start_trex_process": { @@ -23944,7 +24214,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "start_trex_process", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L250" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L254" } }, "stop_monitor_capture": { @@ -24005,7 +24275,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "string_to_number", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1676" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1688" } }, "switch_vm_power": { @@ -24041,7 +24311,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "tftp_config", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1421" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L1433" } }, "time_to_int": { @@ -24151,7 +24421,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "trex_copy_json", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L223" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L227" } }, "trex_save_configuration": { @@ -24160,7 +24430,7 @@ "module_name": "platform.utils", "package": "genie.libs.sdk.apis", "uid": "trex_save_configuration", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L95" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py#L99" } }, "tunnel_range_shut_unshut": { @@ -25569,7 +25839,7 @@ "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_crypto_pki_server", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L493" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L498" } }, "unconfigure_crypto_transform_set": { @@ -25659,7 +25929,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_cts_role_based_sgt_map_vlan_list", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1405" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1410" } }, "unconfigure_datalink_flow_monitor": { @@ -25770,6 +26040,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/sisf/configure.py#L1904" } }, + "unconfigure_device_tracking_logging": { + "iosxe": { + "doc": "unconfigure device tracking logging\n Args:\n device (obj): Device object.\n logging_type (str): Type of logging to configure ex:'packet','theft',or'resolution-veto' (default is 'drop')\n Returns:\n None\n Raises:\n SubCommandFailure\n ValueError: If an invalid logging_type is provided.\n ", + "module_name": "device_tracking.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_device_tracking_logging", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py#L164" + } + }, "unconfigure_device_tracking_on_interface": { "iosxe": { "doc": " Unconfigure device-tracking on interface\n Args:\n device ('obj'): device object\n interface ('str'): interface name\n Returns:\n None\n Raises:\n SubCommandFailure: Failed to remove device-tracking from interface\n ", @@ -25794,7 +26073,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_dhcp_channel_group_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L891" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L894" } }, "unconfigure_dhcp_pool": { @@ -25803,7 +26082,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_dhcp_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1261" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1265" } }, "unconfigure_dhcp_relay_information": { @@ -25812,7 +26091,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_dhcp_relay_information", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L605" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L608" } }, "unconfigure_dhcp_relay_short_lease": { @@ -25821,7 +26100,25 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_dhcp_relay_short_lease", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L700" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L703" + } + }, + "unconfigure_dhcp_snooping_track_server_dhcp_acks": { + "iosxe": { + "doc": " Unconfigure DHCP snooping server track dhcp_acks on global\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed Unconfiguring DHCP snooping server track dhcp_acks\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_dhcp_snooping_track_server_dhcp_acks", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1636" + } + }, + "unconfigure_dhcp_snooping_verify_no_relay_agent_address": { + "iosxe": { + "doc": " Unconfigure DHCP snooping verify no-relay-agent-address on global\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed unconfiguring DHCP snooping verify no-relay-agent-address\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_dhcp_snooping_verify_no_relay_agent_address", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1602" } }, "unconfigure_diagnostic_monitor_switch": { @@ -25866,7 +26163,7 @@ "module_name": "macsec.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_disable_sci_dot1q_clear", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L856" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L817" } }, "unconfigure_distribute_prefix_list_under_ospf": { @@ -26289,7 +26586,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_exclude_ip_dhcp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1326" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1330" } }, "unconfigure_filter_vlan_list": { @@ -26838,7 +27135,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_interface_ip_dhcp_relay_information_option_vpn_id", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1167" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1170" } }, "unconfigure_interface_ip_dhcp_relay_source_interface_intf_id": { @@ -26847,7 +27144,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_interface_ip_dhcp_relay_source_interface_intf_id", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1209" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1212" } }, "unconfigure_interface_ip_nbar": { @@ -27045,7 +27342,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_interface_range_dhcp_channel_group_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1493" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1498" } }, "unconfigure_interface_reg_segment": { @@ -27102,6 +27399,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L6392" } }, + "unconfigure_interface_speed": { + "iosxe": { + "doc": " unconfigure speed on interface\n Args:\n device (`obj`): Device object\n interface (`str`): Interface name\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "interface.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_interface_speed", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py#L9619" + } + }, "unconfigure_interface_split_horizon_eigrp": { "iosxe": { "doc": "unconfig split-horizon-eigrp on interface\n\n Args:\n device ('obj'): Device object\n interface ('str'): Interface name\n ipv6 ('int'): ipv6\n eigrp_value ('int'): eigrp process id\n\n Returns:\n None\n\n Raises:\n SubCommandFailure\n ", @@ -27378,7 +27684,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_client_vendor_class", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L527" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L530" } }, "unconfigure_ip_dhcp_pool": { @@ -27387,7 +27693,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_pool", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L841" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L844" } }, "unconfigure_ip_dhcp_pool_host": { @@ -27396,7 +27702,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_pool_host", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1018" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1021" } }, "unconfigure_ip_dhcp_restrict_next_hop": { @@ -27405,7 +27711,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_restrict_next_hop", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1098" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1101" } }, "unconfigure_ip_dhcp_snooping": { @@ -27423,7 +27729,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_snooping_database", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L341" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L344" } }, "unconfigure_ip_dhcp_snooping_information_option": { @@ -27432,7 +27738,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_snooping_information_option", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L798" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L801" } }, "unconfigure_ip_dhcp_snooping_information_option_allow_untrusted": { @@ -27441,7 +27747,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_snooping_information_option_allow_untrusted", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L754" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L757" } }, "unconfigure_ip_dhcp_snooping_information_option_allow_untrusted_global": { @@ -27450,7 +27756,16 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_snooping_information_option_allow_untrusted_global", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1447" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1452" + } + }, + "unconfigure_ip_dhcp_snooping_limit_rate": { + "iosxe": { + "doc": " Unconfigure DHCP snooping limit on interface\n Unconfigure 'no ip dhcp snooping limit' on interface\n Args:\n device ('obj'): device to use\n interface ('str'): interface to configure\n rate_limit('int'): DHCP snooping rate limit\n Returns:\n None\n Raises:\n SubCommandFailure: Failed unconfiguring DHCP snooping limit rate on interface\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_dhcp_snooping_limit_rate", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1527" } }, "unconfigure_ip_dhcp_snooping_trust": { @@ -27459,7 +27774,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_snooping_trust", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L959" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L962" } }, "unconfigure_ip_dhcp_snooping_verify": { @@ -27468,7 +27783,16 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ip_dhcp_snooping_verify", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L417" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L420" + } + }, + "unconfigure_ip_dhcp_snooping_verify_mac_address": { + "iosxe": { + "doc": " Unconfigure ip_dhcp_snooping_verify_mac_address\n Args:\n device ('obj'): device to use\n Returns:\n None\n Raises:\n SubCommandFailure: Failed unconfiguring DHCP snooping verify mac-address\n ", + "module_name": "dhcp.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_dhcp_snooping_verify_mac_address", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1551" } }, "unconfigure_ip_dlep": { @@ -27849,6 +28173,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4724" } }, + "unconfigure_ip_scp_server_enable": { + "iosxe": { + "doc": " Unconfigure ip scp server enable\n Args:\n device ('obj'): Device object\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_scp_server_enable", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5422" + } + }, "unconfigure_ip_scp_username": { "iosxe": { "doc": " Unconfigure username for scp\n Args:\n device ('obj'): Device object\n Raises:\n SubCommandFailure\n ", @@ -27885,6 +28218,15 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L4117" } }, + "unconfigure_ip_ssh_source_interface": { + "iosxe": { + "doc": " Unconfigure ip ssh source-interface\n Args:\n device ('obj'): Device object\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_ip_ssh_source_interface", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5447" + } + }, "unconfigure_ip_ssh_version": { "iosxe": { "doc": " Unconfigure ip ssh version\n Args:\n device ('obj'): Device object\n version('str'): ssh version\n Returns:\n None\n Raises:\n SubCommandFailure\n ", @@ -27999,7 +28341,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ipv4_object_group", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L508" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L551" } }, "unconfigure_ipv4_object_group_service": { @@ -28008,7 +28350,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ipv4_object_group_service", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L566" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L609" } }, "unconfigure_ipv4_ogacl": { @@ -28017,7 +28359,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ipv4_ogacl", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L682" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L725" } }, "unconfigure_ipv4_ogacl_on_interface": { @@ -28026,7 +28368,7 @@ "module_name": "ogacl.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_ipv4_ogacl_on_interface", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L747" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py#L790" } }, "unconfigure_ipv4_subnet_to_sgt_mapping": { @@ -28764,7 +29106,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_license_smart_transport", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L57" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L61" } }, "unconfigure_license_smart_url_cslu": { @@ -29343,7 +29685,7 @@ "module_name": "macsec.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_mka_macsec", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L779" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L740" } }, "unconfigure_mka_policy": { @@ -29649,7 +29991,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_netconf_yang", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L108" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L115" } }, "unconfigure_netconf_yang_intelligent_sync": { @@ -29838,7 +30180,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_pae", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L23" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L25" } }, "unconfigure_parameter_map": { @@ -29892,7 +30234,7 @@ "module_name": "macsec.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_pki_trustpoint", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L707" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py#L668" } }, "unconfigure_platform_qos_port_channel_aggregate": { @@ -30077,11 +30419,11 @@ }, "unconfigure_propagate_sgt": { "iosxe": { - "doc": " UnConfigure propagate sgt\n Args:\n device ('obj'): device object\n interface ('str'): interface to configure (eg. Gig1/0/1, Te1/0/10)\n type ('str'): manual Supply local configuration for CTS parameters\n role-based Role-based Access Control per-port config commands\n cts_type ('str'): policy CTS policy for manual mode\n propagate CTS SGT Propagation configuration for manual mode\n sap CTS SAP configuration for manual mode\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "doc": " UnConfigure propagate sgt\n Args:\n device ('obj'): device object\n interface ('str'): interface to configure (eg. Gig1/0/1, Te1/0/10)\n type ('str'): manual Supply local configuration for CTS parameters\n role-based Role-based Access Control per-port config commands\n cts_type ('str'): policy CTS policy for manual mode\n propagate CTS SGT Propagation configuration for manual mode\n sap CTS SAP configuration for manual mode\n sap CTS SAP configuration for manual mode\n Return:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_propagate_sgt", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1377" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1381" } }, "unconfigure_pseudowire_encapsulation_mpls": { @@ -30189,7 +30531,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_pvlan_primary", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1078" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1077" } }, "unconfigure_pvlan_type": { @@ -30198,7 +30540,16 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_pvlan_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1100" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1099" + } + }, + "unconfigure_qfp_drop_threshold": { + "iosxe": { + "doc": "\n Unconfigure drop warning threshold for the qfp. If drop_id is\n unspecified, unconfigure the total drop threshold, else\n unconfigure the per-cause drop threshold.\n Args:\n device ('obj'): device object\n threshold ('int'): threshold value\n drop_id ('int'): drop cause ID for which to unset threshold\n Returns:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_qfp_drop_threshold", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5386" } }, "unconfigure_qos_policy": { @@ -30495,7 +30846,7 @@ "module_name": "dhcp.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_service_dhcp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1309" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py#L1313" } }, "unconfigure_service_instance": { @@ -31152,7 +31503,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_switchport_trunk_pruning_vlan", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1165" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1164" } }, "unconfigure_switchport_vlan_mapping": { @@ -31233,7 +31584,7 @@ "module_name": "telemetry.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_telemetry_ietf_subscription", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L143" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py#L203" } }, "unconfigure_template": { @@ -31263,13 +31614,22 @@ "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/routing/configure.py#L755" } }, + "unconfigure_time_range": { + "iosxe": { + "doc": "Unconfigure time range\n Args:\n device ('obj'): device object\n time_range_name ('str'): time range name\n Return:\n None\n Raises:\n SubCommandFailure\n ", + "module_name": "platform.configure", + "package": "genie.libs.sdk.apis", + "uid": "unconfigure_time_range", + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py#L5460" + } + }, "unconfigure_trustpoint": { "iosxe": { "doc": "\n unconfiguring crypto pki trustpoint\n Args:\n device ('obj'): Device object\n tp_name ('str'): Name of the trsutpoint\n Returns:\n None\n Raises:\n SubCommandFailure\n ", "module_name": "pki.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_trustpoint", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L522" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py#L527" } }, "unconfigure_trustpoint_switch": { @@ -31431,7 +31791,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_vlan_group_list", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1029" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1028" } }, "unconfigure_vlan_interface": { @@ -31548,7 +31908,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_vtp_mode", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1182" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1181" } }, "unconfigure_vtp_password": { @@ -31566,7 +31926,7 @@ "module_name": "vlan.configure", "package": "genie.libs.sdk.apis", "uid": "unconfigure_vtp_pruning", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1133" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py#L1132" } }, "unconfigure_vtp_version": { @@ -31663,7 +32023,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "upgrade_hw_module_subslot_sfp", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1858" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py#L1860" } }, "upgrade_hw_programmable": { @@ -34388,7 +34748,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_keywords_in_output", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3691" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3703" } }, "verify_l2route_mac_route_flag": { @@ -34634,7 +34994,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_login_with_credentials", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2948" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2960" } }, "verify_lsp_neighbor": { @@ -34817,7 +35177,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_mpls_experimental_bits", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2270" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2282" } }, "verify_mpls_forwarding_table_gid_counter": { @@ -35033,7 +35393,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_no_mpls_header", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2721" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2733" } }, "verify_no_ntp_association_configuration": { @@ -35734,7 +36094,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_as_path", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3403" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3415" } }, "verify_pcap_capability": { @@ -35743,7 +36103,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_capability", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3507" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L3519" } }, "verify_pcap_dscp_bits": { @@ -35752,7 +36112,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_dscp_bits", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2303" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2315" } }, "verify_pcap_has_imcp_destination_unreachable": { @@ -35761,7 +36121,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_has_imcp_destination_unreachable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2074" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2086" } }, "verify_pcap_has_imcpv6_destination_unreachable": { @@ -35770,7 +36130,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_has_imcpv6_destination_unreachable", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2108" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2120" } }, "verify_pcap_ldp_packet": { @@ -35779,7 +36139,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_ldp_packet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4240" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4252" } }, "verify_pcap_mpls_packet": { @@ -35788,7 +36148,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_mpls_packet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2563" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2575" } }, "verify_pcap_packet": { @@ -35797,7 +36157,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_packet", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2827" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2839" } }, "verify_pcap_packet_destination_port": { @@ -35806,7 +36166,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_packet_destination_port", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2533" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2545" } }, "verify_pcap_packet_protocol": { @@ -35815,7 +36175,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_packet_protocol", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2473" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2485" } }, "verify_pcap_packet_source_port": { @@ -35824,7 +36184,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_packet_source_port", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2502" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2514" } }, "verify_pcap_packet_type": { @@ -35833,7 +36193,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "verify_pcap_packet_type", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2444" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L2456" } }, "verify_ping": { @@ -37481,7 +37841,7 @@ "module_name": "utils", "package": "genie.libs.sdk.apis", "uid": "web_interaction", - "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4145" + "url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py#L4157" } }, "write_erase_reload_device": { diff --git a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json index e9fc5c326..73e97d217 100644 --- a/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json +++ b/pkgs/sdk-pkg/sdk_generator/output/github_verifications.json @@ -435,7 +435,7 @@ "parameters": { "vrf_type": "all" }, - "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", + "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) configured_keepalive_interval: , Optional (str) configured_holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) bfd: {Optional (str) bfd_status: , Optional (str) session_status: , Optional (str) mininterval: , Optional (str) multiplier: }, Optional (str) messages: {Optional (Any) Any (str) *: {Optional (str) messages_count: , Optional (str) notifications: , Optional (str) queue: }}, Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: , Optional (str) ttl_security: , Optional (str) external_bgp_neighbor_hop_count: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -454,7 +454,7 @@ "af_type": "ipv4 unicast", "vrf_type": "vrf" }, - "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", + "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) configured_keepalive_interval: , Optional (str) configured_holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) bfd: {Optional (str) bfd_status: , Optional (str) session_status: , Optional (str) mininterval: , Optional (str) multiplier: }, Optional (str) messages: {Optional (Any) Any (str) *: {Optional (str) messages_count: , Optional (str) notifications: , Optional (str) queue: }}, Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: , Optional (str) ttl_security: , Optional (str) external_bgp_neighbor_hop_count: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -473,7 +473,7 @@ "af_type": "ipv6 unicast", "vrf_type": "vrf" }, - "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", + "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) configured_keepalive_interval: , Optional (str) configured_holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) bfd: {Optional (str) bfd_status: , Optional (str) session_status: , Optional (str) mininterval: , Optional (str) multiplier: }, Optional (str) messages: {Optional (Any) Any (str) *: {Optional (str) messages_count: , Optional (str) notifications: , Optional (str) queue: }}, Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: , Optional (str) ttl_security: , Optional (str) external_bgp_neighbor_hop_count: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -488,7 +488,7 @@ "parameters": { "vrf_type": "all" }, - "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", + "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) configured_keepalive_interval: , Optional (str) configured_holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) bfd: {Optional (str) bfd_status: , Optional (str) session_status: , Optional (str) mininterval: , Optional (str) multiplier: }, Optional (str) messages: {Optional (Any) Any (str) *: {Optional (str) messages_count: , Optional (str) notifications: , Optional (str) queue: }}, Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: , Optional (str) ttl_security: , Optional (str) external_bgp_neighbor_hop_count: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -504,7 +504,7 @@ "af_type": "ipv4 unicast", "vrf_type": "vrf" }, - "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", + "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) configured_keepalive_interval: , Optional (str) configured_holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) bfd: {Optional (str) bfd_status: , Optional (str) session_status: , Optional (str) mininterval: , Optional (str) multiplier: }, Optional (str) messages: {Optional (Any) Any (str) *: {Optional (str) messages_count: , Optional (str) notifications: , Optional (str) queue: }}, Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: , Optional (str) ttl_security: , Optional (str) external_bgp_neighbor_hop_count: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -520,7 +520,7 @@ "af_type": "ipv6 unicast", "vrf_type": "vrf" }, - "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", + "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) configured_keepalive_interval: , Optional (str) configured_holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) bfd: {Optional (str) bfd_status: , Optional (str) session_status: , Optional (str) mininterval: , Optional (str) multiplier: }, Optional (str) messages: {Optional (Any) Any (str) *: {Optional (str) messages_count: , Optional (str) notifications: , Optional (str) queue: }}, Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: , Optional (str) ttl_security: , Optional (str) external_bgp_neighbor_hop_count: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -1154,7 +1154,7 @@ "iosxr": { "doc": "Parser for show bgp l2vpn evpn neighbors\n show bgp l2vpn evpn neighbors \n ", "groups": [], - "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", + "schema": "{'instance': {Any (str) *: {Optional (str) vrf: {Any (str) *: {'neighbor': {Any (str) *: {Optional (str) description: , Optional (str) peer_group: , Optional (str) send_community: , Optional (str) input_queue: , Optional (str) output_queue: , Optional (str) graceful_restart: , Optional (str) graceful_restart_helper_only: , Optional (str) graceful_restart_restart_time: , Optional (str) graceful_restart_stalepath_time: , Optional (str) allow_own_as: , Optional (str) minimum_advertisement_interval: , Optional (str) route_reflector_client: , Optional (str) route_reflector_cluster_id: , Optional (str) remote_as: , Optional (str) local_as_as_no: , Optional (str) local_as_no_prepend: , Optional (str) local_as_replace_as: , Optional (str) local_as_dual_as: , Optional (str) remove_private_as: , Optional (str) keepalive_interval: , Optional (str) holdtime: , Optional (str) configured_keepalive_interval: , Optional (str) configured_holdtime: , Optional (str) min_acceptable_hold_time: , Optional (str) link_state: , Optional (str) router_id: , Optional (str) session_state: , Optional (str) up_time: , Optional (str) session_state_reason: , Optional (str) nsr_state: , Optional (str) last_read: , Optional (str) last_read_before_reset: , Optional (str) ebgp_multihop: , Optional (str) ebgp_multihop_max_hop: , Optional (str) shutdown: , Optional (str) suppress_four_byte_as_capability: , Optional (str) last_write: , Optional (str) attempted: , Optional (str) written: , Optional (str) second_last_write: , Optional (str) second_attempted: , Optional (str) second_written: , Optional (str) last_write_before_reset: , Optional (str) last_write_attempted: , Optional (str) last_write_written: , Optional (str) second_last_write_before_reset: , Optional (str) second_last_write_before_attempted: , Optional (str) second_last_write_before_written: , Optional (str) last_write_pulse_rcvd: , Optional (str) last_full_not_set_pulse_count: , Optional (str) last_write_pulse_rcvd_before_reset: , Optional (str) socket_status: , Optional (str) last_write_thread_event_before_reset: , Optional (str) last_write_thread_event_second_last: , Optional (str) last_ka_expiry_before_reset: , Optional (str) last_ka_expiry_before_second_last: , Optional (str) last_ka_error_before_reset: , Optional (str) last_ka_error_ka_not_sent: , Optional (str) last_ka_start_before_reset: , Optional (str) last_ka_start_before_second_last: , Optional (str) precedence: , Optional (str) non_stop_routing: , Optional (str) tcp_initial_sync: , Optional (str) tcp_initial_sync_phase_two: , Optional (str) tcp_initial_sync_done: , Optional (str) enforcing_first_as: , Optional (str) multiprotocol_capability: , Optional (str) bgp_negotiated_keepalive_timers: {Optional (str) hold_time: , Optional (str) keepalive_interval: }, Optional (str) bgp_negotiated_capabilities: {Any (str) *: }, Optional (str) message_stats_input_queue: , Optional (str) message_stats_output_queue: , Optional (str) bgp_neighbor_counters: {Optional (str) messages: {Optional (str) sent: {Any (str) *: }, Optional (str) received: {Any (str) *: }}}, Optional (str) minimum_time_between_adv_runs: , Optional (str) inbound_message: , Optional (str) outbound_message: , Optional (str) bfd: {Optional (str) bfd_status: , Optional (str) session_status: , Optional (str) mininterval: , Optional (str) multiplier: }, Optional (str) messages: {Optional (Any) Any (str) *: {Optional (str) messages_count: , Optional (str) notifications: , Optional (str) queue: }}, Optional (str) address_family: {Any (str) *: {Optional (str) enabled: , Optional (str) graceful_restart: , Optional (str) ipv4_unicast_send_default_route: , Optional (str) ipv6_unicast_send_default_route: , Optional (str) prefixes_received: , Optional (str) prefixes_sent: , Optional (str) active: , Optional (str) neighbor_version: , Optional (str) update_group: , Optional (str) filter_group: , Optional (str) refresh_request_status: , Optional (str) route_refresh_request_received: , Optional (str) route_refresh_request_sent: , Optional (str) route_map_name_in: , Optional (str) route_map_name_out: , Optional (str) accepted_prefixes: , Optional (str) best_paths: , Optional (str) exact_no_prefixes_denied: , Optional (str) cummulative_no_prefixes_denied: , Optional (str) cummulative_no_no_policy: , Optional (str) cummulative_no_failed_rt_match: , Optional (str) cummulative_no_by_orf_policy: , Optional (str) cummulative_no_by_policy: , Optional (str) prefix_advertised: , Optional (str) prefix_suppressed: , Optional (str) prefix_withdrawn: , Optional (str) maximum_prefix_max_prefix_no: , Optional (str) maximum_prefix_threshold: , Optional (str) maximum_prefix_restart: , Optional (str) maximum_prefix_warning_only: , Optional (str) eor_status: , Optional (str) last_ack_version: , Optional (str) last_synced_ack_version: , Optional (str) outstanding_version_objects_current: , Optional (str) outstanding_version_objects_max: , Optional (str) additional_paths_operation: , Optional (str) additional_routes_local_label: , Optional (str) allowas_in: , Optional (str) allowas_in_as_number: , Optional (str) route_reflector_client: , Optional (str) send_community: , Optional (str) soft_configuration: , Optional (str) as_override: , Optional (str) default_originate: , Optional (str) default_originate_route_map: , Optional (str) send_multicast_attributes: , Optional (str) soo: }}, Optional (str) bgp_session_transport: {Optional (str) connection: {Optional (str) state: , Optional (str) mode: , Optional (str) last_reset: , Optional (str) reset_reason: , Optional (str) connections_established: , Optional (str) connections_dropped: , Optional (str) ttl_security: , Optional (str) external_bgp_neighbor_hop_count: }, Optional (str) transport: {Optional (str) local_host: , Optional (str) local_port: , Optional (str) if_handle: , Optional (str) foreign_host: , Optional (str) foreign_port: , Optional (str) mss: , Optional (str) passive_mode: }}}}}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -2969,7 +2969,7 @@ "c9300": { "doc": "Parser for show environment all", "groups": [], - "schema": "{'switch': {Any (str) *: {'fan': {Any (str) *: {'state': , Optional (str) direction: , Optional (str) speed: }}, 'power_supply': {Any (str) *: {Optional (str) state: , Optional (str) pid: , Optional (str) serial_number: , 'status': , Optional (str) system_power: , Optional (str) poe_power: , Optional (str) watts: }}, Optional (str) system_temperature_state: , Optional (str) inlet_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) outlet_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) hotspot_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) asic_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }}}}", + "schema": "{Optional (str) sensor_list: {'location': {Any (str) *: {'sensor': {Any (str) *: {'state': , 'reading': , Optional (str) range: {'min': , 'max': }}}}}}, 'switch': {Any (str) *: {'fan': {Any (str) *: {'state': , Optional (str) direction: , Optional (str) speed: }}, 'power_supply': {Any (str) *: {Optional (str) state: , Optional (str) pid: , Optional (str) serial_number: , 'status': , Optional (str) system_power: , Optional (str) poe_power: , Optional (str) watts: }}, Optional (str) system_temperature_state: , Optional (str) inlet_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) outlet_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) hotspot_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }, Optional (str) asic_temperature: {'value': , 'state': , 'yellow_threshold': , 'red_threshold': }}}}", "source": { "class": "genie.harness.base.Template" }, @@ -9575,7 +9575,7 @@ "ios": { "doc": "Parser for show spanning-tree [mst|vlan ]", "groups": [], - "schema": "{Any (str) *: {Any (str) *: {Any (str) *: {Any (str) *: {'priority': , 'address': , Optional (str) cost: , Optional (str) port: , Optional (str) interface: , Optional (str) configured_bridge_priority: , Optional (str) sys_id_ext: , 'hello_time': , 'max_age': , 'forward_delay': , Optional (str) aging_time: }, 'interfaces': {Any (str) *: {'role': , 'port_state': , 'cost': , 'port_priority': , 'port_num': , 'type': , Optional (str) peer: , Optional (str) bound: }}}}}}", + "schema": "{Any (str) *: {Any (str) *: {Any (str) *: {Optional (str) vlans_mapped: , Any (str) *: {'priority': , 'address': , Optional (str) cost: , Optional (str) port: , Optional (str) interface: , Optional (str) configured_bridge_priority: , Optional (str) configured_root_priority: , Optional (str) sys_id_ext: , Optional (str) rem_hops: , Optional (str) hello_time: , Optional (str) max_age: , Optional (str) forward_delay: , Optional (str) aging_time: }, 'interfaces': {Any (str) *: {'role': , 'port_state': , 'cost': , 'port_priority': , 'port_num': , 'type': , Optional (str) peer: , Optional (str) bound: }}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -9588,7 +9588,7 @@ "doc": "Parser for show spanning-tree [mst|vlan ]", "exclude": [], "groups": [], - "schema": "{Any (str) *: {Any (str) *: {Any (str) *: {Any (str) *: {'priority': , 'address': , Optional (str) cost: , Optional (str) port: , Optional (str) interface: , Optional (str) configured_bridge_priority: , Optional (str) sys_id_ext: , 'hello_time': , 'max_age': , 'forward_delay': , Optional (str) aging_time: }, 'interfaces': {Any (str) *: {'role': , 'port_state': , 'cost': , 'port_priority': , 'port_num': , 'type': , Optional (str) peer: , Optional (str) bound: }}}}}}", + "schema": "{Any (str) *: {Any (str) *: {Any (str) *: {Optional (str) vlans_mapped: , Any (str) *: {'priority': , 'address': , Optional (str) cost: , Optional (str) port: , Optional (str) interface: , Optional (str) configured_bridge_priority: , Optional (str) configured_root_priority: , Optional (str) sys_id_ext: , Optional (str) rem_hops: , Optional (str) hello_time: , Optional (str) max_age: , Optional (str) forward_delay: , Optional (str) aging_time: }, 'interfaces': {Any (str) *: {'role': , 'port_state': , 'cost': , 'port_priority': , 'port_num': , 'type': , Optional (str) peer: , Optional (str) bound: }}}}}}", "source": { "class": "genie.harness.base.Template" }, @@ -9680,7 +9680,7 @@ "ios": { "doc": "Parser for show show spanning-tree summary", "groups": [], - "schema": "{Optional (str) etherchannel_misconfig_guard: , Optional (str) extended_system_id: , Optional (str) portfast_default: , 'bpdu_guard': , Optional (str) bpdu_filter: , Optional (str) bridge_assurance: , Optional (str) loop_guard: , Optional (str) uplink_fast: , Optional (str) backbone_fast: , Optional (str) root_bridge_for: , Optional (str) pvst_simulation: , Optional (str) pvst_simulation_status: , Optional (str) platform_pvst_simulation: , Optional (str) configured_pathcost: {'method': , Optional (str) operational_value: }, Optional (str) mode: {Any (str) *: {Any (str) *: {'blocking': , 'listening': , 'learning': , 'forwarding': , 'stp_active': }}}, 'total_statistics': {'blockings': , 'listenings': , 'learnings': , 'forwardings': , 'stp_actives': , Optional (str) num_of_msts: , Optional (str) num_of_vlans: }}", + "schema": "{Optional (str) etherchannel_misconfig_guard: , Optional (str) extended_system_id: , Optional (str) portfast_default: , 'bpdu_guard': , Optional (str) bpdu_filter: , Optional (str) bridge_assurance: , Optional (str) loop_guard: , Optional (str) uplink_fast: , Optional (str) backbone_fast: , Optional (str) root_bridge_for: , Optional (str) pvst_simulation: , Optional (str) pvst_simulation_status: , Optional (str) platform_pvst_simulation: , Optional (str) bpdu_sender_conflict: , Optional (str) configured_pathcost: {'method': , Optional (str) operational_value: }, Optional (str) mode: {Any (str) *: {Any (str) *: {'blocking': , 'listening': , 'learning': , 'forwarding': , 'stp_active': }}}, 'total_statistics': {'blockings': , 'listenings': , 'learnings': , 'forwardings': , 'stp_actives': , Optional (str) num_of_msts: , Optional (str) num_of_vlans: }}", "source": { "class": "genie.harness.base.Template" }, @@ -9693,7 +9693,7 @@ "doc": "Parser for show show spanning-tree summary", "exclude": [], "groups": [], - "schema": "{Optional (str) etherchannel_misconfig_guard: , Optional (str) extended_system_id: , Optional (str) portfast_default: , 'bpdu_guard': , Optional (str) bpdu_filter: , Optional (str) bridge_assurance: , Optional (str) loop_guard: , Optional (str) uplink_fast: , Optional (str) backbone_fast: , Optional (str) root_bridge_for: , Optional (str) pvst_simulation: , Optional (str) pvst_simulation_status: , Optional (str) platform_pvst_simulation: , Optional (str) configured_pathcost: {'method': , Optional (str) operational_value: }, Optional (str) mode: {Any (str) *: {Any (str) *: {'blocking': , 'listening': , 'learning': , 'forwarding': , 'stp_active': }}}, 'total_statistics': {'blockings': , 'listenings': , 'learnings': , 'forwardings': , 'stp_actives': , Optional (str) num_of_msts: , Optional (str) num_of_vlans: }}", + "schema": "{Optional (str) etherchannel_misconfig_guard: , Optional (str) extended_system_id: , Optional (str) portfast_default: , 'bpdu_guard': , Optional (str) bpdu_filter: , Optional (str) bridge_assurance: , Optional (str) loop_guard: , Optional (str) uplink_fast: , Optional (str) backbone_fast: , Optional (str) root_bridge_for: , Optional (str) pvst_simulation: , Optional (str) pvst_simulation_status: , Optional (str) platform_pvst_simulation: , Optional (str) bpdu_sender_conflict: , Optional (str) configured_pathcost: {'method': , Optional (str) operational_value: }, Optional (str) mode: {Any (str) *: {Any (str) *: {'blocking': , 'listening': , 'learning': , 'forwarding': , 'stp_active': }}}, 'total_statistics': {'blockings': , 'listenings': , 'learnings': , 'forwardings': , 'stp_actives': , Optional (str) num_of_msts: , Optional (str) num_of_vlans: }}", "source": { "class": "genie.harness.base.Template" }, diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py index 5bdc5bd7b..ab67a33e5 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/__init__.py @@ -7,7 +7,7 @@ ''' # metadata -__version__ = '23.10' +__version__ = '23.11' __author__ = 'Cisco Systems Inc.' __contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com'] __copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.' diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py index 4cbaaeea2..313a3628b 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/acl/configure.py @@ -1926,7 +1926,7 @@ def unconfigure_filter_vlan_list(device, vlan_access_name, vlan_id): Raises: SubCommandFailure """ - cmd = f"vlan filter {vlan_access_name} vlan-list {vlan_id}" + cmd = f"no vlan filter {vlan_access_name} vlan-list {vlan_id}" try: device.configure(cmd) except SubCommandFailure as e: @@ -2034,3 +2034,79 @@ def configure_arp_acl(device, name, action, source, sender_mac='', mac_mask='', device.configure(config) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure arp acl on the device {device.name}. Error:\n{e}") + +def configure_access_map_match_ip_mac_address(device, vlan_access_name, value, acl_name, action): + """ Configuring access map match ip mac address + + Args: + device ('obj'): device to use + vlan_access_name ('str'): name of vlan to access + vlaue ('str'): describe mac (or) ip + acl_name ('str'): name of acl_name + action ('str'): forward (or) drop + Returns: + None + + Raises: + SubCommandFailure + """ + cmd = [ + f"vlan access-map {vlan_access_name}", + f"match {value} address {acl_name}", + f"action {action}", + ] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure access map match ip mac address on the device {device.name}. Error:\n{e}") + +def configure_acl_protocol_port(device, ip_protocol_version, acl_name, acl_action, protocol, port_operation, src_port, dst_port): + """ Configure acl protocol port + + Args: + device ('obj'): device to use + ip_protocol_version ('str'): define ip (or) ipv6 + acl_name ('str'): name of acl + acl_action ('str'): permit (or) deny + protocol ('str'): protocol details + port_operation ('str'): name of port operation ex: range , eq, gt, lt + src_port (int): src port details + dst_port (int): dst port details + Returns: + None + + Raises: + SubCommandFailure + """ + cmd = [] + if ip_protocol_version == "ip": + cmd.append(f"{ip_protocol_version} access-list extended {acl_name}") + else: + cmd.append(f"{ip_protocol_version} access-list {acl_name}") + cmd.append(f"{acl_action} {protocol} any any {port_operation} {src_port} {dst_port}") + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure acl protocol port {device.name}. Error:\n{e}") + +def configure_ip_acl_with_any(device, acl_name, acl_action): + """ Configuring ip ACL with any + Example: ip access-lists extended ip_acl + permit ip any any + Args: + device ('obj'): device to use + acl_name ('str'): name of the ACL to which the entry belongs + acl_action ('str'): (permit | deny) permits or denies Layer 2 traffic + Returns: + None + Raises: + SubCommandFailure + """ + acl_action = acl_action.strip().lower() + assert acl_action in ('permit', 'deny'), f"{acl_action} is an invalid action type" + config = [f"ip access-list extended {acl_name}", + f"{acl_action} ip any any"] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure ip acl with any on the device {device.name}. Error:\n{e}") \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/configure.py new file mode 100644 index 000000000..ee3e1022c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/configure.py @@ -0,0 +1,33 @@ +"""Configure cpp related command""" + +# Python +import re +import logging + +# Unicon +from unicon.eal.dialogs import Statement, Dialog +from unicon.core.errors import SubCommandFailure + +logger = logging.getLogger(__name__) + +def enable_cpp_system_default_on_device(device): + """ Enable cpp system-default on device + Args: + device ('obj'): Device object + Returns: + None + Raises: + SubCommandFailure : Failed to enable cpp system-default on device + """ + logger.debug(f"Enable cpp system-default on device {device}") + + configs = [ + "cpp system-default" + ] + + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to enable cpp system-default under {device}. Error:\n{e}" + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/execute.py new file mode 100644 index 000000000..56b69f66a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/cpp/execute.py @@ -0,0 +1,33 @@ +"""Execute cpp related command""" + +# Python +import re +import time +import logging + +# Unicon +from unicon.core.errors import SubCommandFailure +from unicon.eal.dialogs import Statement, Dialog +from unicon.eal.expect import Spawn, TimeoutError + +log = logging.getLogger(__name__) + +def execute_clear_control_plane(device): + """ execute clear control-plane all in switch + Args: + device ('obj'): Device object + Returns: + Execution output + Raises: + SubCommandFailure + """ + log.debug(f"execute clear control-plane all on {device}") + + cmd = 'clear control-plane *' + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to do clear control-plane all on device {device}. Error:\n{e}" + ) + \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py index a7292b779..ac8fd5373 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/device_tracking/configure.py @@ -138,4 +138,46 @@ def configure_source_tracking_on_interface(device, interface, value): except SubCommandFailure as e: raise SubCommandFailure( f"Could not configure source tracking on {interface}. Error:\n{e}" - ) \ No newline at end of file + ) + +def configure_device_tracking_logging(device, logging_type='drop'): + """Configure device tracking logging + Args: + device (obj): Device object. + logging_type (str): Type of logging to configure ex:'packet','theft',or'resolution-veto' (default is 'drop') + Returns: + None + Raises: + SubCommandFailure + ValueError: If an invalid logging_type is provided. + """ + if logging_type=="packet": + config = f"device-tracking logging {logging_type} drop" + else: + config = f"device-tracking logging {logging_type}" + + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to configure device tracking logging on {device.name}\n{e}') + +def unconfigure_device_tracking_logging(device, logging_type='drop'): + """unconfigure device tracking logging + Args: + device (obj): Device object. + logging_type (str): Type of logging to configure ex:'packet','theft',or'resolution-veto' (default is 'drop') + Returns: + None + Raises: + SubCommandFailure + ValueError: If an invalid logging_type is provided. + """ + if logging_type=="packet": + config = f"no device-tracking logging {logging_type} drop" + else: + config = f"no device-tracking logging {logging_type}" + + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to unconfigure device tracking logging on {device.name}\n{e}') \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py index c97b286c5..113fa0fa1 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/dhcp/configure.py @@ -1261,6 +1261,7 @@ def configure_dhcp_pool(device, pool_name, router_id=None, network=None, mask=No except SubCommandFailure as e: raise SubCommandFailure(f'Could not configure dhcp pool. Error: {e}') + def unconfigure_dhcp_pool(device, pool_name, router_id=None, network=None, mask=None, vrf=None, dns_server=None): """ Unconfigure DHCP pool Args: @@ -1387,6 +1388,7 @@ def unconfigure_propagate_sgt(device, interface, type, cts_type): cts_type ('str'): policy CTS policy for manual mode propagate CTS SGT Propagation configuration for manual mode sap CTS SAP configuration for manual mode + sap CTS SAP configuration for manual mode Return: None Raises: @@ -1521,3 +1523,131 @@ def unconfigure_interface_range_dhcp_channel_group_mode(device, start_interface, raise SubCommandFailure( f'Failed to unconfigure DHCP channel-group mode {mode}\n{e}' ) + +def unconfigure_ip_dhcp_snooping_limit_rate(device, interface, rate_limit): + """ Unconfigure DHCP snooping limit on interface + Unconfigure 'no ip dhcp snooping limit' on interface + Args: + device ('obj'): device to use + interface ('str'): interface to configure + rate_limit('int'): DHCP snooping rate limit + Returns: + None + Raises: + SubCommandFailure: Failed unconfiguring DHCP snooping limit rate on interface + """ + log.debug("Unconfigure DHCP snooping limit rate on interface") + config = [ + f"interface {interface}", + f"no ip dhcp snooping limit rate {rate_limit}", + ] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not remove DHCP snooping limit configuration on interface {interface}. Error\n{e}" + ) + +def unconfigure_ip_dhcp_snooping_verify_mac_address(device): + """ Unconfigure ip_dhcp_snooping_verify_mac_address + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure: Failed unconfiguring DHCP snooping verify mac-address + """ + log.debug("Unconfigure ip_dhcp_snooping_verify_mac_address") + try: + device.configure('no ip dhcp snooping verify mac-address') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not remove DHCP snooping verify mac-address. Error\n{e}" + ) + +def configure_ip_dhcp_snooping_verify_mac_address(device): + """ Configure ip_dhcp_snooping_verify_mac_address + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure: Failed configuring DHCP snooping verify mac-address + """ + log.debug("Configure ip_dhcp_snooping_verify_mac_address") + try: + device.configure('ip dhcp snooping verify mac-address') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure DHCP snooping verify mac-address. Error\n{e}" + ) + +def configure_dhcp_snooping_verify_no_relay_agent_address(device): + """ Configure DHCP snooping verify no-relay-agent-address on global + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure: Failed Configuring DHCP snooping verify no-relay-agent-address. + """ + log.debug("Configure DHCP snooping verify no-relay-agent-address on global") + try: + device.configure('ip dhcp snooping verify no-relay-agent-address') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure DHCP snooping verify no-relay-agent-address. Error\n{e}" + ) + +def unconfigure_dhcp_snooping_verify_no_relay_agent_address(device): + """ Unconfigure DHCP snooping verify no-relay-agent-address on global + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure: Failed unconfiguring DHCP snooping verify no-relay-agent-address + """ + log.debug("Unconfigure DHCP snooping verify no-relay-agent-address on global") + try: + device.configure('no ip dhcp snooping verify no-relay-agent-address') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not remove DHCP snooping verify no-relay-agent-address. Error\n{e}" + ) + +def configure_dhcp_snooping_track_server_dhcp_acks(device): + """ Configure DHCP snooping server track dhcp_acks on global + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure: Failed Configuring DHCP snooping server track dhcp_acks + """ + log.debug("Configure DHCP snooping server track dhcp_acks on global") + try: + device.configure('ip dhcp snooping track server all-dhcp-acks') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure DHCP snooping server track all-dhcp-ack. Error\n{e}" + ) + +def unconfigure_dhcp_snooping_track_server_dhcp_acks(device): + """ Unconfigure DHCP snooping server track dhcp_acks on global + Args: + device ('obj'): device to use + Returns: + None + Raises: + SubCommandFailure: Failed Unconfiguring DHCP snooping server track dhcp_acks + """ + log.debug("Unconfigure DHCP snooping server track dhcp_acks on global") + try: + device.configure('no ip dhcp snooping track server all-dhcp-acks') + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not remove DHCP snooping server track all-dhcp-ack. Error\n{e}" + ) + + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/configure.py index 473766c1e..a2e93944d 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/configure.py @@ -54,4 +54,4 @@ def configure_hw_module_slot_shutdown(device, slot): raise SubCommandFailure( "Could not shutdown hw-module slot {slot}. Error:\n{error}" .format(slot=slot, error=e) - ) \ No newline at end of file + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/execute.py index b686fdb31..dab85d290 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/hw_module/execute.py @@ -30,4 +30,28 @@ def hw_module_switch_usbflash_security_password(device, switch_number, action, p except SubCommandFailure as e: raise SubCommandFailure( f"Could not {action} hw-module on device {device}. Error:\n{e}") - return output \ No newline at end of file + return output + + +def hw_module_sub_slot_reload(device, sub_slot): + """ hw-module sub-slot {slot} reload force + Args: + device (`obj`): Device object + sub_slot (`str`): sub_slot + + Returns: + Shutdown Status + + Raises: + SubCommandFailure : Failed configuring device + """ + cmd = 'hw-module subslot {slot} reload force\n'.format(slot=sub_slot) + try: + return device.execute(cmd) + + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not reload hw-module slot {slot}. Error:\n{error}" + .format(slot=sub_slot, error=e) + ) + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py index 3039355f2..bd30252d2 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/install/execute.py @@ -258,7 +258,7 @@ def slow_sendline(spawn): def execute_install_one_shot(device, file_path=None, prompt=True, issu=False, - negative_test=False, timeout=900, connect_timeout=10, xfsu=False): + negative_test=False, timeout=900, connect_timeout=10, xfsu=False, reloadfast=False): """ Performs install one shot on the device Args: @@ -271,7 +271,8 @@ def execute_install_one_shot(device, file_path=None, prompt=True, issu=False, timeout ('int, optional'): Timeout value connect_timeout ('int, optional'): Time to wait before sending the prompt (when pattern "Press RETURN to get - started" matches) + started" matches)) + reloadfast('bool, optional'): Force the operation to use reloadfast. Returns: True if install one shot is successful False if install one shot is not successful @@ -315,6 +316,9 @@ def slow_sendline(spawn): if xfsu: cmd += f" xfsu" + if reloadfast: + cmd += f" reloadfast" + cmd += " commit" if not prompt: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py index 4fe848dd5..487510823 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/interface/configure.py @@ -9591,3 +9591,48 @@ def configure_interface_range_no_switchport(device, start_interface, end_interfa device.configure(config) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to configure interface range no switchport on device {device}. Error:\n{e}") + +def enable_switchport_protected_on_interface(device, interface): + """ Enable switchport protected on interface + Args: + device ('obj'): Device object + interface ('str'): interface name to enable switchport protected + Returns: + None + Raises: + SubCommandFailure : Failed to enable switchport protected on interface + """ + log.debug(f"Enable switchport protected on interface {interface}") + + configs = [ + f"interface {interface}", + "switchport protected" + ] + + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to enable switchport protected under {interface}. Error:\n{e}" + ) + +def unconfigure_interface_speed(device, interface): + """ unconfigure speed on interface + Args: + device (`obj`): Device object + interface (`str`): Interface name + Returns: + None + Raises: + SubCommandFailure + """ + + config = [ + f'interface {interface}', + 'no speed' + ] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not unconfigure speed on {interface}. Error:\n{e}") + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py index e87701fa3..05ec2325b 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ipv6/clear.py @@ -98,4 +98,20 @@ def clear_ipv6_ospf_process(device): "Could not clear ipv6 ospf process on {device}. Error:\n{error}".format( device=device, error=e ) - ) \ No newline at end of file + ) + +def clear_ipv6_neighbors(device): + """ + clear ipv6 neighbors + Args: + device ('obj'): Device object + Returns: + None + Raises: + SubcommandFailure: Failed executing command + """ + log.debug("Clearing ipv6 neighbors") + try: + device.execute("clear ipv6 neighbors") + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to clear ipv6 neighbors on {device}. Error:\n{e}") \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/__init__.py index e69de29bb..d9db3add3 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/__init__.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/__init__.py @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py index c4c20b7f9..afffc2baf 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/configure.py @@ -664,45 +664,6 @@ def unconfigure_mka_keychain_on_interface(device, interface, key_string, key_cha ) ) -def configure_pki_trustpoint(device, key_type, label_name, - modulus_size, enrollment_type, subject_line, revocation_check, - storage_type): - """ Configures Trustpoint related config on device - - Args: - device ('obj'): device to use - key_type ('str'): Key type to be generated - label_name ('str'): Label name - modulus_size ('str'): Modulus size to be configured - enrollment_type ('str'): Enrollment type to be configured - subject_line ('str'): Subject Line to be configured - revocation_check ('str'): Revocation check to be configured - storage_type ('str'): Storage type to be configured - - Returns: - None - - Raises: - SubCommandFailure - """ - log.debug("Configure Trustpoint on device") - - configs = [ - f"crypto key generate {key_type} label {label_name} modulus {modulus_size}", - f"crypto pki trustpoint {label_name}", - f"enrollment {enrollment_type}", - f"subject-name {subject_line}", - f"revocation-check {revocation_check}", - f"rsakeypair {label_name}", - f"storage {storage_type}"] - - try: - device.configure(configs) - except SubCommandFailure as e: - raise SubCommandFailure( - "Could not configure Trustpoint related config on device " - "Error: {error}".format(error=e) - ) def unconfigure_pki_trustpoint(device, label_name): """ Unconfigures Trustpoint related config on device @@ -890,4 +851,49 @@ def unconfigure_disable_sci_dot1q_clear(device, "Could not unconfigure MACSec with disable-sci and/or dot1q-in-clear" "Error: {error}".format(error=e) ) - \ No newline at end of file + +def configure_pki_trustpoint(device, key_type=None, label_name=None, + modulus_size=None, enrollment_type=None, subject_line=None, revocation_check=None, + storage_type=None): + """ Configures Trustpoint related config on device + + Args: + device ('obj'): device to use + key_type ('str', Optional): Key type to be generated. Defaults to None + label_name ('str', Optional): Label name. Defaults to None + modulus_size ('str', Optional): Modulus size to be configured. Defaults to None + enrollment_type ('str', Optional): Enrollment type to be configured. Defaults to None + subject_line ('str', Optional): Subject Line to be configured. Defaults to None + revocation_check ('str', Optional): Revocation check to be configured. Defaults to None + storage_type ('str', Optional): Storage type to be configured. Defaults to None + + Returns: + None + + Raises: + SubCommandFailure + """ + log.debug("Configure Trustpoint on device") + try: + configs = [] + if key_type and label_name and modulus_size: + configs.append(f"crypto key generate {key_type} label {label_name} modulus {modulus_size}") + if label_name: + configs.append(f"crypto pki trustpoint {label_name}") + if enrollment_type: + configs.append(f"enrollment {enrollment_type}") + if subject_line: + configs.append(f"subject-name {subject_line}") + if revocation_check: + configs.append(f"revocation-check {revocation_check}") + if key_type and label_name and modulus_size: + configs.append(f"rsakeypair {label_name}") + if storage_type: + configs.append(f"storage {storage_type}") + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not configure Trustpoint related config on device " + "Error: {error}".format(error=e) + ) + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/execute.py new file mode 100644 index 000000000..eb28aa3ef --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/macsec/execute.py @@ -0,0 +1,121 @@ +# Python +import logging +import time + +# Unicon +from unicon.core.errors import SubCommandFailure +from unicon.eal.dialogs import Dialog, Statement + +# Logger +log = logging.getLogger(__name__) + +def execute_crypto_pki_server(device, certificate_req, server_name, + copy_certificate, sleep_time=5): + """ Config execute crypto pki server + Args: + device ('obj'): device object + certificate_req ('str'): certificate request options like + server_name('str'): CA Server Name + copy_certificate(str): CA certificate copy + sleep_time(int) : sleep time + Return: + None + Raises: + SubCommandFailure: Failed execute device + """ + + def send_certificate(spawn): + time.sleep(sleep_time) + spawn.sendline(f'{copy_certificate}') + spawn.sendline() + + dialog = Dialog([ + Statement(pattern=r'.*End with a blank line or the word \"quit\" on a line by itself.*', + action=send_certificate, + loop_continue=True, + continue_timer=False)]) + + cmd = f"crypto pki {certificate_req} {server_name}" + + try: + if certificate_req == 'authenticate': + device.execute(cmd, reply=dialog) + else: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not execute crypto pki action server. Error:\n{e}") + +def execute_test_opssl_nonblockingsession_client(device, version, host_ip_addr, port_number, + num_connections,num_messages, pre_key, + identity_check, identity_label,verfiy_label): + """ + Execute test opssl nonblockingsession client + Args: + device ('obj'): device object + version('int'): server versions + host_ip_addr('int'): peer's IP address + port_number('int'): port number for connect or accept <1-10000> + num_connections('int'): Number of connections <1-50> + num_messages('int'): number of messages before sending close notification <1-100> + pre_key('int'): Pre-shared key <16-134217727> + identity_check('int'): Disable/Enable Server Identity Check <0-1> + identity_label('int'): Identity TrustPoint label + verfiy_label('str'): Verification TrustPoint label + Return: + None + Raises: + SubCommandFailure: Failed configuring device + """ + cmd=f"test opssl nonblockingsession client {version} {host_ip_addr} {port_number} {num_connections} {num_messages} {pre_key} {identity_check} {identity_label} {verfiy_label}" + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure test opssl nonblockingsession client. Error:\n{e}") + + +def execute_test_opssl_nonblockingsession_server_stop(device, session_mode, version, test_server): + """ Execute opssl nonblockingsession server stop + Args: + device ('obj'): device object + session_mode ('str'): Session modes + version('str'): server versions + test_server('str'): OPSSL test-server + Return: + None + Raises: + SubCommandFailure: Failed execute device + """ + cmd = f"test opssl nonblockingsession {session_mode} {version} {test_server}" + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not execute test opssl nonblockingsession. Error:\n{e}") + +def execute_test_opssl_nonblockingsession_server_start(device, version, test_server, + host_ip_addr, port_number,pre_key, + identity_check,identity_label, verfiy_label): + """ Execute opssl nonblockingsession server tls1.2 start + Args: + device ('obj'): device object + version('str'): server versions + test_server('str'): OPSSL test-server + host_ip_addr(int): host IP address + port_number('int'): port number for connect or accept <1-10000> + pre_key('int'): Pre-shared key <16-134217727> + identity_check('int'): Disable/Enable Server Identity Check <0-1> + identity_label('str'): Identity TrustPoint label + verfiy_label ('str'): Verification TrustPoint label + Return: + None + Raises: + SubCommandFailure: Failed execute device + """ + cmd = f"test opssl nonblockingsession server {version} {test_server} {host_ip_addr} {port_number} {pre_key} {identity_check} {identity_label} {verfiy_label}" + try: + device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not execute test opssl nonblockingsession server tls1.2 start. Error:\n{e}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py index 03e323563..41145f8c9 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ogacl/configure.py @@ -472,6 +472,49 @@ def unconfigure_ipv6_acl_on_interface(device, interface, acl_name, inbound=True) acl=acl_name, interface=interface, error=e, ) ) + +def configure_object_group(device, group, object_group_name, protocol=None, option=None, port=None, network_option=None, ip_address_1=None, ip_address_2=None): + """Configure object group service name + Args: + device ('obj'): device object + group ('str'): group name + object_group_name ('str'): object-group name + protocol('str') : eg: tcp,udp,tcp-udp,eigrp + option ('str') : eg: lt,eq,gt + port ('str') : eg: telnet,ssh + network_option ('str') : eg: host,range + ip_address_1 ('str') : eg: 1.1.1.1 test + ip_address_2 ('str') : eg 2.2.2.2 /24 + Return: + None + Raises: + SubCommandFailure + """ + config= [ + f'object-group {group} {object_group_name}' + ] + if group=="service" and protocol not in ['udp','tcp','tcp-udp','icmp']: + config.append(protocol) + elif group=="service" and protocol in ['udp','tcp','tcp-udp','icmp']: + if option in ['lt','gt','eq','range']: + config.append(f"{protocol} {option} {port}") + else : + config.append(f"{protocol} {port}") + elif group=="network" and network_option=="range": + config.append(f"{network_option} {ip_address_1} {ip_address_2}") + elif group=="network" and network_option=="host": + config.append(f"{network_option} {ip_address_1}") + elif group=="network" and network_option==None: + config.append(f"{ip_address_1} {ip_address_2}") + + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to Configure object group service name on {device.name}\n{e}' + ) + + def configure_ipv4_object_group_network(device, og_name, description, ipv4_address, netmask): """ Configure ipvv4 object group of network type diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py index 4349ee4f4..aa99d7514 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/ospf/configure.py @@ -2757,4 +2757,25 @@ def configure_ospfv3_interface(device, interface, process_id): except SubCommandFailure as e: raise SubCommandFailure( f"Failed to configure OSPFv3 on interface {interface}. Error:\n{e}" + ) + +def configure_ospf_vrf_lite(device, ospf_process_id, vrf_name): + """Configure vrf-lite capabilty for OSPF process. + Args: + device (`obj`): Device object + ospf_process_id (`str`): OSPF Process ID (1-65535) + vrf_name (`str`): VRF name (Eg : 'vrf1') + Returns: + None + Raises: + SubCommandFailure + """ + try: + cmd = [f"router ospf {ospf_process_id} vrf {vrf_name}", + f"capability vrf-lite"] + device.configure(cmd) + + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to configure vrf-lite capability for OSPF process {ospf_process_id}. Error:\n{e}" ) \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py index d17e537c2..8171f0417 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/pki/configure.py @@ -276,6 +276,8 @@ def configure_trustpoint(device, sub_alt_name=None, usage_option=None, vrf=None, + sub_name=None, + ike=None, is_ec_key=None): ''' @@ -351,7 +353,6 @@ def configure_trustpoint(device, logger.debug("configuring crypto pki trustpoint") tp_config = [] tp_config.append(f"crypto pki trustpoint {tp_name}") - tp_config.append("usage ike") tp_config.append(f"revocation-check {revoke_check}") if is_ec_key: tp_config.append(f"eckeypair {tp_name}") @@ -466,6 +467,10 @@ def configure_trustpoint(device, tp_config.append(f"storage {storage_location}") if sub_alt_name is not None: tp_config.append(f"subject-alt-name {sub_alt_name}") + if sub_name is not None: + tp_config.append(f"subject-name {sub_name}") + if ike is not None: + tp_config.append("usage ike") if usage_option is not None: tp_config.append(f"usage {usage_option}") if vrf is not None: @@ -553,7 +558,8 @@ def unconfigure_trustpoint(device, def configure_pki_enroll(device, tp_name, - password): + password, + serial_sub_name=False): ''' Configuring crypto pki enroll Args: @@ -565,6 +571,7 @@ def configure_pki_enroll(device, Raises: SubCommandFailure ''' + serial_sub_name_value = 'yes' if serial_sub_name else 'no' dialog = Dialog([ Statement(pattern=r'.*Do you want to continue with re\-enrollment\? \[yes/no\].*', @@ -580,7 +587,7 @@ def configure_pki_enroll(device, loop_continue=True, continue_timer=False), Statement(pattern=r'.*Include the router serial number in the subject name\? \[yes/no\].*', - action=f'sendline(no)', + action=f'sendline({serial_sub_name_value})', loop_continue=True, continue_timer=False), Statement(pattern=r'.*Include an IP address in the subject name\? \[no\].*', @@ -810,7 +817,7 @@ def configure_pki_export(device, pem_url ('str'): pem file url prvt_key_encry ('str'): Encrypt the private key Returns: - None + certificate Raises: SubCommandFailure ''' @@ -850,12 +857,12 @@ def configure_pki_export(device, elif pem_option == 'terminal': if prvt_key_encry == 'rollover': export_config = ( - f"crypto pki import {tp_name} pem terminal {prvt_key_encry}") + f"crypto pki export {tp_name} pem terminal {prvt_key_encry}") else: export_config = ( - f"crypto pki import {tp_name} pem terminal {prvt_key_encry} password {file_password}") + f"crypto pki export {tp_name} pem terminal {prvt_key_encry} password {file_password}") try: - device.configure(export_config, reply=dialog, + output = device.configure(export_config, reply=dialog, error_pattern=error_patterns) except SubCommandFailure as e: @@ -864,6 +871,8 @@ def configure_pki_export(device, "Error:\n{error}".format(error=e) ) ) + # Returns the exported certificate + return output def change_pki_server_state(device, server_name, @@ -893,4 +902,50 @@ def change_pki_server_state(device, "Error:\n{error}".format(error=e) ) ) - return True \ No newline at end of file + return True + +def configure_pki_authenticate_certificate(device, certificate, label_name): + """ Pastes certificate on device + Args: + device (`obj`): Device object + certificate ('str'): Certificate to be pasted + label_name ('str'): Label name + Returns: + None + Raise: + SubCommandFailure: Failed to paste certificate on device + """ + def cert_key_handler(spawn, data): + spawn.sendline(data) + spawn.sendline('quit') + + dialog = Dialog( + [ + Statement( + r"^.*Are you sure you want to do this\? \[yes/no\]\s?.*$", + action="sendline(yes)", + loop_continue=True, + ), + Statement( + r'^.*End with a blank line or the word "quit" on a line by itself\s?.*', + action=cert_key_handler, + args={"data": certificate}, + loop_continue=True, + continue_timer=False + ), + Statement( + r".*Do you accept this certificate\? \[yes/no\]:.*", + action="sendline(yes)", loop_continue=True + ), + ] + ) + + try: + device.configure("crypto pki authenticate {label_name}" + .format(label_name=label_name), reply=dialog, timeout=200) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not Paste certificate on device " + "Error: {error}".format(error=e) + ) + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py index 85367d6f0..2571087dd 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/configure.py @@ -5359,3 +5359,142 @@ def configure_clear_logging_onboard_slot_temperature(device, slot): ) ) +def configure_qfp_drop_threshold(device, threshold, drop_id=None): + ''' + Configure drop warning threshold for the qfp. If drop_id is + unspecified, configure the total drop threshold, else + configure the per-cause drop threshold. + Args: + device ('obj'): device object + threshold ('int'): threshold value + drop_id ('int'): drop cause ID for which to set threshold + Returns: + None + Raises: + SubCommandFailure + ''' + if drop_id is not None: + cmd = f'platform qfp drops threshold per-cause {drop_id} {threshold}' + else: + cmd = f'platform qfp drops threshold total {threshold}' + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to configure qfp drop threshold on device {device.name}') + +def unconfigure_qfp_drop_threshold(device, threshold, drop_id=None): + ''' + Unconfigure drop warning threshold for the qfp. If drop_id is + unspecified, unconfigure the total drop threshold, else + unconfigure the per-cause drop threshold. + Args: + device ('obj'): device object + threshold ('int'): threshold value + drop_id ('int'): drop cause ID for which to unset threshold + Returns: + None + Raises: + SubCommandFailure + ''' + if drop_id is not None: + cmd = f'no platform qfp drops threshold per-cause {drop_id} {threshold}' + else: + cmd = f'no platform qfp drops threshold total {threshold}' + + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f'Failed to unconfigure qfp drop threshold on device {device.name}') + +def configure_ip_scp_server_enable(device): + """ Configure ip scp server enable + Args: + device ('obj'): Device object + """ + + cmd = 'ip scp server enable' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure ip scp server enable on device {device}. Error:\n{e}") + +def unconfigure_ip_scp_server_enable(device): + """ Unconfigure ip scp server enable + Args: + device ('obj'): Device object + """ + + cmd = 'no ip scp server enable' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to unconfigure ip scp server enable on device {device}. Error:\n{e}") + +def configure_ip_ssh_source_interface(device, interface): + """ Configure ip ssh source-interface {interface} + Args: + device ('obj'): Device object + interface (`str`): Interface name + """ + + cmd = f'ip ssh source-interface {interface}' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure ip ssh source-interface {interface} on device {device}. Error:\n{e}") + +def unconfigure_ip_ssh_source_interface(device): + """ Unconfigure ip ssh source-interface + Args: + device ('obj'): Device object + """ + + cmd = 'no ip ssh source-interface' + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to unconfigure ip ssh source-interface on device {device}. Error:\n{e}") + + +def unconfigure_time_range(device, time_range_name): + """Unconfigure time range + Args: + device ('obj'): device object + time_range_name ('str'): time range name + Return: + None + Raises: + SubCommandFailure + """ + config = [f'no time-range {time_range_name}'] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure( + f'Failed to unconfigure time range on {device.name}\n{e}' + ) + +def configure_event_manager(device, event, description,event_run_option, + event_run_value, action_name,action_option): + """ Configures event manager applet + Args: + device ('obj'): device to use + event ('str'): Name of the Event Manager applet + description('str'): description is name of event applet name + event_run_option('str'): event run specific action name (maxrun, ratelimlit, sync ..) + event_run_value('str'): event run action values (maxrun: <0-3675744>, sync:...) + action_name('str'): Lable name + action_option('str'): action need to provide to perform system (reload,syslog,track ....) + """ + + cmd = [ + f'event manager applet {event}', + f'description {description}', + f'event none {event_run_option} {event_run_value}', + f'action {action_name} {action_option}' + ] + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to configure event manager applet on device {device.name}. Error:\n{e}") \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py index f6e419098..88f5b62ab 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/platform/execute.py @@ -1366,25 +1366,63 @@ def execute_set_platform_hardware_fed_qos(device, mode, qos_type, interface, swi raise SubCommandFailure(f'Could not execute Fed qos interface on device, Error: {e}') -def execute_reload_fast(device, fast_type=None): - """ execute Halt and perform a cold restart for XFSU device +def execute_reload_fast(device, fast_type=None, username=None, password=None, prompt_wait_time=10, timeout=600): + """ Execute Halt and perform a cold restart for XFSU device Args: device ('obj'): device to use - fast_type ('fast_type', Optional): type can be "enhanced" or none based on versio + fast_type ('fast_type', Optional): type can be "enhanced" or none based on version + username ('username', Optional): Console username + password ('password', Optional): Console Password + timeout ('int, optional'): Timeout value (Default value - 600s) + prompt_wait_time ('int, optional'): Time to wait before sending the prompt(Default value - 10s) Returns: - None + True if reload fast is successful Raises: SubCommandFailure: Failed to execute Halt and perform a cold restart for XFSU device """ + log.debug(f"Performing Reload Fast on {device.name}") + + def slow_sendline(spawn): + time.sleep(prompt_wait_time) + spawn.sendline('') + + def send_password(spawn): + time.sleep(prompt_wait_time) + spawn.sendline(password) + + def send_username(spawn): + time.sleep(prompt_wait_time) + spawn.sendline(username) + + dialog = Dialog([ + Statement(pattern=r'.*\[y\/n\/q\]', + action='sendline(y)', loop_continue=True, continue_timer=True), + Statement(pattern=r'Press RETURN to get started', + action=slow_sendline, + loop_continue=True, continue_timer=True), + Statement(pattern=r'Username\:', + action=send_username, + loop_continue=True, continue_timer=True), + Statement(pattern=r'Password\:', + action=send_password, + loop_continue=True, continue_timer=False), + Statement(pattern=r'%s\>' % device.name, + action="sendline(enable)", + loop_continue=True, continue_timer=True)]) + cmd = "reload fast" if fast_type: cmd += f" {fast_type}" + try: - device.execute(cmd) - except SubCommandFailure as e: - raise SubCommandFailure(f"Failed to execute Halt and perform a cold restart for XFSU device {device}. Error:\n{e}") + device.execute(cmd, reply=dialog, timeout=timeout, append_error_pattern=['.*FAILED\:.*']) + log.debug(f"Reload Fast successfully executed") + return True + except SubCommandFailure as e: + raise SubCommandFailure( + f"Failed to execute and perform a reload fast for XFSU device {device}. Error:\n{e}") def config_smart_save_license_usage(device, day, file_name): """ configure smart save license usage @@ -1665,4 +1703,81 @@ def execute_platform_virtualization(device, slot_type, slot_status): f'Failed to execute set platform hardware rom-monitor virtualization {slot_type} {slot_status} on device {device.name}. Error:\n{e}' ) +def clear_ip_pim_rp_mapping(device): + """ clear ip pim rp-mapping + Args: + device (`obj`): Device object + Returns: + None + Raises: + SubCommandFailure + """ + log.debug(f"Clear ip pim rp-mapping on {device}") + + try: + device.execute('clear ip pim rp-mapping') + + except SubCommandFailure as e: + raise SubCommandFailure(f"Could not clear ip pim rp-mapping on {device}. Error:\n{e}") + + +def execute_event_manager_run_with_reload(device,username,password, + embedded_event_name="RELOAD",sleep_time=10): + """ Execute event manager with Embedded Event Manager policy name + Args: + device ('obj'): device to use + embedded_event_name ('str'): Embedded Event Manager policy name + username ('str'): username + password ('str'): password + sleep_time : sleep time + Returns: + True if reload successful else False + Raises: + SubCommandFailure + """ + def slow_sendline(spawn): + time.sleep(sleep_time) + spawn.sendline() + + def send_password(spawn): + time.sleep(sleep_time) + spawn.sendline(password) + + def send_username(spawn): + time.sleep(sleep_time) + spawn.sendline(username) + + dialog = Dialog ([ + Statement(pattern=r'.*\[y\/n\/q\]', + action='sendline(y)', loop_continue=True, continue_timer=True), + + Statement(pattern=r'.*Press RETURN to get started.*', + action= slow_sendline, + loop_continue=True, continue_timer=True), + Statement(pattern=r'Username\:', + action= send_username, + loop_continue=True, continue_timer=True), + Statement(pattern=r'Password\:', + action= send_password, + loop_continue=True, continue_timer=False), + Statement(pattern=r'%s\>' % device.name, + action= "sendline(enable)", + loop_continue=True, continue_timer=True), + Statement(pattern=r'Password\:', + action= send_password, + loop_continue=True, continue_timer=False), + Statement(pattern=r'%s\#' % device.name, + action= None, + loop_continue=False, continue_timer=False)]) + + cmd = f'event manager run {embedded_event_name}' + try: + output = device.execute(cmd, reply=dialog) + except Exception as err: + log.error("Failed to execute the command: {err}".format(err=err)) + if 'FAILED:' in output: + log.debug(f"Reload is failed on {device.name}") + return False + log.debug(f"Reload is successful on {device.name}") + return True \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py index d7bc2f34e..935b79fe1 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/spanning_tree/configure.py @@ -814,3 +814,20 @@ def configure_spanning_tree_etherchannel_misconfig(device): device.configure(config) except SubCommandFailure as e: raise SubCommandFailure("Failed to configure spanning tree etherchannel misconfig.Error:\n{e}") + +def configure_spanning_tree_mst_priority(device, instance_range, priority_id): + '''configure spanning-tree mst 0 priority 4096 + Args: + device ('obj') : Device object + instance_range('int') : MST instance range, example: 0-3,5,7-9 + range('int') : <0-61440> bridge priority in increments of 4096 + Returns: + None + Raises: + SubCommandFailure: Failed to configures spanning-tree mst 0 priority 4096 + ''' + config = [f'spanning-tree mst {instance_range} priority {priority_id}'] + try: + device.configure(config) + except SubCommandFailure as e: + raise SubCommandFailure("Failed to configure configures spanning-tree mst 0 priority 4096.Error:\n{e}") \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py index fb4ffbee8..2c1fa9dd8 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/telemetry/configure.py @@ -3,6 +3,7 @@ # Unicon from unicon.core.errors import SubCommandFailure + def configure_pae(device): """ pae Args: @@ -17,9 +18,10 @@ def configure_pae(device): except SubCommandFailure as e: raise SubCommandFailure( "Could not enable product analytics on {device}. Error:\n{error}" - .format(device=device, error=e) + .format(device=device, error=e) ) + def unconfigure_pae(device): """ no pae Args: @@ -34,9 +36,10 @@ def unconfigure_pae(device): except SubCommandFailure as e: raise SubCommandFailure( "Could not disable product analytics on {device}. Error:\n{error}" - .format(device=device, error=e) + .format(device=device, error=e) ) + def configure_license_smart_transport_smart(device): """ license smart transport smart Args: @@ -51,9 +54,10 @@ def configure_license_smart_transport_smart(device): except SubCommandFailure as e: raise SubCommandFailure( "Could not enable smart transport smart on {device}. Error:\n{error}" - .format(device=device, error=e) + .format(device=device, error=e) ) + def unconfigure_license_smart_transport(device): """ no license smart transport Args: @@ -68,9 +72,10 @@ def unconfigure_license_smart_transport(device): except SubCommandFailure as e: raise SubCommandFailure( "Could not disable smart transport on {device}. Error:\n{error}" - .format(device=device, error=e) + .format(device=device, error=e) ) + def configure_license_smart_transport_callhome(device): """ license smart transport callhome Args: @@ -85,9 +90,10 @@ def configure_license_smart_transport_callhome(device): except SubCommandFailure as e: raise SubCommandFailure( "Could not enable smart transport callhome on {device}. Error:\n{error}" - .format(device=device, error=e) + .format(device=device, error=e) ) + def configure_netconf_yang(device): """ pae Args: @@ -102,9 +108,10 @@ def configure_netconf_yang(device): except SubCommandFailure as e: raise SubCommandFailure( "Could not enable netconf-yang on {device}. Error:\n{error}" - .format(device=device, error=e) + .format(device=device, error=e) ) + def unconfigure_netconf_yang(device): """ no pae Args: @@ -119,9 +126,10 @@ def unconfigure_netconf_yang(device): except SubCommandFailure as e: raise SubCommandFailure( "Could not disable netconf-yang on {device}. Error:\n{error}" - .format(device=device, error=e) + .format(device=device, error=e) ) + def configure_telemetry_ietf_subscription(device, sub_id): """ configure telemetry ietf subscription with sub_id on device Args: @@ -137,9 +145,61 @@ def configure_telemetry_ietf_subscription(device, sub_id): device.configure(command) except SubCommandFailure as e: raise SubCommandFailure( - "Could not configure telemetry ietf subscription on {device}. Error: \n{error}".format(device=device, error=e) + f"Could not configure telemetry ietf subscription on {device}. Error: \n{e}" + ) + + +def configure_telemetry_ietf_parameters(device, sub_id, stream, receiver_ip, receiver_port, protocol, + filter_value='/process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-seconds', + encoding='encode-kvgpb', update_policy='periodic', + periodic_update_interval=500, source_address=None, source_vrf=None): + """ + Configure telemetry ietf subscription with sub_id on device + Args: + device (`obj`): Device object + sub_id('int'): <0-2147483647> Subscription Identifier + stream('str'): Stream type + receiver_ip('str'): IP of the receiving server + receiver_port('int'): Port of the receiving service on the server + protocol('str'): The protocol over which telemetry updates are sent + filter_value('str', Optional): The xpath filter. Default 'xpath' + encoding('str', Optional): Encoding format. Default 'encode-kvgpb' + update_policy('str', Optional): Update policy type - 'periodic' or 'on-update'. Default 'periodic' + periodic_update_interval('int', Optional): The interval at which updates are sent in centiseconds. Default 500 + source_address('str', Optional): Source address for updates + source_vrf('str', Optional): Source vrf for updates + Returns: + None + Raises: + SubCommandFailure : Failed configuring device + """ + cmd = [ + f"telemetry ietf subscription {sub_id}", + f"receiver ip address {receiver_ip} {receiver_port} protocol {protocol}", + f"stream {stream}" + ] + + if filter_value: + cmd.append(f"filter xpath {filter_value}") + if encoding: + cmd.append(f"encoding {encoding}") + if source_address: + cmd.append(f"source-address {source_address}") + if source_vrf: + cmd.append(f"source-vrf {source_vrf}") + if update_policy: + if update_policy.lower() == 'periodic': + cmd.append(f"update-policy periodic {periodic_update_interval}") + elif update_policy.lower() == 'on-change': + cmd.append("update-policy on-change") + try: + device.configure(cmd) + except SubCommandFailure as e: + raise SubCommandFailure( + f"Could not configure telemetry ietf subscription parameters on {device}. Error: \n{e}" ) + def unconfigure_telemetry_ietf_subscription(device, sub_id): """ un-configure telemetry ietf subscription with sub_id on device Args: @@ -155,5 +215,5 @@ def unconfigure_telemetry_ietf_subscription(device, sub_id): device.configure(command) except SubCommandFailure as e: raise SubCommandFailure( - "Could not unconfigure telemetry ietf subscription on {device}. Error: \n{error}".format(device=device, error=e) - ) \ No newline at end of file + f"Could not unconfigure telemetry ietf subscription on {device}. Error: \n{e}" + ) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py index 19bc4cff7..ac5c186ae 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/utils.py @@ -1696,7 +1696,7 @@ def clear_policy_map_counters(device): f'Could not clear policy-map counters. Error:\n{e}' ) -def request_system_shell(device, switch_type=None, processor_slot=None, uname=False, exit=True, command=None): +def request_system_shell(device, switch_type=None, processor_slot=None, uname=False, exit=True, command=None, timeout=None): ''' Request platform software system shell Args: @@ -1706,6 +1706,7 @@ def request_system_shell(device, switch_type=None, processor_slot=None, uname=Fa uname ('bool', optional): To execute uname -a in shell. Default is False. exit ('bool', optional): To exit from shell prompt. Default is True. command ('str', optional): command to execute in shell prompt + timeout ('int', optional): Timeout in seconds for waiting for the console. Default is None. Returns: Cli output @@ -1714,8 +1715,9 @@ def request_system_shell(device, switch_type=None, processor_slot=None, uname=Fa ''' dialog = Dialog([Statement(pattern=r'.*\?\s\[y\/n\].*', action='sendline(y)', - loop_continue=False, - continue_timer=False)]) + loop_continue=True, + continue_timer=False + )]) exit_dialog = Dialog([Statement(pattern=r'.*\#.*', loop_continue=False, @@ -1727,7 +1729,7 @@ def request_system_shell(device, switch_type=None, processor_slot=None, uname=Fa output = None try: - output = device.execute(cmd, reply=dialog) + output = device.execute(cmd, reply=dialog, allow_state_change=True, timeout=timeout) if uname: output += device.execute('uname -a') if command: @@ -1735,7 +1737,7 @@ def request_system_shell(device, switch_type=None, processor_slot=None, uname=Fa if exit: device.execute('exit', reply=exit_dialog) except SubCommandFailure as e: - raise SubCommandFailure(log.error(f"failed to enter system shell""Error:\n{e}")) + raise SubCommandFailure(f"failed to enter system shell""Error:\n{e}") return output diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py index 89e49a18d..af6fb40ad 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/vlan/configure.py @@ -925,7 +925,6 @@ def configure_interface_vlan_priority(device, vlan_id, priority): Raises: SubcommandFailure: Failed executing command """ - log.debug("interface vlan {vlan_id}".format(vlan_id=vlan_id)) configs = [] configs.append("interface vlan {vlan_id}".format(vlan_id=vlan_id)) @@ -1194,3 +1193,53 @@ def unconfigure_vtp_mode(device, mode): device.configure(cmd) except SubCommandFailure as e: raise SubCommandFailure(f'Could not configure no vtp mode. Error:\n{e}') + +def configure_shutdown_vlan_interface_range(device, vlan_id_from, vlan_id_to): + """ + Args: + device ('obj'): Device object + vlan_id_from ('int') : <1-4094> Vlan interface number staring from + vlan_id_to ('int') : <1-4094> Vlan interface number end to + Returns: + None + Raises: + SubcommandFailure: Failed executing command + """ + + log.debug("interface range vlan {vlan_id_from}-{vlan_id_to}".format(vlan_id_from=vlan_id_from, vlan_id_to=vlan_id_to)) + configs = [] + configs.append("interface range vlan {vlan_id_from}-{vlan_id_to}".format(vlan_id_from=vlan_id_from, vlan_id_to=vlan_id_to)) + configs.append("shutdown") + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not shut the vlan range {vlan_id_from}-{vlan_id_to} on {device}. Error:\n{error}".format( + vlan_id_from=vlan_id_from,vlan_id_to=vlan_id_to,device=device, error=e + ) + ) + + +def configure_no_shutdown_vlan_interface_range(device, vlan_id_from, vlan_id_to): + """ + Args: + device ('obj'): Device object + vlan_id_from ('int') : <1-4094> Vlan interface number staring from + vlan_id_to ('int') : <1-4094> Vlan interface number end to + Returns: + None + Raises: + SubcommandFailure: Failed executing command + """ + log.debug("interface range vlan {vlan_id_from}-{vlan_id_to}".format(vlan_id_from=vlan_id_from, vlan_id_to=vlan_id_to)) + configs = [] + configs.append("interface range vlan {vlan_id_from}-{vlan_id_to}".format(vlan_id_from=vlan_id_from, vlan_id_to=vlan_id_to)) + configs.append("no shutdown") + try: + device.configure(configs) + except SubCommandFailure as e: + raise SubCommandFailure( + "Could not shut the vlan range {vlan_id_from}-{vlan_id_to} on {device}. Error:\n{error}".format( + vlan_id_from=vlan_id_from,vlan_id_to=vlan_id_to,device=device, error=e + ) + ) \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py index 55c77e30c..1f277ff02 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/platform/utils.py @@ -1,281 +1,285 @@ - -# Python -import re - -import os - -import uuid -import base64 - -def learn_routem_configs(device, output_config=False): - """ Gets the current running config on device - Args: - output_config ('bool'): Specifies whether the config - or path of the config is outputted - Raise: - None - Returns: - Config ('dict'): {pid: config} - ex.) Config = {'123': 'config'} - """ - output = device.parse("ps -ef | grep routem")['pid'] - configs = {} - - for pid, info in output.items(): - config_data = info['cmd'].split() - - if len(config_data) == 4: - config_data = config_data[2] - else: - continue - - if output_config: - - try: - config_data = device.execute("cat {}".format(config_data)) - except: - raise ValueError("The config file at {} does not exist.".format(config_data)) - - configs.setdefault(pid, config_data) - - return configs - -def learn_process_pids(device, search): - """ Finds the PIDs of processes that match the search - Args: - search ('str'): The name of the processes to find - Raise: - None - Returns: - PIDs ('list'): [pid] - ex.) PIDs = ['123', '456'] - """ - output = device.parse("ps -ef | grep {}".format(search))['pid'] - pids = [] - - # Skip over grep process - for pid, info in output.items(): - if not 'grep' in info['cmd']: - pids.append(pid) - - return pids - -def kill_processes(device, pids): - """ Kills the processes with given PIDs - Args: - pids ('list'): List of PIDs - ex.) pids = [12, 15, 16] - Raise: - None - Returns: - Failed (list): List of pids that failed to be killed - """ - failed = [] - - for pid in pids: - output = device.execute("kill {}".format(pid)) - - if "No such process" in output: - failed.append(pid) - - return failed - -def pkill_process(device, name): - """ pkills the process with the given name - Args: - name ('str'): Name of the running process - ex.) name = 't-rex' - Raise: - None - Returns: - None - """ - device.execute("pkill {}".format(name)) - -def trex_save_configuration(device): - """ Save configuration of the currently running Trex instance using its API - Args: - None - Raise: - FileNotFoundError - Returns: - str - """ - script = """import sys - -if len(sys.argv) < 2: - print('usage: python3 hltapi_save_config.py output-trex-config-file-name.json') - exit(1) - -import trex_hltapi -trex = trex_hltapi.TRexHLTAPI() -trex.connect(device='127.0.0.1', break_locks=True, reset=False, port_list=[0,1,2,3]) -trex.save_file(output_file=sys.argv[1]) - -""" - - device.execute("sudo -s") - device.api.copy_data_to_device(script, "/opt/trex", "hltapi_save_config.py") - device.execute("python3 /opt/trex/hltapi_save_config.py saved_config.json") - - return device.api.read_data_from_device("/opt/trex/saved_config.json") - -def copy_data_to_device(device, data, destination, filename=None): - """ Copies data into a device and creates a file to store that data. - Args: - data ('str'): The data to be copied - destination ('str'): Folder of where to store file - filename ('str'): Name of the file created. If left none then a - random name will be generated - Raise: - Exception: Permission Denied, File Creation Failed - Returns: - Path (str): path of created file - """ - try: - device.execute('ls {}'.format(destination)) - except Exception: - raise FileNotFoundError("Directory '{}' does not exist.".format( - destination)) - - # Data must end in new line - if len(data) > 0 and not data[-1] == "\n": - data += "\n" - - # Transforms text data into base64 string - encoded = base64.b64encode(bytes(data, "utf-8")).decode("utf-8") - - if filename is None: - id = uuid.uuid4().hex - filename = os.path.join(destination, id) - else: - filename = os.path.join(destination, filename) - - # Decode base 64 data into file - device.execute("DATA=\"{}\"".format(encoded)) - device_out = device.execute("echo $DATA | base64 -d > {}".format(filename)) - - if 'Permission denied' in device_out: - raise Exception("Permission denied while trying to create file. " + \ - "Make sure {} has the correct permissions!".format(filename)) - - # Verify file has been successfully created - try: - device.execute("ls {}".format(filename)) - except Exception: - raise Exception("Creating of file {} has failed. No file created." - .format(filename)) - - if int(device.execute('stat {} --printf="%s\\n"'.format(filename))) == 0: - raise Exception("Creating of file {} has failed. Created file has no content" - .format(filename)) - - return filename - -def read_data_from_device(device, location): - """ Reads text data from device and returns it as output - Args: - location ('str'): Path to the text file - Raises: - FileNotFoundError: File Does not Exist - Returns: - Data ('str'): Text data read from the device - """ - # IMPORTANT - # ========= - # This API does not require the device to have network connection - # copy_from_device is the other API that behaves similar to this one, - # but it requires network connection since it uses SCP - try: - return device.execute("cat {}".format(location)) - except Exception: # Throw file not found error when encounter generic error - raise FileNotFoundError("File {} does not exist.".format(location)) - -def start_routem_process(device, config, routem_executable, config_save_location="/tmp"): - - """ Starts the routem executable with the provided config - Args: - config ('str'): Path to config file or raw config data - routem_executable ('str'): Path to routem executable file - config_save_location ('str'): Path of folder of where to save the config - file if raw config data is passed into the first argument - Raise: - None - Returns: - Success (bool): Whether or not the operation was successful - """ - config = config.strip() - - # Test if config file exists - try: - device.execute("ls {}".format(config)) - except Exception: - config = device.api.copy_data_to_device(config, config_save_location) - - # Start routem process in background - try: - device.execute("nohup {} -f {} -i &>/dev/null &".format(routem_executable, config)) - except Exception: - return False - - return True - -def trex_copy_json(device, json, destination="/opt/trex"): - """ Copies trex json config data to the trex folder - Args: - json (str): the json config in text form or path to json file on - local machine - destination (str): folder of where to put trex-config.json in - Raise: - None - Returns: - Success (bool): Whether or not the operation was successful - """ - try: - # Try to gain root access - # If user don't have root permission this will throw error - # That's fine as sometimes root is not needed to create a file - device.execute("sudo -s") - except Exception: - pass - - # If path is passed in instead of text we read that file - if os.path.exists(json): - with open(json) as file: - json = file.read() - - device.api.copy_data_to_device(json, destination, 'trex-config.json') - return True - -def start_trex_process(device, location = "/opt/trex"): - """ Starts a trex process on the device - Args: - location (str): folder location of where the trex executable is at - Raise: - FileNotFoundError - Returns: - Success (bool): Whether or not the operation was successful - """ - try: - device.execute("cd {}".format(location)) - except Exception: - raise FileNotFoundError("Location '{}' does not exist".format( - location)) - - device.execute("nohup sudo ./bringup.sh trex-config.json &>/dev/null &") - return True - -def is_process_started(device, name): - """ Checks if a trex process is running right now. - Args: - name (str): Name of the process to search for - Raise: - None - Returns: - Running (bool): Whether or not the process is running - """ - output = device.parse("ps -ef | grep %s" % name)['pid'] - - # Minus one to discount the grep process - return len(output) - 1 > 0 - + +# Python +import re + +import os + +import uuid +import base64 + +def learn_routem_configs(device, output_config=False): + """ Gets the current running config on device + Args: + output_config ('bool'): Specifies whether the config + or path of the config is outputted + Raise: + None + Returns: + Config ('dict'): {pid: config} + ex.) Config = {'123': 'config'} + """ + output = device.parse("ps -ef | grep routem")['pid'] + configs = {} + + for pid, info in output.items(): + config_data = info['cmd'].split() + + if len(config_data) == 4: + config_data = config_data[2] + else: + continue + + if output_config: + + try: + config_data = device.execute("cat {}".format(config_data)) + except: + raise ValueError("The config file at {} does not exist.".format(config_data)) + + configs.setdefault(pid, config_data) + + return configs + +def learn_process_pids(device, search): + """ Finds the PIDs of processes that match the search + Args: + search ('str'): The name of the processes to find + Raise: + None + Returns: + PIDs ('list'): [pid] + ex.) PIDs = ['123', '456'] + """ + output = device.parse("ps -ef | grep {}".format(search))['pid'] + pids = [] + + # Skip over grep process + for pid, info in output.items(): + if not 'grep' in info['cmd']: + pids.append(pid) + + return pids + +def kill_processes(device, pids, sudo=False): + """ Kills the processes with given PIDs + Args: + pids ('list'): List of PIDs + ex.) pids = [12, 15, 16] + sudo ('bool): Whether or not to use sudo + Raise: + None + Returns: + Failed (list): List of pids that failed to be killed + """ + failed = [] + + for pid in pids: + command = f"kill {pid}" + if sudo: + command = "sudo " + command + output = device.execute(command) + + if "No such process" in output: + failed.append(pid) + + return failed + +def pkill_process(device, name): + """ pkills the process with the given name + Args: + name ('str'): Name of the running process + ex.) name = 't-rex' + Raise: + None + Returns: + None + """ + device.execute("pkill {}".format(name)) + +def trex_save_configuration(device): + """ Save configuration of the currently running Trex instance using its API + Args: + None + Raise: + FileNotFoundError + Returns: + str + """ + script = """import sys + +if len(sys.argv) < 2: + print('usage: python3 hltapi_save_config.py output-trex-config-file-name.json') + exit(1) + +import trex_hltapi +trex = trex_hltapi.TRexHLTAPI() +trex.connect(device='127.0.0.1', break_locks=True, reset=False, port_list=[0,1,2,3]) +trex.save_file(output_file=sys.argv[1]) + +""" + + device.execute("sudo -s") + device.api.copy_data_to_device(script, "/opt/trex", "hltapi_save_config.py") + device.execute("python3 /opt/trex/hltapi_save_config.py saved_config.json") + + return device.api.read_data_from_device("/opt/trex/saved_config.json") + +def copy_data_to_device(device, data, destination, filename=None): + """ Copies data into a device and creates a file to store that data. + Args: + data ('str'): The data to be copied + destination ('str'): Folder of where to store file + filename ('str'): Name of the file created. If left none then a + random name will be generated + Raise: + Exception: Permission Denied, File Creation Failed + Returns: + Path (str): path of created file + """ + try: + device.execute('ls {}'.format(destination)) + except Exception: + raise FileNotFoundError("Directory '{}' does not exist.".format( + destination)) + + # Data must end in new line + if len(data) > 0 and not data[-1] == "\n": + data += "\n" + + # Transforms text data into base64 string + encoded = base64.b64encode(bytes(data, "utf-8")).decode("utf-8") + + if filename is None: + id = uuid.uuid4().hex + filename = os.path.join(destination, id) + else: + filename = os.path.join(destination, filename) + + # Decode base 64 data into file + device.execute("DATA=\"{}\"".format(encoded)) + device_out = device.execute("echo $DATA | base64 -d > {}".format(filename)) + + if 'Permission denied' in device_out: + raise Exception("Permission denied while trying to create file. " + \ + "Make sure {} has the correct permissions!".format(filename)) + + # Verify file has been successfully created + try: + device.execute("ls {}".format(filename)) + except Exception: + raise Exception("Creating of file {} has failed. No file created." + .format(filename)) + + if int(device.execute('stat {} --printf="%s\\n"'.format(filename))) == 0: + raise Exception("Creating of file {} has failed. Created file has no content" + .format(filename)) + + return filename + +def read_data_from_device(device, location): + """ Reads text data from device and returns it as output + Args: + location ('str'): Path to the text file + Raises: + FileNotFoundError: File Does not Exist + Returns: + Data ('str'): Text data read from the device + """ + # IMPORTANT + # ========= + # This API does not require the device to have network connection + # copy_from_device is the other API that behaves similar to this one, + # but it requires network connection since it uses SCP + try: + return device.execute("cat {}".format(location)) + except Exception: # Throw file not found error when encounter generic error + raise FileNotFoundError("File {} does not exist.".format(location)) + +def start_routem_process(device, config, routem_executable, config_save_location="/tmp"): + + """ Starts the routem executable with the provided config + Args: + config ('str'): Path to config file or raw config data + routem_executable ('str'): Path to routem executable file + config_save_location ('str'): Path of folder of where to save the config + file if raw config data is passed into the first argument + Raise: + None + Returns: + Success (bool): Whether or not the operation was successful + """ + config = config.strip() + + # Test if config file exists + try: + device.execute("ls {}".format(config)) + except Exception: + config = device.api.copy_data_to_device(config, config_save_location) + + # Start routem process in background + try: + device.execute("nohup {} -f {} -i &>/dev/null &".format(routem_executable, config)) + except Exception: + return False + + return True + +def trex_copy_json(device, json, destination="/opt/trex"): + """ Copies trex json config data to the trex folder + Args: + json (str): the json config in text form or path to json file on + local machine + destination (str): folder of where to put trex-config.json in + Raise: + None + Returns: + Success (bool): Whether or not the operation was successful + """ + try: + # Try to gain root access + # If user don't have root permission this will throw error + # That's fine as sometimes root is not needed to create a file + device.execute("sudo -s") + except Exception: + pass + + # If path is passed in instead of text we read that file + if os.path.exists(json): + with open(json) as file: + json = file.read() + + device.api.copy_data_to_device(json, destination, 'trex-config.json') + return True + +def start_trex_process(device, location = "/opt/trex"): + """ Starts a trex process on the device + Args: + location (str): folder location of where the trex executable is at + Raise: + FileNotFoundError + Returns: + Success (bool): Whether or not the operation was successful + """ + try: + device.execute("cd {}".format(location)) + except Exception: + raise FileNotFoundError("Location '{}' does not exist".format( + location)) + + device.execute("nohup sudo ./bringup.sh trex-config.json &>/dev/null &") + return True + +def is_process_started(device, name): + """ Checks if a trex process is running right now. + Args: + name (str): Name of the process to search for + Raise: + None + Returns: + Running (bool): Whether or not the process is running + """ + output = device.parse("ps -ef | grep %s" % name)['pid'] + + # Minus one to discount the grep process + return len(output) - 1 > 0 + diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py index 024bf7a4b..f36e9201a 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/linux/snmp/get.py @@ -128,3 +128,96 @@ def get_snmp_snmpwalk_v3(device, ip_address, oid, username, passphrase, security return device.execute(cmd) except SubCommandFailure as e: raise SubCommandFailure(f"Failed to get snmp walk output from the device. Error:\n{e}") + +def get_snmp_snmpwalk_version3(device, ip_address, oid, version="3", username=None, passprs=None, passphrase=None, var=None, + security=None, security_level=None, security_method=None, algorithm=None, private_passphrase=None, option=None): + """ Get snmpwalk version 3 output from SNMP device + Args: + device (`obj`): SNMP device + ip_address (`str`): IP address + oid (`str`): Oid code + username (`str`): username + passprs ('str'): SNMP passphrase type + passphrase (`str`): SNMP passphrase + var ('str'): var type + security ('str'): security type + security_level (`str`): security level + security_method (`str`): security method + algorithm (`str`): algorithm + private_passphrase (`str`) : private passphrase + version (`str`): SNMP version + option (`str`): Optional command + Returns: + out (`str`): Executed output of SNMP command + Raises: + SubCommandFailure + """ + cmd = f"snmpwalk -v {version}" + if username: + cmd += f" -u {username}" + if passphrase: + cmd += f" {passprs} {passphrase}" + if var: + if security_level: + cmd += f" {var} {security_level}" + if security: + if security_method: + cmd += f" {security} {security_method}" + + if algorithm: + cmd += f" -x {algorithm}" + if private_passphrase: + cmd += f" -X {private_passphrase}" + + cmd += f" {ip_address} {oid}" + if option: + cmd += f" {option}" + + try: + return device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to get snmp walk output from the device. Error:\n{e}") + + +def get_snmp_snmpwalk_sysname(device, ip_address, oid, username, passphrase, + security_level,security_method, dir=None, + algorithm=None, private_passphrase=None, + version="3", option=None): + """ Get snmpwalk version 3 sysname output from SNMP device + Args: + device (`obj`): SNMP device + ip_address (`str`): IP address of hostname specified + oid (`str`): Oid includes given OID in the search range + username (`str`): security username + passphrase (`str`): authentication protocol pass phrase + security_level (`str`): set security level + dir('str',Optional): change path to given directory path. Defaults to None + security_method (`str`): authentication protocol to set + algorithm (`str`,Optional): privacy protocol .Defaults to None + private_passphrase (`str`,Optional) : privacy protocol pass phrase. Defaults to None + version (`str`): specifies SNMP version to use + option (`str`,Optional): Optional command. Defaults to None + Returns: + (`str`): Executed output of SNMP command + Raises: + SubCommandFailure + """ + + cmd = f"snmpwalk -v{version} -u {username} -A {passphrase} -l {security_level} -a {security_method}" + + if algorithm: + cmd += f" -x {algorithm}" + if private_passphrase: + cmd += f" -X {private_passphrase}" + + cmd += f" {ip_address} {oid}" + if option: + cmd += f" {option}" + + if dir: + f"cd {dir}" + + try: + return device.execute(cmd) + except SubCommandFailure as e: + raise SubCommandFailure(f"Failed to get snmp walk output from the device. Error:\n{e}") diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..24bc15017 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + action forward: "action forward\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + match ip address 101: "match ip address 101\r\n" + no logging console: '' + vlan access-map mymap: "vlan access-map mymap\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/test_api_configure_access_map_match_ip_mac_address.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/test_api_configure_access_map_match_ip_mac_address.py new file mode 100644 index 000000000..c34f1a7de --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_access_map_match_ip_mac_address/test_api_configure_access_map_match_ip_mac_address.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_access_map_match_ip_mac_address + + +class TestConfigureAccessMapMatchIpMacAddress(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9300-stack4: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9300-stack4'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_access_map_match_ip_mac_address(self): + result = configure_access_map_match_ip_mac_address(self.device, 'mymap', 'ip', '101', 'forward') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..55981128d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + ip access-list extended racl_ipv41: "ip access-list extended racl_ipv41\r\n" + line console 0: + new_state: configure_line + no logging console: '' + permit tcp any any range 5500 5600: "permit tcp any any range 5500 5600\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/test_api_configure_acl_protocol_port.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/test_api_configure_acl_protocol_port.py new file mode 100644 index 000000000..a794ee23b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_acl_protocol_port/test_api_configure_acl_protocol_port.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_acl_protocol_port + + +class TestConfigureAclProtocolPort(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9300-stack4: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9300-stack4'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_acl_protocol_port(self): + result = configure_acl_protocol_port(self.device, 'ip', 'racl_ipv41', 'permit', 'tcp', 'range', 5500, 5600) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..54c394454 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + ip access-list extended racl_ipv41: "ip access-list extended racl_ipv41\r\n" + line console 0: + new_state: configure_line + no logging console: '' + permit ip any any: "permit ip any any\r\n" + prompt: mac-gen1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: mac-gen1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/test_api_configure_ip_acl_with_any.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/test_api_configure_ip_acl_with_any.py new file mode 100644 index 000000000..34992f45b --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/configure_ip_acl_with_any/test_api_configure_ip_acl_with_any.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.acl.configure import configure_ip_acl_with_any + + +class TestConfigureIpAclWithAny(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9300-stack4: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9300-stack4'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_acl_with_any(self): + result = configure_ip_acl_with_any(self.device, 'racl_ipv41', 'permit') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/mock_data/iosxe/mock_data.yaml index 609a35184..39796ac8e 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/mock_data/iosxe/mock_data.yaml @@ -5,15 +5,14 @@ configure: line console 0: new_state: configure_line no logging console: '' - vlan filter vacl1 vlan-list 100: "vlan filter vacl1 vlan-list 100\r\n% Warning.\ - \ VLAN map vacl1 does not exist yet.\r\n" - prompt: mac-gen2(config)# + no vlan filter mymap vlan-list 100: "no vlan filter mymap vlan-list 100\r\n" + prompt: mac-gen1(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: mac-gen2(config-line)# + prompt: mac-gen1(config-line)# connect: commands: ? '' @@ -33,4 +32,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: mac-gen2# + prompt: mac-gen1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/test_api_unconfigure_filter_vlan_list.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/test_api_unconfigure_filter_vlan_list.py index fc74b89d1..4f29e993c 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/test_api_unconfigure_filter_vlan_list.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/acl/configure/unconfigure_filter_vlan_list/test_api_unconfigure_filter_vlan_list.py @@ -10,7 +10,7 @@ class TestUnconfigureFilterVlanList(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - mac-gen2: + 9300-stack4: connections: defaults: class: unicon.Unicon @@ -19,10 +19,10 @@ def setUpClass(self): protocol: unknown os: iosxe platform: cat9k - type: C9400 + type: c9400 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['mac-gen2'] + self.device = self.testbed.devices['9300-stack4'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_unconfigure_filter_vlan_list(self): - result = unconfigure_filter_vlan_list(self.device, 'vacl1', '100') + result = unconfigure_filter_vlan_list(self.device, 'mymap', '100') expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3c7b8ccb8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + cpp system-default: "cpp system-default\r\n Policer rate for all classes will\ + \ be set to their defaults\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: Raitt(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Raitt(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: Raitt# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/test_api_enable_cpp_system_default_on_device.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/test_api_enable_cpp_system_default_on_device.py new file mode 100644 index 000000000..e8aaa4788 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/configure/enable_cpp_system_default_on_device/test_api_enable_cpp_system_default_on_device.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.cpp.configure import enable_cpp_system_default_on_device + + +class TestEnableCppSystemDefaultOnDevice(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Raitt: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Raitt'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_enable_cpp_system_default_on_device(self): + result = enable_cpp_system_default_on_device(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..f542315fa --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: Raitt(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Raitt(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear control-plane *: + response: + - '' + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: Raitt# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/test_api_execute_clear_control_plane.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/test_api_execute_clear_control_plane.py new file mode 100644 index 000000000..8cd679eb9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/cpp/execute/execute_clear_control_plane/test_api_execute_clear_control_plane.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.cpp.execute import execute_clear_control_plane + + +class TestExecuteClearControlPlane(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Raitt: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Raitt'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_clear_control_plane(self): + result = execute_clear_control_plane(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..b3080c9dd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + device-tracking logging packet drop: "device-tracking logging packet drop\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: T4-9300-SW1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T4-9300-SW1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: T4-9300-SW1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/test_api_configure_device_tracking_logging.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/test_api_configure_device_tracking_logging.py new file mode 100644 index 000000000..2a88929f7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/configure_device_tracking_logging/test_api_configure_device_tracking_logging.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.device_tracking.configure import configure_device_tracking_logging + + +class TestConfigureDeviceTrackingLogging(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + T4-9300-SW1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['T4-9300-SW1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_device_tracking_logging(self): + result = configure_device_tracking_logging(self.device, 'packet') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..500e41d55 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no device-tracking logging packet drop: "no device-tracking logging packet drop\r\ + \n" + no logging console: '' + prompt: T4-9300-SW1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T4-9300-SW1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: T4-9300-SW1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/test_api_unconfigure_device_tracking_logging.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/test_api_unconfigure_device_tracking_logging.py new file mode 100644 index 000000000..30f0dc684 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/device_tracking/configure/unconfigure_device_tracking_logging/test_api_unconfigure_device_tracking_logging.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.device_tracking.configure import unconfigure_device_tracking_logging + + +class TestUnconfigureDeviceTrackingLogging(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + T4-9300-SW1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['T4-9300-SW1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_device_tracking_logging(self): + result = unconfigure_device_tracking_logging(self.device, 'packet') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..fbf18777c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + ip dhcp snooping track server all-dhcp-acks: "ip dhcp snooping track server all-dhcp-acks\r\ + \n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9200L-2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9200L-2(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9200L-2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/test_api_configure_dhcp_snooping_track_server_dhcp_acks.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/test_api_configure_dhcp_snooping_track_server_dhcp_acks.py new file mode 100644 index 000000000..3809d7317 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_track_server_dhcp_acks/test_api_configure_dhcp_snooping_track_server_dhcp_acks.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import configure_dhcp_snooping_track_server_dhcp_acks + + +class TestConfigureDhcpSnoopingTrackServerDhcpAcks(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9400_L2_DUT: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9200 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9400_L2_DUT'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_dhcp_snooping_track_server_dhcp_acks(self): + result = configure_dhcp_snooping_track_server_dhcp_acks(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..5343ebee6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + ip dhcp snooping verify no-relay-agent-address: "ip dhcp snooping verify no-relay-agent-address\r\ + \n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9400_L2_DUT(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9400_L2_DUT(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9400_L2_DUT# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/test_api_configure_dhcp_snooping_verify_no_relay_agent_address.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/test_api_configure_dhcp_snooping_verify_no_relay_agent_address.py new file mode 100644 index 000000000..2a38d32ba --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_dhcp_snooping_verify_no_relay_agent_address/test_api_configure_dhcp_snooping_verify_no_relay_agent_address.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import configure_dhcp_snooping_verify_no_relay_agent_address + + +class TestConfigureDhcpSnoopingVerifyNoRelayAgentAddress(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9400_L2_DUT: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9400_L2_DUT'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_dhcp_snooping_verify_no_relay_agent_address(self): + result = configure_dhcp_snooping_verify_no_relay_agent_address(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..b898e430d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + ip dhcp snooping verify mac-address: "ip dhcp snooping verify mac-address\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9400_L2_DUT(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9400_L2_DUT(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9400_L2_DUT# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/test_api_configure_ip_dhcp_snooping_verify_mac_address.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/test_api_configure_ip_dhcp_snooping_verify_mac_address.py new file mode 100644 index 000000000..37bb367c6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/configure_ip_dhcp_snooping_verify_mac_address/test_api_configure_ip_dhcp_snooping_verify_mac_address.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import configure_ip_dhcp_snooping_verify_mac_address + + +class TestConfigureIpDhcpSnoopingVerifyMacAddress(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9400_L2_DUT: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9400_L2_DUT'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_dhcp_snooping_verify_mac_address(self): + result = configure_ip_dhcp_snooping_verify_mac_address(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..60a71152f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip dhcp snooping track server all-dhcp-acks: "no ip dhcp snooping track server\ + \ all-dhcp-acks\r\n" + no logging console: '' + prompt: 9200L-2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9200L-2(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9200L-2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/test_api_unconfigure_dhcp_snooping_track_server_dhcp_acks.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/test_api_unconfigure_dhcp_snooping_track_server_dhcp_acks.py new file mode 100644 index 000000000..72f7d84e2 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_track_server_dhcp_acks/test_api_unconfigure_dhcp_snooping_track_server_dhcp_acks.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import unconfigure_dhcp_snooping_track_server_dhcp_acks + + +class TestUnconfigureDhcpSnoopingTrackServerDhcpAcks(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9400_L2_DUT: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9200 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9400_L2_DUT'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_dhcp_snooping_track_server_dhcp_acks(self): + result = unconfigure_dhcp_snooping_track_server_dhcp_acks(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..efdd2ff57 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip dhcp snooping verify no-relay-agent-address: "no ip dhcp snooping verify\ + \ no-relay-agent-address\r\n" + no logging console: '' + prompt: 9400_L2_DUT(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9400_L2_DUT(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9400_L2_DUT# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/test_api_unconfigure_dhcp_snooping_verify_no_relay_agent_address.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/test_api_unconfigure_dhcp_snooping_verify_no_relay_agent_address.py new file mode 100644 index 000000000..65360c686 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_dhcp_snooping_verify_no_relay_agent_address/test_api_unconfigure_dhcp_snooping_verify_no_relay_agent_address.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import unconfigure_dhcp_snooping_verify_no_relay_agent_address + + +class TestUnconfigureDhcpSnoopingVerifyNoRelayAgentAddress(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9400_L2_DUT: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9400_L2_DUT'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_dhcp_snooping_verify_no_relay_agent_address(self): + result = unconfigure_dhcp_snooping_verify_no_relay_agent_address(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..824571360 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/0/5: "interface GigabitEthernet1/0/5\r\n" + line console 0: + new_state: configure_line + no ip dhcp snooping limit rate 15: "no ip dhcp snooping limit rate 15\r\n" + no logging console: '' + prompt: 9400_L2_DUT(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9400_L2_DUT(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9400_L2_DUT# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/test_api_unconfigure_ip_dhcp_snooping_limit_rate.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/test_api_unconfigure_ip_dhcp_snooping_limit_rate.py new file mode 100644 index 000000000..6464131e1 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_limit_rate/test_api_unconfigure_ip_dhcp_snooping_limit_rate.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import unconfigure_ip_dhcp_snooping_limit_rate + + +class TestUnconfigureIpDhcpSnoopingLimitRate(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9400_L2_DUT: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9400_L2_DUT'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_dhcp_snooping_limit_rate(self): + result = unconfigure_ip_dhcp_snooping_limit_rate(self.device, 'GigabitEthernet1/0/5', '15') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d10ebb962 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip dhcp snooping verify mac-address: "no ip dhcp snooping verify mac-address\r\ + \n" + no logging console: '' + prompt: 9400_L2_DUT(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9400_L2_DUT(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9400_L2_DUT# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/test_api_unconfigure_ip_dhcp_snooping_verify_mac_address.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/test_api_unconfigure_ip_dhcp_snooping_verify_mac_address.py new file mode 100644 index 000000000..b9ed3c9b9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/dhcp/configure/unconfigure_ip_dhcp_snooping_verify_mac_address/test_api_unconfigure_ip_dhcp_snooping_verify_mac_address.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.dhcp.configure import unconfigure_ip_dhcp_snooping_verify_mac_address + + +class TestUnconfigureIpDhcpSnoopingVerifyMacAddress(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9400_L2_DUT: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9400_L2_DUT'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_dhcp_snooping_verify_mac_address(self): + result = unconfigure_ip_dhcp_snooping_verify_mac_address(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..7eb06de6c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: nanook_pkumarmu_rr(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: nanook_pkumarmu_rr(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + hw-module subslot 0/3 reload force: + response: + - '' + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: nanook_pkumarmu_rr# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/test_api_hw_module_sub_slot_reload.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/test_api_hw_module_sub_slot_reload.py new file mode 100644 index 000000000..5ae972ffd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/hw_module/execute/hw_module_sub_slot_reload/test_api_hw_module_sub_slot_reload.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.hw_module.execute import hw_module_sub_slot_reload + + +class TestHwModuleSubSlotReload(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + nanook_pkumarmu_rr: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: router + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['nanook_pkumarmu_rr'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_hw_module_sub_slot_reload(self): + result = hw_module_sub_slot_reload(self.device, '0/3') + expected_output = '' + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/mock_data/iosxe/mock_data.yaml index a33c80dd8..4e5088cda 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/mock_data/iosxe/mock_data.yaml @@ -5,13 +5,13 @@ configure: line console 0: new_state: configure_line no logging console: '' - prompt: PI-9300x-100(config)# + prompt: AMZ-Acc-4(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: PI-9300x-100(config-line)# + prompt: AMZ-Acc-4(config-line)# connect: commands: ? '' @@ -28,34 +28,18 @@ execute: new_state: configure config-transaction: new_state: configure - install add file flash:/cat9k_iosxe.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.bin activate commit: - response: - - "install_add_activate_commit: START Mon Aug 29 03:12:44 UTC 2022\r\ninstall_add:\ - \ START Mon Aug 29 03:12:44 UTC 2022\r\ninstall_add: Adding IMG\r\n--- Starting\ - \ initial file syncing ---\r\nCopying flash:cat9k_iosxe.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.bin\ - \ from Switch 1 to Switch 1\r\nInfo: Finished copying to the selected Switch\r\ - \nFinished initial file syncing\r\n\r\n--- Starting Add ---\r\nPerforming\ - \ Add on all members\r\n [1] Finished Add package(s) on Switch 1\r\nChecking\ - \ status of Add on [1]\r\nAdd: Passed on [1]\r\nFinished Add\r\n\r\nImage\ - \ added. Version: 17.10.01.0.164921\r\n\r\ninstall_activate: START Mon Aug\ - \ 29 03:12:55 UTC 2022\r\ninstall_activate: Activating IMG\r\nFollowing packages\ - \ shall be activated:\r\n/flash/cat9k-cc_srdriver.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\ - \n/flash/cat9k-espbase.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n\ - /flash/cat9k-guestshell.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n\ - /flash/cat9k-lni.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n/flash/cat9k-rpbase.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\ - \n/flash/cat9k-sipbase.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n\ - /flash/cat9k-sipspa.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n/flash/cat9k-srdriver.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\ - \n/flash/cat9k-webui.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n/flash/cat9k-wlc.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\ - \n/flash/cat9k-rpboot.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n\r\ - \nThis operation may require a reload of the system. Do you want to proceed?\ - \ [y/n]y\r\n\r\n\r\n--- Starting Activate ---\r\nPerforming Activate on all\ - \ members\r\n [1] Activate package(s) on Switch 1\r\n [1] Finished Activate\ - \ on Switch 1\r\nChecking status of Activate on [1]\r\nActivate: Passed on\ - \ [1]\r\nFinished Activate\r\n\r\n--- Starting Commit ---\r\nPerforming Commit\ - \ on all members\r\n [1] Commit package(s) on Switch 1\r\n [1] Finished Commit\ - \ on Switch 1\r\nChecking status of Commit on [1]\r\nCommit: Passed on [1]\r\ - \nFinished Commit operation\r\n\r\nSUCCESS: install_add_activate_commit Mon\ - \ Aug 29 03:15:11 UTC 2022" + ? install add file tftp://172.27.18.5/auto/iconatest/users/byodis/images/cat9k_iosxe.17.10.01.SPA.bin + activate reloadfast commit + : response: + - "$is/images/cat9k_iosxe.17.10.01.SPA.bin activate reloadfast commit\r\ninstall_add_activate_commit:\ + \ START Thu Nov 9 23:18:39 PDT 2023\r\nSTACK_GR: Inside xFSU check if switch\ + \ stack\r\nSystem not ready for reload fast, Please run this command later\r\ + \nFAILED: xFSU requirement pre-check\r\nChecking STP eligibility: Eligible\r\ + \n\r\n[1]: Performing xFSU-pre-check\r\n300+0 records in\r\n300+0 records\ + \ out\r\n307200 bytes (307 kB, 300 KiB) copied, 0.195192 s, 1.6 MB/s\r\n \ + \ SUCCESS: xFSU-pre-check finished\r\n[1]: xFSU-pre-check package(s) on switch\ + \ 1\r\nFAILED: xFSU requirement pre-check\r\nFAILED: install_add_activate_commit\ + \ : Abort xFSU install since requirement does not met" response_type: circular show version: '' term length 0: '' @@ -64,4 +48,4 @@ execute: response: - "Building configuration...\r\n[OK]" response_type: circular - prompt: PI-9300x-100# + prompt: AMZ-Acc-4# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/test_api_execute_install_one_shot.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/test_api_execute_install_one_shot.py index e6b70c10d..888d3fc6e 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/test_api_execute_install_one_shot.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/install/execute/execute_install_one_shot/test_api_execute_install_one_shot.py @@ -10,7 +10,7 @@ class TestExecuteInstallOneShot(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - PI-9300x-100: + AMZ-Acc-4: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: c9400 - type: None + platform: cat9k + type: c9300 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['PI-9300x-100'] + self.device = self.testbed.devices['AMZ-Acc-4'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,59 +30,6 @@ def setUpClass(self): ) def test_execute_install_one_shot(self): - result = execute_install_one_shot(self.device, 'flash:/cat9k_iosxe.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.bin', True, False, False, 900, 10) - expected_output = ('install_add_activate_commit: START Mon Aug 29 03:12:44 UTC 2022\r\n' - 'install_add: START Mon Aug 29 03:12:44 UTC 2022\r\n' - 'install_add: Adding IMG\r\n' - '--- Starting initial file syncing ---\r\n' - 'Copying flash:cat9k_iosxe.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.bin ' - 'from Switch 1 to Switch 1\r\n' - 'Info: Finished copying to the selected Switch\r\n' - 'Finished initial file syncing\r\n' - '\r\n' - '--- Starting Add ---\r\n' - 'Performing Add on all members\r\n' - ' [1] Finished Add package(s) on Switch 1\r\n' - 'Checking status of Add on [1]\r\n' - 'Add: Passed on [1]\r\n' - 'Finished Add\r\n' - '\r\n' - 'Image added. Version: 17.10.01.0.164921\r\n' - '\r\n' - 'install_activate: START Mon Aug 29 03:12:55 UTC 2022\r\n' - 'install_activate: Activating IMG\r\n' - 'Following packages shall be activated:\r\n' - '/flash/cat9k-cc_srdriver.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-espbase.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-guestshell.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-lni.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-rpbase.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-sipbase.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-sipspa.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-srdriver.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-webui.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-wlc.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '/flash/cat9k-rpboot.BLD_POLARIS_DEV_LATEST_20220813_143800.SSA.pkg\r\n' - '\r\n' - 'This operation may require a reload of the system. Do you want to proceed? ' - '[y/n]y\r\n' - '\r\n' - '\r\n' - '--- Starting Activate ---\r\n' - 'Performing Activate on all members\r\n' - ' [1] Activate package(s) on Switch 1\r\n' - ' [1] Finished Activate on Switch 1\r\n' - 'Checking status of Activate on [1]\r\n' - 'Activate: Passed on [1]\r\n' - 'Finished Activate\r\n' - '\r\n' - '--- Starting Commit ---\r\n' - 'Performing Commit on all members\r\n' - ' [1] Commit package(s) on Switch 1\r\n' - ' [1] Finished Commit on Switch 1\r\n' - 'Checking status of Commit on [1]\r\n' - 'Commit: Passed on [1]\r\n' - 'Finished Commit operation\r\n' - '\r\n' - 'SUCCESS: install_add_activate_commit Mon Aug 29 03:15:11 UTC 2022') + result = execute_install_one_shot(self.device, 'tftp://172.27.18.5/auto/iconatest/users/byodis/images/cat9k_iosxe.17.10.01.SPA.bin', True, False, False, 900, 10, False, 'True') + expected_output = False self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..35210dbd7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface GigabitEthernet1/0/2: "interface GigabitEthernet1/0/2\r\n" + line console 0: + new_state: configure_line + no logging console: '' + switchport protected: "switchport protected\r\n" + prompt: 9300-2mem(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9300-2mem(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9300-2mem# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/test_api_enable_switchport_protected_on_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/test_api_enable_switchport_protected_on_interface.py new file mode 100644 index 000000000..86621797e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/enable_switchport_protected_on_interface/test_api_enable_switchport_protected_on_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import enable_switchport_protected_on_interface + + +class TestEnableSwitchportProtectedOnInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9300-2mem: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9300-2mem'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_enable_switchport_protected_on_interface(self): + result = enable_switchport_protected_on_interface(self.device, 'GigabitEthernet1/0/2') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_speed/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_speed/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a2b677aab --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_speed/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface Gig0: "interface Gig0\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no speed: "no speed\r\n" + prompt: GD_F12(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: GD_F12(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: GD_F12# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_speed/test_api_unconfigure_interface_speed.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_speed/test_api_unconfigure_interface_speed.py new file mode 100644 index 000000000..19542cd43 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/interface/configure/unconfigure_interface_speed/test_api_unconfigure_interface_speed.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.interface.configure import unconfigure_interface_speed + + +class TestUnconfigureInterfaceSpeed(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + GD_F12: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['GD_F12'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_interface_speed(self): + result = unconfigure_interface_speed(self.device, 'Gig0') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..327623e2a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: uut-9300(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: uut-9300(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear ipv6 neighbors: + response: + - '' + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: uut-9300# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/test_api_clear_ipv6_neighbors.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/test_api_clear_ipv6_neighbors.py new file mode 100644 index 000000000..624ee5aea --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ipv6/clear/clear_ipv6_neighbors/test_api_clear_ipv6_neighbors.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ipv6.clear import clear_ipv6_neighbors + + +class TestClearIpv6Neighbors(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + uut-9300: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['uut-9300'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_clear_ipv6_neighbors(self): + result = clear_ipv6_neighbors(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..be56d6361 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + crypto pki trustpoint client: "crypto pki trustpoint client\r\n" + end: + new_state: execute + enrollment terminal: "enrollment terminal\r\n" + line console 0: + new_state: configure_line + no logging console: '' + revocation-check none: "revocation-check none\r\n" + prompt: MSFT_9500QC_BORDER(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: MSFT_9500QC_BORDER(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: MSFT_9500QC_BORDER# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/test_api_configure_pki_trustpoint.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/test_api_configure_pki_trustpoint.py new file mode 100644 index 000000000..7c32dd818 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/configure/configure_pki_trustpoint/test_api_configure_pki_trustpoint.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.macsec.configure import configure_pki_trustpoint + + +class TestConfigurePkiTrustpoint(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + MSFT_9500QC_BORDER: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['MSFT_9500QC_BORDER'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_pki_trustpoint(self): + result = configure_pki_trustpoint(self.device, None, 'client', None, 'terminal', None, 'none', None) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..06123bd15 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: MSFT_9500H_SPINE(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: MSFT_9500H_SPINE(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + crypto pki enroll server: + response: + - "\r\nRouter Self Signed Certificate successfully created" + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: MSFT_9500H_SPINE# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/test_api_execute_crypto_pki_server.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/test_api_execute_crypto_pki_server.py new file mode 100644 index 000000000..4883ce149 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_crypto_pki_server/test_api_execute_crypto_pki_server.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.macsec.execute import execute_crypto_pki_server + + +class TestExecuteCryptoPkiServer(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + MSFT_9500H_SPINE: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['MSFT_9500H_SPINE'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_crypto_pki_server(self): + result = execute_crypto_pki_server(self.device, 'enroll', 'server', 'None', 5) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..619d53a6d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: MSFT_9500H_SPINE(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: MSFT_9500H_SPINE(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + test opssl nonblockingsession client tls1.2 192.168.1.1 9001 1 10 2048 0 client client: + response: + - $lient tls1.2 192.168.1.1 9001 1 10 2048 0 client client + response_type: circular + prompt: MSFT_9500H_SPINE# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/test_api_execute_test_opssl_nonblockingsession_client.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/test_api_execute_test_opssl_nonblockingsession_client.py new file mode 100644 index 000000000..3c001828d --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_client/test_api_execute_test_opssl_nonblockingsession_client.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.macsec.execute import execute_test_opssl_nonblockingsession_client + + +class TestExecuteTestOpsslNonblockingsessionClient(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + MSFT_9500H_SPINE: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['MSFT_9500H_SPINE'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_test_opssl_nonblockingsession_client(self): + result = execute_test_opssl_nonblockingsession_client(self.device, 'tls1.2', '192.168.1.1', '9001', '1', '10', '2048', '0', 'client', 'client') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..a391738ab --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: MSFT_9500H_SPINE(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: MSFT_9500H_SPINE(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + test opssl nonblockingsession server tls1.2 start 192.168.1.1 9001 134217727 0 server server: + response: + - $.2 start 192.168.1.1 9001 134217727 0 server server + response_type: circular + prompt: MSFT_9500H_SPINE# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/test_api_execute_test_opssl_nonblockingsession_server_start.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/test_api_execute_test_opssl_nonblockingsession_server_start.py new file mode 100644 index 000000000..626197c22 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_start/test_api_execute_test_opssl_nonblockingsession_server_start.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.macsec.execute import execute_test_opssl_nonblockingsession_server_start + + +class TestExecuteTestOpsslNonblockingsessionServerStart(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + MSFT_9500H_SPINE: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['MSFT_9500H_SPINE'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_test_opssl_nonblockingsession_server_start(self): + result = execute_test_opssl_nonblockingsession_server_start(self.device, 'tls1.2', 'start', '192.168.1.1', '9001', '134217727', '0', 'server', 'server') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d628a6eb5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: MSFT_9500QC_BORDER(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: MSFT_9500QC_BORDER(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + test opssl nonblockingsession server tls1.2 stop: + response: + - '' + response_type: circular + prompt: MSFT_9500QC_BORDER# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/test_api_execute_test_opssl_nonblockingsession_server_stop.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/test_api_execute_test_opssl_nonblockingsession_server_stop.py new file mode 100644 index 000000000..df0bdf567 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/macsec/execute/execute_test_opssl_nonblockingsession_server_stop/test_api_execute_test_opssl_nonblockingsession_server_stop.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.macsec.execute import execute_test_opssl_nonblockingsession_server_stop + + +class TestExecuteTestOpsslNonblockingsessionServerStop(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + MSFT_9500QC_BORDER: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['MSFT_9500QC_BORDER'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_test_opssl_nonblockingsession_server_stop(self): + result = execute_test_opssl_nonblockingsession_server_stop(self.device, 'server', 'tls1.2', 'stop') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..6015281cf --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + host 1.1.1.1: "host 1.1.1.1\r\n" + line console 0: + new_state: configure_line + no logging console: '' + object-group network HOSTA: "object-group network HOSTA\r\n" + prompt: T4-9300-SW1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: T4-9300-SW1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: T4-9300-SW1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/test_api_configure_object_group.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/test_api_configure_object_group.py new file mode 100644 index 000000000..77dc30261 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ogacl/configure/configure_object_group/test_api_configure_object_group.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ogacl.configure import configure_object_group + + +class TestConfigureObjectGroup(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + T4-9300-SW1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: c9300 + type: c9300 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['T4-9300-SW1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_object_group(self): + result = configure_object_group(self.device, 'network', 'HOSTA', 'None', 'None', 'None', 'host', '1.1.1.1', '1.1.1.1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d160b1173 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + capability vrf-lite: "capability vrf-lite\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + router ospf 11 vrf vrf1: "router ospf 11 vrf vrf1\r\n" + prompt: PE1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: PE1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: PE1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/test_api_configure_ospf_vrf_lite.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/test_api_configure_ospf_vrf_lite.py new file mode 100644 index 000000000..20a0b9a70 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/ospf/configure/configure_ospf_vrf_lite/test_api_configure_ospf_vrf_lite.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.ospf.configure import configure_ospf_vrf_lite + + +class TestConfigureOspfVrfLite(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + PE1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: None + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['PE1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ospf_vrf_lite(self): + result = configure_ospf_vrf_lite(self.device, '11', 'vrf1') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..663c157c4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + crypto pki authenticate Other: "crypto pki authenticate Other\r\n % Certificate\ + \ Authority (trustpoint) 'Other' is unknown\r\n" + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: Startrek-SVL(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Startrek-SVL(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: Startrek-SVL# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/test_api_configure_pki_authenticate_certificate.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/test_api_configure_pki_authenticate_certificate.py new file mode 100644 index 000000000..8a17576cb --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_authenticate_certificate/test_api_configure_pki_authenticate_certificate.py @@ -0,0 +1,52 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.pki.configure import configure_pki_authenticate_certificate + + +class TestConfigurePkiAuthenticateCertificate(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Startrek-SVL: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Startrek-SVL'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_pki_authenticate_certificate(self): + result = configure_pki_authenticate_certificate(self.device, (' MIIDUjCCAjqgAwIBAgIBFDANBgkqhkiG9w0BAQsFADBCMQ0wCwYDVQQDDARTZWxm\n' + ' MRswGQYJKoZIhvcNAQkCDAxTVkxfOTUwMF80MFgxFDASBgNVBAUTC0ZDVzIxNTBB\n' + ' MVhKMB4XDTIzMDUxNTA0MTk0MVoXDTMzMDUxNDA0MTk0MVowQjENMAsGA1UEAwwE\n' + ' U2VsZjEbMBkGCSqGSIb3DQEJAgwMU1ZMXzk1MDBfNDBYMRQwEgYDVQQFEwtGQ1cy\n' + ' MTUwQTFYSjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALh6BgATLjtH\n' + ' 7u5N8Mpyada4wH81HqohQoutTrwgP7/bm8uExvllCutC2vViHT6QkFMTZJhmb7qE\n' + ' KFrfKxvaKVlSBAWWY3oSrPBYOCv4tc6RR4tv5nA0cDBprlMRffZIQe76FS3SRClu\n' + ' aSUol3hJ2IPcuySIAKg+ed76OwNSuoNhx0v1wholf12UR5M8sRhObfQ5AV6pjYcc\n' + ' 4eAllqJNFOiUM5CLtX4brN/HG8sMJLxHbI522+QaD1c4LcAI34EzyyALBxdDLo5w\n' + ' 6PFL4nSXAyNVS+Vrhk+MXXZKEA8PaLDIBamXL3SAZSCAjaxsz+YtzEw+NPTVugDT\n' + ' lt/fHiFq2pcCAwEAAaNTMFEwHQYDVR0OBBYEFCLrr/FQ8/iMjMbymk5CJxi03kWz\n' + ' MB8GA1UdIwQYMBaAFCLrr/FQ8/iMjMbymk5CJxi03kWzMA8GA1UdEwEB/wQFMAMB\n' + ' Af8wDQYJKoZIhvcNAQELBQADggEBAAhKPV6EBT1pdtSo6RD0wY3kUVe7/wMhmOga\n' + ' vKIwVvrrJR6tgGEEX8tnN2qPGR2f/ULhbHZ6Y73Sq7kwvd0wbOJOr4vDJSWV7/6N\n' + ' abNFYmCpaQK9C/3UtCLD1gL2i8FdweQEjmpQ7EC7SPsHiGDUJh59W0bgLoAH+1YW\n' + ' frw+Jig7mmdW80NMyyxyWQxU7Llvx3cix3Tt9G3r9ZQL19CUXC4uiCj7Z13YLbuA\n' + ' VmOdnCAmgXl35sdb+UBsZUZlIGDMl+drD2sM/zh+apUYHYOMSefzhd9MYcGkK4GF\n' + ' qsZIE1fGBj729xrq5dZBhUZob57i1rsmuNoN38InOkeP11jRKXg=\n'), 'Other') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/mock_data/iosxe/mock_data.yaml index 05fd9d253..1cfbab927 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/mock_data/iosxe/mock_data.yaml @@ -1,66 +1,21 @@ configure: commands: - crypto pki enroll test: - response: | - % - % Start certificate enrollment .. - % Create a challenge password. You will need to verbally provide this - password to the CA Administrator in order to revoke your certificate. - For security reasons your password will not be saved in the configuration. - Please make a note of it. - new_state: password + crypto pki enroll Self: "crypto pki enroll Self\r\n% Include the router serial\ + \ number in the subject name? [yes/no]: no\r\n% Include an IP address in the\ + \ subject name? [no]: no\r\nGenerate Self Signed Router Certificate? [yes/no]:\ + \ yes\r\n\r\nRouter Self Signed Certificate successfully created\r\n\r\n" end: new_state: execute line console 0: new_state: configure_line no logging console: '' - prompt: CSR4(config)# - -password: - prompt: "Password: " - commands: - "abcd1234": - new_state: - reenter_password - -reenter_password: - prompt: "Re-enter password: " - commands: - "abcd1234": - response: | - % The subject name in the certificate will include: ipsec_reg8_new - new_state: - router_serial_confirmation - -router_serial_confirmation: - prompt: "% Include the router serial number in the subject name? [yes/no]: " - commands: - "no": - new_state: - ip_address_confirmation - -ip_address_confirmation: - prompt: "% Include an IP address in the subject name? [no]: " - commands: - "no": - new_state: request_cert_confirmation - -request_cert_confirmation: - prompt: "Request certificate from CA? [yes/no]: " - commands: - "yes": - response: | - % Certificate request sent to Certificate Authority - % The 'show crypto pki certificate verbose test' command will show the fingerprint. - new_state: - configure - + prompt: SVL_9500_40X(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: CSR4(config-line)# + prompt: SVL_9500_40X(config-line)# connect: commands: ? '' @@ -80,4 +35,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: CSR4# + prompt: SVL_9500_40X# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/test_api_configure_pki_enroll.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/test_api_configure_pki_enroll.py index 8686e12cb..46f267f41 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/test_api_configure_pki_enroll.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_enroll/test_api_configure_pki_enroll.py @@ -10,7 +10,7 @@ class TestConfigurePkiEnroll(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - CSR4: + SVL_9500_40X: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: iosxe - type: iosxe + platform: c9500 + type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['CSR4'] + self.device = self.testbed.devices['SVL_9500_40X'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_configure_pki_enroll(self): - result = configure_pki_enroll(self.device, 'test', 'abcd1234') + result = configure_pki_enroll(self.device, 'Self', 'cisco123', False) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/mock_data/iosxe/mock_data.yaml index 2cd235b39..04c7f4737 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/mock_data/iosxe/mock_data.yaml @@ -1,30 +1,32 @@ configure: commands: - crypto pki export test pkcs12 bootflash:client_chain.p12 password cisco123: - new_state: crypto + crypto pki export Self pem terminal aes password cisco123: "crypto pki export\ + \ Self pem terminal aes password cisco12\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\ + \b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\ + $export Self pem terminal aes password cisco123 \b\b\b\b\b\b\b\b\b\r\ + \n% Self-signed CA certificate:\r\n-----BEGIN CERTIFICATE-----\r\nMIIDUjCCAjqgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBCMQ0wCwYDVQQDDARTZWxm\r\ + \nMRswGQYJKoZIhvcNAQkCDAxTVkxfOTUwMF80MFgxFDASBgNVBAUTC0ZDVzIxNTBB\r\nMVhKMB4XDTIzMTAxMTAwMjEyMloXDTMzMTAxMDAwMjEyMlowQjENMAsGA1UEAwwE\r\ + \nU2VsZjEbMBkGCSqGSIb3DQEJAgwMU1ZMXzk1MDBfNDBYMRQwEgYDVQQFEwtGQ1cy\r\nMTUwQTFYSjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKfgMYcuDiuZ\r\ + \n6h4HyXeJNsBux0OO5wPHuRpZvjCIK7Yn9Ig9Sj5c2zIyaL+jk1wiurx0bB9sW3Ql\r\nQG0ijG3XvnD6REOPk+ISBSgPpv9azR8yKSuksSC/ovHOrm2VjgMS/SKOKHHY+qMg\r\ + \nm0AAR19SN5HbEE8/9vFCo+wJXbeX48nmEJNOnOdUfJ1rsXktAs5Dm3jJbyKpcEKO\r\n14oIMV1/6iCnr1X6zB08Ke61pMXp7zMTL2rXYZ7m0ChweXyjhmjYBKGBWrUe/YDk\r\ + \nmNDopgoPPmGK9ZavLE4e00TClQ0SEchreuxKyQaR7Qhw1vpjuh4aCUANtL23aFZ/\r\nT4Q3DG6T+JMCAwEAAaNTMFEwHQYDVR0OBBYEFDVMkjPHruoGZTyLd0t6XzkIRVzN\r\ + \nMB8GA1UdIwQYMBaAFDVMkjPHruoGZTyLd0t6XzkIRVzNMA8GA1UdEwEB/wQFMAMB\r\nAf8wDQYJKoZIhvcNAQELBQADggEBABqs6aEa093gosGAgXb9bHXmHLftuKyJm/mx\r\ + \n4ntevlJV7cherujBPc69TgfjiwgSOrqdKZqDTWIEN1v++aVAzPux+K02o9We8OJf\r\n7DmKEf19gky5YZLK/rHxfR8ZPFx+sdCxA90dNCdMNsjC/MYRAT8lRO1ziWfKzM0D\r\ + \nCh3Bj5BvRQmB/TVVldfgWEv0jdJA+g7LordqvSY3cLZZbJkIv+452Ifilwuo7q38\r\nStiQ2cbVn8MaECOtaoMaVntVhdObGs4SpyeMNA8gOH/oE585H4iu8WoLpxCvLVou\r\ + \nvvqEeXT3opWtFAw0ZN1vMpTCeexJ+RBZpMW0qDJgBV0lymELpRY=\r\n-----END CERTIFICATE-----\r\ + \n% RSA keypair 'Self' is not exportable.\r\n" end: new_state: execute line console 0: new_state: configure_line no logging console: '' - prompt: CSR4(config)# -crypto: - prompt: "Destination filename [client_chain.p12]? " - commands: - ? '' - : new_state: crypto_2 -crypto_2: - prompt: "Writing pkcs12 file to bootflash:client_chain.p12\r\ - \n\r\nCRYPTO_PKI: Exported PKCS12 file successfully.\r\nCSR4(config)#" - commands: - end: - new_state: execute + prompt: SVL_9500_40X(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: CSR4(config-line)# + prompt: SVL_9500_40X(config-line)# connect: commands: ? '' @@ -44,4 +46,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: CSR4# + prompt: SVL_9500_40X# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/test_api_configure_pki_export.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/test_api_configure_pki_export.py index 42436f93e..877448054 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/test_api_configure_pki_export.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_pki_export/test_api_configure_pki_export.py @@ -10,7 +10,7 @@ class TestConfigurePkiExport(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - CSR4: + SVL_9500_40X: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: iosxe - type: iosxe + platform: c9500 + type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['CSR4'] + self.device = self.testbed.devices['SVL_9500_40X'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_configure_pki_export(self): - result = configure_pki_export(self.device, 'test', 'pkcs12', 'cisco123', 'bootflash:', 'client_chain.p12', None, None, None, None, None, None) - expected_output = None + result = configure_pki_export(self.device, 'Self', 'pem', 'cisco123', None, None, None, 'terminal', None, None, None, 'aes') + expected_output = result self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/mock_data/iosxe/mock_data.yaml index 6f5b640c4..eb4422d45 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/mock_data/iosxe/mock_data.yaml @@ -1,65 +1,22 @@ configure: commands: - authorization password test: "authorization password test\r\n" - authorization username alt-subjectname userprinciplename: "authorization username\ - \ alt-subjectname userprinciplename\r\n" - authorization username alt-subjectname userprinciplename secondary: "authorization\ - \ username alt-subjectname userprinciplename secondary\r\n" - authorization username subjectname all: "authorization username subjectname all\r\ - \n" - auto-enroll: "auto-enroll\r\n" - auto-enroll 100 regenerate: "auto-enroll 100 regenerate\r\n" - auto-enroll regenerate: "auto-enroll regenerate\r\n" - auto-trigger: "auto-trigger\r\n" - certificate chain bootflash:tp_chain_location_test: "certificate chain bootflash:tp_chain_location_test\r\ - \n" - chain-validation continue True: "chain-validation continue True\r\n" - chain-validation stop: "chain-validation stop\r\n" - crl cache delete-after 100: "crl cache delete-after 100\r\n" - crl cache extend 100: "crl cache extend 100\r\n" - crl cache none: "crl cache none \r\n" - crypto pki trustpoint test: "crypto pki trustpoint test\r\n" + crypto pki trustpoint Self: "crypto pki trustpoint Self\r\n" end: new_state: execute - enrollment mode ra: "enrollment mode ra\r\n" - enrollment retry count 10: "enrollment retry count 10\r\n" - enrollment retry period 10: "enrollment retry period 10\r\n" - enrollment url bootflash:test_enroll_url: "enrollment url bootflash:test_enroll_url\r\ - \n" - enrollment url http://10.0.0.1:80: "enrollment url http://10.0.0.1:80 \r\n" - exit: " enrollment url bootflash:test_enroll_url\r\n" - fqdn none: "fqdn none\r\n" - hash sha512: "hash sha512\r\n" - http-proxy test 1000: "http-proxy test 1000\r\n" - ip-address none: "ip-address none\r\n" - ip-extension inherit ipv4: "ip-extension inherit ipv4\r\n" + enrollment selfsigned: "enrollment selfsigned\r\n" line console 0: new_state: configure_line no logging console: '' - no vrf: " enrollment mode ra\r\n" - ocsp disable-nonce: "ocsp disable-nonce\r\n" - ocsp url http://10.0.0.1:80: "ocsp url http://10.0.0.1:80\r\n" - password test: "password test\r\n" - primary: "primary\r\n" - regenerate: "regenerate\r\n" - revocation-check crl: "revocation-check crl\r\n" - revocation-check none: "revocation-check none\r\n" - root proxy http://10.20.20.2: "root proxy http://10.20.20.2\r\n" - rsakeypair test 1024: "rsakeypair test 1024\r\n" - rsakeypair test 1024 1024: "rsakeypair test 1024 1024\r\n" - serial-number none: "serial-number none\r\n" - show: "show\r\n" - source interface GigabitEthernet10: " ip-extension inherit ipv4\r\n" - subject-name C = IN: "subject-name C = IN\r\n" - usage ike: " enrollment retry count 10\r\n" - vrf test: " enrollment retry period 10\r\n" - prompt: ipsec_reg8_new(config)# + revocation-check None: "revocation-check None\r\n" + rsakeypair Self 2048: "rsakeypair Self 2048\r\n" + subject-name cn=Self: "subject-name cn=Self\r\n" + prompt: SVL_9500_40X(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: ipsec_reg8_new(config-line)# + prompt: SVL_9500_40X(config-line)# connect: commands: ? '' @@ -79,4 +36,4 @@ execute: show version: '' term length 0: '' term width 0: '' - prompt: ipsec_reg8_new# + prompt: SVL_9500_40X# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/test_api_configure_trustpoint.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/test_api_configure_trustpoint.py index c625601bb..a4903bb55 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/test_api_configure_trustpoint.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/pki/configure/configure_trustpoint/test_api_configure_trustpoint.py @@ -1,3 +1,4 @@ +import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.pki.configure import configure_trustpoint @@ -7,21 +8,21 @@ class TestConfigureTrustpoint(unittest.TestCase): @classmethod def setUpClass(self): - testbed = """ + testbed = f""" devices: - ipsec_reg8_new: + SVL_9500_40X: connections: defaults: class: unicon.Unicon a: - command: mock_device_cli --os iosxe --mock_data_dir mock_data --state connect + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: iosxe - type: iosxe + platform: c9500 + type: c9500 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['ipsec_reg8_new'] + self.device = self.testbed.devices['SVL_9500_40X'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -29,6 +30,6 @@ def setUpClass(self): ) def test_configure_trustpoint(self): - result = configure_trustpoint(self.device, 'crl', '1024', 'test', 'True', 'regenerate', 'True', 'yes', None, 'test', 'yes', 'yes', 'all', 100, 'True', 'linux', '10.0.0.1', 'bootflash:tp_chain_location_test', 'True', 'True', 'C = IN', 'True', '100', '100', None, None, None, 'True', None, 'bootflash:test_enroll_url', '10', '10', 'True', None, 'none', 'sha512', 'test 1000', 'none', 'inherit ipv4', None, 'vrf', '10.0.0.1', '80', 'True', None, 'test', 'True', 'True', 'none', 'proxy http://10.20.20.2', 'none', 'True', 'GigabitEthernet10', None, None, 'ike', 'test') + result = configure_trustpoint(self.device, 'None', 'Self', 2048, False, None, False, None, None, None, None, None, None, None, False, None, None, None, False, False, None, False, False, False, None, None, None, False, 'selfsigned', None, False, False, False, None, None, None, None, None, None, None, None, None, False, False, None, None, False, False, None, None, None, False, None, None, None, None, None, 'cn=Self', None, None) expected_output = None self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..0e2548829 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + action cli reload: "action cli reload\r\n" + description RELOAD: "description RELOAD\r\n" + end: + new_state: execute + event manager applet RELOAD: "event manager applet RELOAD\r\n" + event none sync yes: "event none sync yes\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: MSFT_9500H_SPINE(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: MSFT_9500H_SPINE(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: MSFT_9500H_SPINE# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/test_api_configure_event_manager.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/test_api_configure_event_manager.py new file mode 100644 index 000000000..b42f23d8e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_event_manager/test_api_configure_event_manager.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_event_manager + + +class TestConfigureEventManager(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + MSFT_9500H_SPINE: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['MSFT_9500H_SPINE'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_event_manager(self): + result = configure_event_manager(self.device, 'RELOAD', 'RELOAD', 'sync', 'yes', 'cli', 'reload') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_server_enable/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_server_enable/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..126e15b7a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_server_enable/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + ip scp server enable: "ip scp server enable\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: GD_F12(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: GD_F12(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: GD_F12# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_server_enable/test_api_configure_ip_scp_server_enable.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_server_enable/test_api_configure_ip_scp_server_enable.py new file mode 100644 index 000000000..ad6d4519c --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_scp_server_enable/test_api_configure_ip_scp_server_enable.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_ip_scp_server_enable + + +class TestConfigureIpScpServerEnable(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + GD_F12: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['GD_F12'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_scp_server_enable(self): + result = configure_ip_scp_server_enable(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_ssh_source_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_ssh_source_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..1e87926a8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_ssh_source_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + ip ssh source-interface Gig0: "ip ssh source-interface Gig0\r\n" + line console 0: + new_state: configure_line + no logging console: '' + prompt: GD_F12(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: GD_F12(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: GD_F12# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_ssh_source_interface/test_api_configure_ip_ssh_source_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_ssh_source_interface/test_api_configure_ip_ssh_source_interface.py new file mode 100644 index 000000000..32053e893 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_ip_ssh_source_interface/test_api_configure_ip_ssh_source_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_ip_ssh_source_interface + + +class TestConfigureIpSshSourceInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + GD_F12: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['GD_F12'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_ip_ssh_source_interface(self): + result = configure_ip_ssh_source_interface(self.device, 'Gig0') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..381bdc2b6 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + platform qfp drops threshold per-cause 2 10: "platform qfp drops threshold per-cause\ + \ 2 10\r\n" + platform qfp drops threshold total 20: "platform qfp drops threshold total 20\r\n" + prompt: Router(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Router(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: Router# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/test_api_configure_qfp_drop_threshold.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/test_api_configure_qfp_drop_threshold.py new file mode 100644 index 000000000..a7b10502a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/configure_qfp_drop_threshold/test_api_configure_qfp_drop_threshold.py @@ -0,0 +1,40 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import configure_qfp_drop_threshold + + +class TestConfigureQfpDropThreshold(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: ASR1K + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Router'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_qfp_drop_threshold_percause(self): + result = configure_qfp_drop_threshold(self.device, 10, drop_id=2) + expected_output = None + self.assertEqual(result, expected_output) + + def test_configure_qfp_drop_threshold_total(self): + result = configure_qfp_drop_threshold(self.device, 20) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/test_api_copy_file_with_scp.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/test_api_copy_file_with_scp.py index 76ec2a35b..d673071c0 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/test_api_copy_file_with_scp.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/copy_file_with_scp/test_api_copy_file_with_scp.py @@ -2,6 +2,7 @@ import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.platform.configure import copy_file_with_scp +from genie.libs.sdk.apis.utils import sanitize class TestCopyFileWithScp(unittest.TestCase): @@ -39,4 +40,4 @@ def test_copy_file_with_scp(self): # Device output inconsistently includes device prompt if result.endswith('#'): expected_output += '\r\nT13-C9300-24T#' - self.assertEqual(result, expected_output) + self.assertEqual(sanitize(result), sanitize(expected_output)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_server_enable/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_server_enable/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..045e9963a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_server_enable/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip scp server enable: "no ip scp server enable\r\n" + no logging console: '' + prompt: GD_F12(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: GD_F12(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: GD_F12# \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_server_enable/test_api_unconfigure_ip_scp_server_enable.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_server_enable/test_api_unconfigure_ip_scp_server_enable.py new file mode 100644 index 000000000..2a6dbf6b5 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_scp_server_enable/test_api_unconfigure_ip_scp_server_enable.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_ip_scp_server_enable + + +class TestUnconfigureIpScpServerEnable(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + GD_F12: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['GD_F12'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_scp_server_enable(self): + result = unconfigure_ip_scp_server_enable(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_ssh_source_interface/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_ssh_source_interface/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..ca54ab05e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_ssh_source_interface/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no ip ssh source-interface: "no ip ssh source-interface\r\n" + no logging console: '' + prompt: GD_F12(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: GD_F12(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: GD_F12# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_ssh_source_interface/test_api_unconfigure_ip_ssh_source_interface.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_ssh_source_interface/test_api_unconfigure_ip_ssh_source_interface.py new file mode 100644 index 000000000..26c80d571 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_ip_ssh_source_interface/test_api_unconfigure_ip_ssh_source_interface.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_ip_ssh_source_interface + + +class TestUnconfigureIpSshSourceInterface(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + GD_F12: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: iosxe + type: iosxe + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['GD_F12'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_ip_ssh_source_interface(self): + result = unconfigure_ip_ssh_source_interface(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..7119ef932 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,37 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no platform qfp drops threshold per-cause 2 10: "no platform qfp drops threshold\ + \ per-cause 2 10\r\n" + no platform qfp drops threshold total 20: "no platform qfp drops threshold total 20\r\n" + prompt: Router(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Router(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: Router# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/test_api_unconfigure_qfp_drop_threshold.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/test_api_unconfigure_qfp_drop_threshold.py new file mode 100644 index 000000000..30188a169 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_qfp_drop_threshold/test_api_unconfigure_qfp_drop_threshold.py @@ -0,0 +1,40 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_qfp_drop_threshold + + +class TestUnconfigureQfpDropThreshold(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Router: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: ASR1K + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Router'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_qfp_drop_threshold_percause(self): + result = unconfigure_qfp_drop_threshold(self.device, 10, drop_id=2) + expected_output = None + self.assertEqual(result, expected_output) + + def test_unconfigure_qfp_drop_threshold_total(self): + result = unconfigure_qfp_drop_threshold(self.device, 20) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..d33b0a0ed --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + no time-range test: "no time-range test\r\n" + prompt: Startrek-SVL(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Startrek-SVL(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: Startrek-SVL# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/test_api_unconfigure_time_range.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/test_api_unconfigure_time_range.py new file mode 100644 index 000000000..981051ee7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/configure/unconfigure_time_range/test_api_unconfigure_time_range.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.configure import unconfigure_time_range + + +class TestUnconfigureTimeRange(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Startrek-SVL: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: router + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Startrek-SVL'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_unconfigure_time_range(self): + result = unconfigure_time_range(self.device, 'test') + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..c4543699e --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: 9404-Access(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: 9404-Access(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + clear ip pim rp-mapping: + response: + - '' + response_type: circular + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: 9404-Access# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/test_api_clear_ip_pim_rp_mapping.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/test_api_clear_ip_pim_rp_mapping.py new file mode 100644 index 000000000..6a0e6f43a --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/clear_ip_pim_rp_mapping/test_api_clear_ip_pim_rp_mapping.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.execute import clear_ip_pim_rp_mapping + + +class TestClearIpPimRpMapping(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + 9404-Access: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9400 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['9404-Access'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_clear_ip_pim_rp_mapping(self): + result = clear_ip_pim_rp_mapping(self.device) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3eb1b9d26 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: MSFT_9500H_SPINE(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: MSFT_9500H_SPINE(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + event manager run RELOAD: + response: + - '' + response_type: circular + show version: '' + term length 0: '' + term width 0: '' + prompt: MSFT_9500H_SPINE# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/test_api_execute_event_manager_run_with_reload.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/test_api_execute_event_manager_run_with_reload.py new file mode 100644 index 000000000..f710822c7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_event_manager_run_with_reload/test_api_execute_event_manager_run_with_reload.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.platform.execute import execute_event_manager_run_with_reload + + +class TestExecuteEventManagerRunWithReload(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + MSFT_9500H_SPINE: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: c9500 + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['MSFT_9500H_SPINE'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_execute_event_manager_run_with_reload(self): + result = execute_event_manager_run_with_reload(self.device, 'lab', 'lab', 'RELOAD', 10) + expected_output = True + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/mock_data/iosxe/mock_data.yaml index 6a3af3d0e..0df190ceb 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/mock_data/iosxe/mock_data.yaml @@ -5,13 +5,13 @@ configure: line console 0: new_state: configure_line no logging console: '' - prompt: 9300stack(config)# + prompt: AMZ-Acc-4(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: 9300stack(config-line)# + prompt: AMZ-Acc-4(config-line)# connect: commands: ? '' @@ -30,21 +30,10 @@ execute: new_state: configure reload fast: response: - - "Reload fast command is being issued on Active unit, this will reload fast\ - \ the whole stack\r\nProceed with reload fast? [confirm]\r\nNot able to run\ - \ this command in bundle boot mode\r\nSTACK_GR: Inside xFSU check if switch\ - \ stack\r\nFast software upgrade is not supported in a half ring stack. Please\ - \ connect the stack in full ring formation to perform fast software upgrade.\r\ - \nChecking STP eligibility: Ineligible\r\n:Not met since STP check failed\ - \ due to Root Switch with forwarding link\r\n[1 2]: Performing xFSU-pre-check\r\ - \n PID TTY TIME CMD\r\n SUCCESS: xFSU-pre-check finished\r\n[1]:\ - \ xFSU-pre-check package(s) on switch 1\r\nFAILED: Switch 1 Rommon variable\ - \ MANUAL_BOOT is set to yes. Please configure MANUAL_BOOT to no before performing\ - \ fast software upgrade.\r\r\n[1]: Finished xFSU-pre-check failed on switch\ - \ 1\r\nFAILED: xFSU requirement pre-check\r\nFAILED: Abort xFSU since requirement\ - \ does not met" + - 'Press RETURN to get started' + - 'Username:Password:AMZ-Acc-4>Password:' response_type: circular show version: '' term length 0: '' term width 0: '' - prompt: 9300stack# + prompt: AMZ-Acc-4# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/test_api_execute_reload_fast.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/test_api_execute_reload_fast.py index d01c57fb0..94903c220 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/test_api_execute_reload_fast.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/platform/execute/execute_reload_fast/test_api_execute_reload_fast.py @@ -10,7 +10,7 @@ class TestExecuteReloadFast(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - 9300stack: + AMZ-Acc-4: connections: defaults: class: unicon.Unicon @@ -19,10 +19,10 @@ def setUpClass(self): protocol: unknown os: iosxe platform: cat9k - type: router + type: c9300 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['9300stack'] + self.device = self.testbed.devices['AMZ-Acc-4'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,6 +30,6 @@ def setUpClass(self): ) def test_execute_reload_fast(self): - result = execute_reload_fast(self.device, None) - expected_output = None + result = execute_reload_fast(self.device, None, 'lab', 'lab', 10, 600) + expected_output = True self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py index 0aafc69a5..12582d3f4 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/redundancy/execute/execute_redundancy_reload/test_api_execute_redundancy_reload.py @@ -1,6 +1,7 @@ import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.redundancy.execute import execute_redundancy_reload +from genie.libs.sdk.apis.utils import sanitize class TestExecuteRedundancyReload(unittest.TestCase): @@ -36,4 +37,4 @@ def test_execute_redundancy_reload(self): # Device output inconsistently includes device prompt if result.endswith('#'): expected_output += '\r\nstartrek-1#' - self.assertEqual(result, expected_output) + self.assertEqual(sanitize(result), sanitize(expected_output)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..3996b1ef3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,35 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + spanning-tree mst 0 priority 4096: "spanning-tree mst 0 priority 4096\r\n" + prompt: Switch(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: Switch(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: Switch# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/test_api_configure_spanning_tree_mst_priority.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/test_api_configure_spanning_tree_mst_priority.py new file mode 100644 index 000000000..0473593b4 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/spanning_tree/configure/configure_spanning_tree_mst_priority/test_api_configure_spanning_tree_mst_priority.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.spanning_tree.configure import configure_spanning_tree_mst_priority + + +class TestConfigureSpanningTreeMstPriority(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + Switch2: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: c9500L + type: c9500L + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['Switch2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_spanning_tree_mst_priority(self): + result = configure_spanning_tree_mst_priority(self.device, 0, 4096) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e7f705fd7 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,42 @@ +configure: + commands: + encoding encode-kvgpb: "encoding encode-kvgpb\r\n" + end: + new_state: execute + filter xpath /process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-seconds: "filter\ + \ xpath /process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-seconds\r\n" + line console 0: + new_state: configure_line + no logging console: '' + receiver ip address 192.168.0.11 56789 protocol grpc-tcp: "receiver ip address\ + \ 192.168.0.11 56789 protocol grpc-tcp\r\n" + stream yang-push: "stream yang-push\r\n" + telemetry ietf subscription 501: "telemetry ietf subscription 501\r\n" + update-policy periodic 500: "update-policy periodic 500\r\n" + prompt: ott-isr4k-32(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: ott-isr4k-32(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: ott-isr4k-32# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/test_api_configure_telemetry_ietf_parameters.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/test_api_configure_telemetry_ietf_parameters.py new file mode 100644 index 000000000..f18d7f8af --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/telemetry/configure/configure_telemetry_ietf_parameters/test_api_configure_telemetry_ietf_parameters.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.telemetry.configure import configure_telemetry_ietf_parameters + + +class TestConfigureTelemetryIetfParameters(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + ott-isr4k-32: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: isr4k + type: isr4k + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['ott-isr4k-32'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_telemetry_ietf_parameters(self): + result = configure_telemetry_ietf_parameters(self.device, 501, 'yang-push', '192.168.0.11', 56789, 'grpc-tcp', '/process-cpu-ios-xe-oper:cpu-usage/cpu-utilization/five-seconds', 'encode-kvgpb', 'periodic', 500, None, None) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/mock_data/iosxe/mock_data.yaml index 53b116c4e..02bb64c38 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/mock_data/iosxe/mock_data.yaml +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/mock_data/iosxe/mock_data.yaml @@ -5,13 +5,13 @@ configure: line console 0: new_state: configure_line no logging console: '' - prompt: stack3-nyquist-1(config)# + prompt: 9350-stack-1(config)# configure_line: commands: end: new_state: execute exec-timeout 0: '' - prompt: stack3-nyquist-1(config-line)# + prompt: 9350-stack-1(config-line)# connect: commands: ? '' @@ -28,12 +28,44 @@ execute: new_state: configure config-transaction: new_state: configure - request platform software system shell switch active R0: + exit: + response: + - "exit\r\nSession log crashinfo:tracelogs/system_shell_R0-0.31502_0.20231010095010.bin\ + \ closed." + response_type: circular + ls: response: - - "Activity within this shell can jeopardize the functioning of the system.\r\ - \nAre you sure you want to continue? [y/n]" + - "3pa\t\t dev\t lib64\t\t sbin\r\nPOE\t\t disk0\t lic0\t\ + \t sdwan-utils\r\napp\t\t drec0\t lic1\t\t sys\r\nappstore_flash\t\ + \ etc\t lua\t\t tftp\r\nappstore_hd\t explode\t misc\t\ + \t tmp\r\nauto\t\t explode-common mnt\t\t ucode0\r\nbin\t\t firmware\t\ + \ mount_packages.sh umount_packages.sh\r\nbless\t\t flash\t \ + \ ngwc_config\t usb0\r\nbootflash\t guestshell obfl0\t\t usb1\r\ + \ncodesign.pubkey harddisk\t opt\t\t usr\r\ncodesign.revkey \ + \ hugepages.sh platform-specific var\r\ncommon\t\t init\t \ + \ proc\t\t verify_packages.sh\r\nconfig\t\t initrd.image rmon_vars.sh\t\ + \ webui\r\ncopy_act2_sr_libs.sh install\t rommon_to_env\r\ncpld_util.sh\t\ + \ issu\t root\r\ncrashinfo\t lib\t run" response_type: circular + request platform software system shell switch active R0: + response: + - "Activity within this shell can jeopardize the functioning of the system." + new_state: confirm_dialog show version: '' term length 0: '' term width 0: '' - prompt: stack3-nyquist-1# + prompt: 9350-stack-1# +confirm_dialog: + prompt: "Are you sure you want to continue? [y/n] " + commands: + "y": + response: + - "2023/10/10 09:50:10 :\ + \ Shell access was granted to user ; Trace file: , /crashinfo/tracelogs/system_shell_R0-0.31502_0.20231010095010.bin\r\ + \n********************************************************************** \r\ + \nActivity within this shell can jeopardize the functioning \r\nof the system.\r\ + \nUse this functionality only under supervision of Cisco Support.\r\n\r\n\ + Session will be logged to:\r\n crashinfo:tracelogs/system_shell_R0-0.31502_0.20231010095010.bin\r\ + \n********************************************************************** \r\ + \nTerminal type 'network' unknown. Assuming vt100\r\n" + new_state: execute diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/test_api_request_system_shell.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/test_api_request_system_shell.py index 5b69cfc2a..545c6c887 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/test_api_request_system_shell.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/utils/request_system_shell/test_api_request_system_shell.py @@ -10,7 +10,7 @@ class TestRequestSystemShell(unittest.TestCase): def setUpClass(self): testbed = f""" devices: - stack3-nyquist-1: + 9350-stack-1: connections: defaults: class: unicon.Unicon @@ -18,11 +18,11 @@ def setUpClass(self): command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect protocol: unknown os: iosxe - platform: cat9k - type: router + platform: c9350 + type: c9350 """ self.testbed = loader.load(testbed) - self.device = self.testbed.devices['stack3-nyquist-1'] + self.device = self.testbed.devices['9350-stack-1'] self.device.connect( learn_hostname=True, init_config_commands=[], @@ -30,7 +30,35 @@ def setUpClass(self): ) def test_request_system_shell(self): - result = request_system_shell(self.device, 'active', 'R0', False, False, None) + self.maxDiff = None + result = request_system_shell(self.device, 'active', 'R0', False, True, 'ls', 60) expected_output = ('Activity within this shell can jeopardize the functioning of the system.\r\n' - 'Are you sure you want to continue? [y/n]') + 'Are you sure you want to continue? [y/n] y\r\n' + '2023/10/10 09:50:10 : Shell access was granted to user ; Trace file: , ' + '/crashinfo/tracelogs/system_shell_R0-0.31502_0.20231010095010.bin\r\n' + '********************************************************************** \r\n' + 'Activity within this shell can jeopardize the functioning \r\n' + 'of the system.\r\n' + 'Use this functionality only under supervision of Cisco Support.\r\n' + '\r\n' + 'Session will be logged to:\r\n' + ' crashinfo:tracelogs/system_shell_R0-0.31502_0.20231010095010.bin\r\n' + '********************************************************************** \r\n' + "Terminal type 'network' unknown. Assuming vt100" + '3pa\t\t dev\t lib64\t\t sbin\r\n' + 'POE\t\t disk0\t lic0\t\t sdwan-utils\r\n' + 'app\t\t drec0\t lic1\t\t sys\r\n' + 'appstore_flash\t etc\t lua\t\t tftp\r\n' + 'appstore_hd\t explode\t misc\t\t tmp\r\n' + 'auto\t\t explode-common mnt\t\t ucode0\r\n' + 'bin\t\t firmware\t mount_packages.sh umount_packages.sh\r\n' + 'bless\t\t flash\t ngwc_config\t usb0\r\n' + 'bootflash\t guestshell obfl0\t\t usb1\r\n' + 'codesign.pubkey harddisk\t opt\t\t usr\r\n' + 'codesign.revkey hugepages.sh platform-specific var\r\n' + 'common\t\t init\t proc\t\t verify_packages.sh\r\n' + 'config\t\t initrd.image rmon_vars.sh\t webui\r\n' + 'copy_act2_sr_libs.sh install\t rommon_to_env\r\n' + 'cpld_util.sh\t issu\t root\r\n' + 'crashinfo\t lib\t run') self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..5d9e6eccc --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface range vlan 11-20: "interface range vlan 11-20\r\n" + line console 0: + new_state: configure_line + no logging console: '' + no shutdown: "no shutdown\r\n" + prompt: A1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: A1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: A1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/test_api_configure_no_shutdown_vlan_interface_range.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/test_api_configure_no_shutdown_vlan_interface_range.py new file mode 100644 index 000000000..68703e05f --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_no_shutdown_vlan_interface_range/test_api_configure_no_shutdown_vlan_interface_range.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import configure_no_shutdown_vlan_interface_range + + +class TestConfigureNoShutdownVlanInterfaceRange(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + A1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: single_rp + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['A1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_no_shutdown_vlan_interface_range(self): + result = configure_no_shutdown_vlan_interface_range(self.device, 11, 20) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/mock_data/iosxe/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/mock_data/iosxe/mock_data.yaml new file mode 100644 index 000000000..e8dd941fa --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/mock_data/iosxe/mock_data.yaml @@ -0,0 +1,36 @@ +configure: + commands: + end: + new_state: execute + interface range vlan 11-20: "interface range vlan 11-20\r\n" + line console 0: + new_state: configure_line + no logging console: '' + shutdown: "shutdown\r\n" + prompt: A1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: A1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + term length 0: '' + term width 0: '' + prompt: A1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/test_api_configure_shutdown_vlan_interface_range.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/test_api_configure_shutdown_vlan_interface_range.py new file mode 100644 index 000000000..4d06d2af9 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/iosxe/vlan/configure/configure_shutdown_vlan_interface_range/test_api_configure_shutdown_vlan_interface_range.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.iosxe.vlan.configure import configure_shutdown_vlan_interface_range + + +class TestConfigureShutdownVlanInterfaceRange(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + A1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os iosxe --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: iosxe + platform: cat9k + type: single_rp + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['A1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_configure_shutdown_vlan_interface_range(self): + result = configure_shutdown_vlan_interface_range(self.device, 11, 20) + expected_output = None + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/mock_data/linux/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/mock_data/linux/mock_data.yaml new file mode 100644 index 000000000..dd639c618 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/mock_data/linux/mock_data.yaml @@ -0,0 +1,38 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: vm1-ubuntu1(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: vm1-ubuntu1(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + snmpwalk -v3 -u snmp-poller -A PASSWORD1 -l authPriv -a SHA -x AES -X PASSWORD1 10.7.21.121 SNMPv2-MIB::sysName None: + response: + - "\rSNMPv2-MIB::sysName.0 = STRING: MSFT_9300_LEAF1.cisco.com" + response_type: circular + term length 0: '' + term width 0: '' + prompt: vm1-ubuntu1# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/test_api_get_snmp_snmpwalk_sysname.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/test_api_get_snmp_snmpwalk_sysname.py new file mode 100644 index 000000000..8d68aadd8 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_sysname/test_api_get_snmp_snmpwalk_sysname.py @@ -0,0 +1,35 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.linux.snmp.get import get_snmp_snmpwalk_sysname + + +class TestGetSnmpSnmpwalkSysname(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + vm1-ubuntu1: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os linux --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: linux + platform: linux + type: linux + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['vm1-ubuntu1'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_get_snmp_snmpwalk_sysname(self): + result = get_snmp_snmpwalk_sysname(self.device, '10.7.21.121', 'SNMPv2-MIB::sysName', 'snmp-poller', 'PASSWORD1', 'authPriv', 'SHA', '/home/vm1/snmp', 'AES', 'PASSWORD1', '3', 'None') + expected_output = '\r\nSNMPv2-MIB::sysName.0 = STRING: MSFT_9300_LEAF1.cisco.com' + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/__init__.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/mock_data/linux/mock_data.yaml b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/mock_data/linux/mock_data.yaml new file mode 100644 index 000000000..37fe6d4e3 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/mock_data/linux/mock_data.yaml @@ -0,0 +1,48 @@ +configure: + commands: + end: + new_state: execute + line console 0: + new_state: configure_line + no logging console: '' + prompt: morph-full2(config)# +configure_line: + commands: + end: + new_state: execute + exec-timeout 0: '' + prompt: morph-full2(config-line)# +connect: + commands: + ? '' + : new_state: execute + preface: 'Trying mock_device ... + + Connected to mock_device. + + Escape character is ''^]''.' + prompt: '' +execute: + commands: + config term: + new_state: configure + config-transaction: + new_state: configure + show version: '' + snmpwalk -v 3 -u testUsr -A password1 -l authNoPriv -a sha -x des -X password 172.20.249.11 1.3.6.1.4.1.9.9.25.1.1.1.2: + response: + - "SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.1 = STRING: \"CW_BEGIN$-gs-universalk9-m$\"\ + \r\nSNMPv2-SMI::enterprises.9.9.25.1.1.1.2.2 = STRING: \"CW_IMAGE$CAT9K_IOSXE$\"\ + \r\nSNMPv2-SMI::enterprises.9.9.25.1.1.1.2.3 = STRING: \"CW_FAMILY$CAT9K_IOSXE$\"\ + \r\nSNMPv2-SMI::enterprises.9.9.25.1.1.1.2.4 = STRING: \"CW_FEATURE$IP|SLA|IPv6|IS-IS|FIREWALL|PLUS|QoS|HA|NAT|MPLS|VPN|LEGACY\ + \ PROTOCOLS|3DES|SSH|APPN|IPSEC$\"\r\nSNMPv2-SMI::enterprises.9.9.25.1.1.1.2.5\ + \ = STRING: \"CW_VERSION$17.13.20230427:005651$\"\r\nSNMPv2-SMI::enterprises.9.9.25.1.1.1.2.6\ + \ = STRING: \"CW_MEDIA$RAM$\"\r\nSNMPv2-SMI::enterprises.9.9.25.1.1.1.2.7\ + \ = STRING: \"CW_SYSDESCR$Cisco IOS Software [Dublin], Catalyst L3 Switch\ + \ Software (CAT9K_IOSXE), Experimental Version 17.13.20230427:005651 [BLD_POLARIS_DEV_LATEST_20230427_003231:/nobackup/mcpre/s2c-build-ws\ + \ 101]\r\nCopyright (c) 1986-2023 by Cisco Systems, Inc.\r\nCompil+\"\r\n\ + SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.8 = STRING: \"CW_END$-gs-universalk9-m$\"" + response_type: circular + term length 0: '' + term width 0: '' + prompt: morph-full2# diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/test_api_get_snmp_snmpwalk_version3.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/test_api_get_snmp_snmpwalk_version3.py new file mode 100644 index 000000000..903f129fd --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/linux/snmp/get/get_snmp_snmpwalk_version3/test_api_get_snmp_snmpwalk_version3.py @@ -0,0 +1,54 @@ +import os +import unittest +from pyats.topology import loader +from genie.libs.sdk.apis.linux.snmp.get import get_snmp_snmpwalk_version3 + + +class TestGetSnmpSnmpwalkVersion3(unittest.TestCase): + + @classmethod + def setUpClass(self): + testbed = f""" + devices: + morph-full2: + connections: + defaults: + class: unicon.Unicon + a: + command: mock_device_cli --os linux --mock_data_dir {os.path.dirname(__file__)}/mock_data --state connect + protocol: unknown + os: linux + platform: linux + type: linux + """ + self.testbed = loader.load(testbed) + self.device = self.testbed.devices['morph-full2'] + self.device.connect( + learn_hostname=True, + init_config_commands=[], + init_exec_commands=[] + ) + + def test_get_snmp_snmpwalk_version3(self): + result = get_snmp_snmpwalk_version3(self.device, '172.20.249.11', '1.3.6.1.4.1.9.9.25.1.1.1.2', '3', 'testUsr', '-A', 'password1', '-l', '-a', 'authNoPriv', 'sha', 'des', 'password', None) + expected_output = ('SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.1 = STRING: ' + '"CW_BEGIN$-gs-universalk9-m$"\r\n' + 'SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.2 = STRING: ' + '"CW_IMAGE$CAT9K_IOSXE$"\r\n' + 'SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.3 = STRING: ' + '"CW_FAMILY$CAT9K_IOSXE$"\r\n' + 'SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.4 = STRING: ' + '"CW_FEATURE$IP|SLA|IPv6|IS-IS|FIREWALL|PLUS|QoS|HA|NAT|MPLS|VPN|LEGACY ' + 'PROTOCOLS|3DES|SSH|APPN|IPSEC$"\r\n' + 'SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.5 = STRING: ' + '"CW_VERSION$17.13.20230427:005651$"\r\n' + 'SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.6 = STRING: "CW_MEDIA$RAM$"\r\n' + 'SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.7 = STRING: "CW_SYSDESCR$Cisco IOS ' + 'Software [Dublin], Catalyst L3 Switch Software (CAT9K_IOSXE), Experimental ' + 'Version 17.13.20230427:005651 ' + '[BLD_POLARIS_DEV_LATEST_20230427_003231:/nobackup/mcpre/s2c-build-ws 101]\r\n' + 'Copyright (c) 1986-2023 by Cisco Systems, Inc.\r\n' + 'Compil+"\r\n' + 'SNMPv2-SMI::enterprises.9.9.25.1.1.1.2.8 = STRING: ' + '"CW_END$-gs-universalk9-m$"') + self.assertEqual(result, expected_output) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py index ea5aa7414..dd1da768f 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/test_utils.py @@ -60,6 +60,22 @@ def test_copy_from_device_via_proxy(self): copy_from_device(device, local_path='flash:test.txt') assert re.search(r'copy flash:test.txt http://\w+:\w+@127.0.0.2:2000/router_test.txt', str(device.execute.call_args)) + def test_copy_from_device_via_testbed_servers_proxy(self): + device = MagicMock() + device.hostname = 'router' + device.os = 'iosxe' + device.via = 'cli' + device.connections['cli'].get = Mock(return_value={}) + device.api.get_mgmt_ip_and_mgmt_src_ip_addresses = Mock(return_value=('127.0.0.1', ['127.0.0.2'])) + device.api.get_local_ip = Mock(return_value='127.0.0.1') + server = MagicMock() + server.api.socat_relay = Mock(return_value=2000) + server.execute = Mock(return_value='inet 127.0.0.2') + device.testbed.servers = Mock(return_value=server) + device.api.convert_server_to_linux_device = Mock(return_value=server) + copy_from_device(device, local_path='flash:test.txt') + assert re.search(r'copy flash:test.txt http://\w+:\w+@127.0.0.2:2000/router_test.txt', str(device.execute.call_args)) + def test_copy_to_device(self): device = MagicMock() device.os = 'iosxe' @@ -83,6 +99,22 @@ def test_copy_to_device_via_proxy(self): copy_to_device(device, remote_path='/tmp/test.txt') assert re.search(r'copy http://\w+:\w+@127.0.0.2:2000/test.txt flash:', str(device.execute.call_args)) + def test_copy_to_device_via_testbed_servers_proxy(self): + device = MagicMock() + device.hostname = 'router' + device.os = 'iosxe' + device.via = 'cli' + device.connections['cli'].get = Mock(return_value={}) + device.api.get_mgmt_ip_and_mgmt_src_ip_addresses = Mock(return_value=('127.0.0.1', ['127.0.0.2'])) + device.api.get_local_ip = Mock(return_value='127.0.0.1') + server = MagicMock() + server.api.socat_relay = Mock(return_value=2000) + server.execute = Mock(return_value='inet 127.0.0.2') + device.testbed.servers = Mock(return_value=server) + device.api.convert_server_to_linux_device = Mock(return_value=server) + copy_to_device(device, remote_path='/tmp/test.txt') + assert re.search(r'copy http://\w+:\w+@127.0.0.2:2000/test.txt flash:', str(device.execute.call_args)) + def test_device_recovery_boot(self): device = create_test_device(name='aDevice', os='iosxe') device.destroy = Mock() diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py index 6d41fa21c..9624ba9de 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/apis/utils.py @@ -976,9 +976,15 @@ def copy_to_device(device, # Check if we are connected via proxy device proxy = device.connections[device.via].get('proxy') or \ device.connections[device.via].get('sshtunnel', {}).get('host') - if proxy and isinstance(proxy, str): + + proxy_dev = None + # If we haven't gotten a proxy, check servers for a proxy + if not proxy and device.testbed.servers.get('proxy'): + proxy_dev = device.api.convert_server_to_linux_device('proxy') + + if proxy and isinstance(proxy, str) or proxy_dev: log.info('Setting up port relay via proxy') - proxy_dev = device.testbed.devices[proxy] + proxy_dev = proxy_dev or device.testbed.devices[proxy] proxy_dev.connect() proxy_port = proxy_dev.api.socat_relay(remote_ip=local_ip, remote_port=local_port) @@ -1149,9 +1155,15 @@ def copy_from_device(device, # Check if we are connected via proxy device proxy = device.connections[device.via].get('proxy') or \ device.connections[device.via].get('sshtunnel', {}).get('host') - if proxy and isinstance(proxy, str): + + proxy_dev = None + # If we haven't gotten a proxy, check servers for a proxy + if not proxy and device.testbed.servers.get('proxy'): + proxy_dev = device.api.convert_server_to_linux_device('proxy') + + if proxy and isinstance(proxy, str) or proxy_dev: log.info('Setting up port relay via proxy') - proxy_dev = device.testbed.devices[proxy] + proxy_dev = proxy_dev or device.testbed.devices[proxy] proxy_dev.connect() proxy_port = proxy_dev.api.socat_relay(remote_ip=local_ip, remote_port=local_port) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py index 94876172a..fdab4d3a8 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxe/processors.py @@ -185,13 +185,14 @@ def learn_routing(device, setdefault(ip, {}).update({device.name: keys}) -def check_memory_leaks(section, devices, keywords): +def check_memory_leaks(section, devices, keywords, timeout=60): '''Check memory leaks by show memory debug leaks command Args: devices (`list`): List of device name keywords (`list`): List of keywords - + timeout (`int`): Timeout value. default: 60 + Returns: None @@ -202,7 +203,7 @@ def check_memory_leaks(section, devices, keywords): def _check_memory_leaks(device, keywords): try: - out = device.execute('show memory debug leaks') + out = device.execute('show memory debug leaks', timeout=timeout) except Exception as e: log.exception(e) out = {} diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/restore.py b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/restore.py index e01644d4f..1e0b5b10a 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/restore.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/restore.py @@ -25,21 +25,22 @@ def save_configuration_to_file(self, device, default_dir, file_name): except Exception as e: self.failed('Saving the configuration failed', from_exception=e) - def save_configuration(self, device, method, abstract, default_dir): + def save_configuration(self, device, method, abstract, default_dir, timeout=60): try: self.lib.save_configuration( - device, method, self.abstract, default_dir) + device, method, self.abstract, default_dir, timeout=timeout) except Exception as e: self.failed('Saving the configuration failed', from_exception=e) def restore_configuration(self, device, method, abstract, iteration=10, - interval=60, delete_after_restore=True): + interval=60, delete_after_restore=True, timeout=60): try: self.lib.restore_configuration( device, method, self.abstract, - delete_after_restore=delete_after_restore) + delete_after_restore=delete_after_restore, + timeout=timeout) except Exception as e: self.failed('Restoring the configuration failed', from_exception=e) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions.py index 25e524dfd..defc777d8 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions.py @@ -811,6 +811,7 @@ def configure_replace(self, health_uids=None, health_groups=None, health_sections=None, + timeout=60, **kwargs): if 'ret_dict' in kwargs: @@ -830,6 +831,7 @@ def configure_replace(self, iteration=iteration, interval=interval, delete_after_restore=False, + timeout=timeout ) # steps.result will only change to result_status if it is passed. if result_status and steps.result.name == "passed": @@ -854,6 +856,7 @@ def save_config_snapshot(self, health_uids=None, health_groups=None, health_sections=None, + timeout=60, **kwargs): if 'ret_dict' in kwargs: @@ -881,7 +884,8 @@ def save_config_snapshot(self, device=device, abstract=None, method='config_replace', - default_dir=self.parent.default_file_system) + default_dir=self.parent.default_file_system, + timeout=timeout) # To keep track of snapshots (whether they are deleted or not) self.restore[device].snapshot_deleted = False @@ -910,6 +914,7 @@ def restore_config_snapshot(self, health_uids=None, health_groups=None, health_sections=None, + timeout=60, **kwargs): if 'ret_dict' in kwargs: kwargs.pop('ret_dict') @@ -930,7 +935,8 @@ def restore_config_snapshot(self, device=device, abstract=None, method='config_replace', - delete_after_restore=delete_snapshot) + delete_after_restore=delete_snapshot, + timeout=timeout) except Exception as e: steps.failed(str(e)) diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py index 4484f2cb8..d954cf43a 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/actions_helper.py @@ -255,6 +255,11 @@ def api_handler(step, # check if device has API attribute, otherwise fallback to device default behavior api_function = device if not hasattr(device, 'api') else device.api + # check if command as device object + # tgn action uses device object function + if command not in dir(api_function) and command in dir(device): + api_function = device + # Skip if API is not available if command in dir(api_function): try: diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py index 9b3dad1ca..3d983327d 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/gnmi_util.py @@ -21,6 +21,7 @@ from yang.connector.gnmi import Gnmi from .rpcverify import DecodedField, DeletedPath from copy import deepcopy +from .subscription import Subscription log = logging.getLogger(__name__) @@ -879,11 +880,23 @@ def get_payload(self, update): return update[0]['value'] json_val = {} processed_xp = [] + list_nodes = [] for node in update: ind = 0 xp = node['xpath'] if xp.endswith(']'): xp = xp + '/' + if '[' in xp: + # child node of list + # get the name of the list node + list_xpath = node['xpath'] + while '[' in list_xpath: + list_xpath = list_xpath[:list_xpath.rfind('[')] + if not list_xpath.endswith(']'): + list_node = list_xpath[list_xpath.rfind('/'):] + list_node = list_node.strip('/') + if not list_node in list_nodes: + list_nodes.append(list_node) if xp in processed_xp: if node['nodetype'] != 'leaf-list': continue @@ -982,8 +995,24 @@ def get_payload(self, update): processed_xp.append(xp) self.format_json_val(json_val) + self.format_list_nodes(json_val, list_nodes) return json_val + def format_list_nodes(self, json_val, list_nodes): + # Enclose list entries within square brackets. + if not isinstance(json_val, dict): + if isinstance(json_val, list): + for val in json_val: + self.format_list_nodes(val, list_nodes) + else: + return + for val in json_val: + if val in list_nodes: + json_val[val] = [json_val[val]] + if isinstance(val, dict) or isinstance(json_val, list): + return + self.format_list_nodes(json_val[val], list_nodes) + def format_json_val(self,json_val): # Convert List of Dictionaries with only 1 one element to Dictionary if not isinstance(json_val,dict): @@ -1288,81 +1317,17 @@ def parse_xpath_to_gnmi_path(cls, xpath, origin=None): return path -class GnmiSubscription(ABC, Thread): - RE_FIND_KEYS = re.compile(r'\[.*?\]') - - def __init__(self, device: Gnmi = None, **request): - Thread.__init__(self) - self.delay = 0 - self._stop_event = Event() - self.log = request.get('log') - if self.log is None: - self.log = logging.getLogger(__name__) - self.log.setLevel(logging.DEBUG) - self.request = request - self.verifier = request.get('verifier') - self.namespace = request.get('namespace') - self.sub_mode = request.get('sub_mode') - self.encoding = request.get('encoding') - self.transaction_time = request.get('transaction_time', 0) - self._result = True - self.errors: List[Exception] = [] - self.negative_test = request.get('negative_test', False) - self.log.info(banner('GNMI Subscription reciever started')) - self.ntp_server = "" +class GnmiSubscription(Subscription): + """Base class for gNMI Subscription.""" + def __init__(self, device=None, **request): + super().__init__(device, **request) if device is not None: self.metadata = [ ("username", device.device.credentials.default.get('username', '')), ("password", to_plaintext( device.device.credentials.default.get('password', ''))), ] - if self.transaction_time: - self.ntp_server = device.device.testbed.servers.get( - 'ntp', {}).get('server', {}) - self.stream_max = request.get('stream_max', 60) - self.sample_poll = request.get( - 'sample_interval', request.get('sample_poll', 5)) - if self.stream_max: - self.log.info('Notification MAX timeout {0} seconds.'.format( - str(self.stream_max))) - - class NoNtpConfigured(Exception): - pass - - class DevieOutOfSyncWithNtp(Exception): - def __init__(self, response_timestamp: int, arrive_timestamp: int, ntp_server: str, *args: object) -> None: - super().__init__(*args) - self.response_dt = datetime.fromtimestamp( - response_timestamp) - self.ntp_dt = datetime.fromtimestamp(arrive_timestamp) - self.ntp_server = ntp_server - log.error(banner( - f"""Device is out of sync with NTP server {self.ntp_server} - Device time: {self.ntp_dt.strftime('%m/%d/%Y %H:%M:%S.%f')} - NTP time: {self.response_dt.strftime('%m/%d/%Y %H:%M:%S.%f')}""")) - - class TransactionTimeExceeded(Exception): - def __init__(self, delta_time: float, transaction_time: float, *args: object) -> None: - super().__init__(*args) - self.delta_time = delta_time - log.error(banner( - f'Response time: {delta_time} seconds exceeded transaction_time {transaction_time}', - )) - - @property - def result(self): - return self.negative_test != self._result - - @result.setter - def result(self, value): - self._result = value - - def stop(self): - self.log.info("Stopping notification stream") - self._stop_event.set() - - def stopped(self): - return self._stop_event.is_set() + self.log.info(banner('gNMI Subscription reciever started')) @classmethod def iter_subscribe_request(self, @@ -1423,16 +1388,11 @@ def inner(self): class GnmiSubscriptionStream(GnmiSubscription): def __init__(self, - device: Gnmi = None, + device=None, payload: List[gnmi_pb2.SubscribeRequest] = None, responses: List[gnmi_pb2.SubscribeResponse] = None, **request): super().__init__(device, **request) - # For transaction_time subscribtion NTP servers must be configured - if self.transaction_time and not self.ntp_server: - self.log.error( - banner('For transaction_time to work with STREAM Subscribtions, NTP servers must be configured.')) # noqa - raise self.NoNtpConfigured('NTP servers not configured') if responses is not None: self.responses = responses elif device is not None and payload is not None: @@ -1473,7 +1433,7 @@ def run(self): class GnmiSubscriptionOnce(GnmiSubscription): def __init__(self, - device: Gnmi = None, + device=None, payload: List[gnmi_pb2.SubscribeRequest] = None, responses: List[gnmi_pb2.SubscribeResponse] = None, ** request): @@ -1523,7 +1483,7 @@ def run(self): class GnmiSubscriptionPoll(GnmiSubscription): def __init__(self, - device: Gnmi = None, + device=None, payload: List[gnmi_pb2.SubscribeRequest] = None, responses: List[gnmi_pb2.SubscribeResponse] = None, **request): diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/netconf_util.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/netconf_util.py index 00b48e2ee..70457687b 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/netconf_util.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/netconf_util.py @@ -1,12 +1,311 @@ import logging -from time import sleep -from .rpcbuilder import YSNetconfRPCBuilder +import time +from typing import List +from collections import deque +import lxml.etree as et from pyats.log.utils import banner +from yang.connector import Netconf +from .rpcbuilder import YSNetconfRPCBuilder +from .subscription import Subscription log = logging.getLogger(__name__) lock_retry_errors = ['lock-denied', 'resource-denied', 'in-use'] +class NetconfSubscription(Subscription): + """Base Subscription class for all NETCONF notifications.""" + subscription_queue = {} + + def __init__(self, device, payload, **request): + super().__init__(device, **request) + op, response = payload[0] + self._result = [] + sub_id = self.get_subscribe_id(response) + if not sub_id: + log.warning('NO SUBSCRIPTION ID FOUND') + self.subscription_id = sub_id + self.device = device + self.payload = payload + if self.sub_mode: + self.log.info(f'Subscription sub mode: {self.sub_mode}') + + def cover_exceptions(func): + """Decorator to catch exceptions and log them.""" + def wrapper(self, *args, **kwargs): + try: + return func(self, *args, **kwargs) + except Exception as e: + self.errors.append(e) + self.result = self.verifier.end_subscription(self.errors) + self.stop() + return wrapper + + def _trim_xml_header(self, xml): + # Trim off encoding () + if xml and xml.lstrip().startswith('')+1:] + return xml.strip() + + def get_subscribe_id(self, payload): + """Get the subscription ID from the payload. + + Args: + payload (str): The payload to parse. + Returns: + str: The subscription ID if found in payload or None. + """ + payload = self._trim_xml_header(payload) + if payload: + xml_ele = et.fromstring(payload) + for el in xml_ele.iter(): + if et.QName(el).localname == 'rpc-error': + self.log.error('SUBSCRIBE FAILED') + self.result = False + return '' + if et.QName(el).localname == 'subscription-id': + if el.text: + return el.text.strip() + return None + return None + + @classmethod + def validate_subscribe_response(cls, payload): + """Validate the subscribe response. + + Args: + payload (list): Tuple of (operation, response). + Returns: + bool: True if valid, else False. + """ + _, response = payload[0] + payload = cls._trim_xml_header(cls, response) + if payload: + xml_ele = et.fromstring(payload) + for el in xml_ele.iter(): + if et.QName(el).localname == 'rpc-error': + # Details of error should already be in log. + return False + return True + return False + + @property + def result(self): + if not self._result: + return False + return all(self._result) + + @result.setter + def result(self, value): + self._result.append(value) + + @classmethod + def run_subscribe(cls, device, payload, **request): + """Instantiate the correct subscription class. + + Args: + device (Netconf): The device to subscribe to. + payload (list): Tuple of (operation, response). + **request: The request dictionary. + Returns: + NetconfSubscription: The subscription class. + """ + if cls.validate_subscribe_response(payload) is False: + log.error('SUBSCRIBE FAILED') + return False + + request['log'] = log + request_mode = request.get('request_mode') + if not request_mode: + log.error('No request_mode specified; setting to "ONCE"') + request_mode = 'ONCE' + if request_mode == 'ONCE': + subscribe_thread = NetconfSubscriptionOnce( + device, payload, **request) + elif request_mode == 'POLL': + subscribe_thread = NetconfSubscriptionPoll( + device, payload, **request) + elif request_mode == 'STREAM': + subscribe_thread = NetconfSubscriptionStream( + device, payload, **request) + else: + log.error(f'Unknown request_mode: {request_mode}') + return False + + subscribe_thread.start() + log.info(banner('NETCONF Subscription reciever started')) + cls.subscription_queue[ + subscribe_thread.subscription_id] = deque() + return subscribe_thread + + +class NetconfSubscriptionStream(NetconfSubscription): + """NETCONF Subscription class for STREAM mode.""" + def __init__(self, + device: Netconf = None, + payload: List = None, + **request): + super().__init__(device, payload, **request) + + @NetconfSubscription.cover_exceptions + def run(self): + """Check for inbound notifications.""" + self.log.info('Subscribe STREAM notification active') + t = time.time() + time_delta = 0.0 + self.log.info(f"Maximum stream time: {self.stream_max} seconds.") + + while time_delta < self.stream_max: + time_delta = time.time() - t + self.log.info(f"Delta: {time_delta} seconds.") + if self.transaction_time and self.ntp_server: + if time_delta > self.transaction_time: + self.log.error('Transaction time exceeded') + self.result.append(False) + break + if self.stopped(): + time_delta = self.stream_max + self.log.info("Terminating notification early.") + break + self.log.info('Check for incoming notifications.') + notif = self.device.take_notification(timeout=self.stream_max) + if hasattr(notif, "notification_xml"): + # Add to global queue (this might not be for this subscription) + sub_id = self.get_subscribe_id(notif.notification_xml) + if sub_id is None: + self.log.warning('NO SUBSCRIPTION ID FOUND') + self.log.info(f'Adding notification ID:{sub_id} to queue.') + if sub_id not in self.subscription_queue: + self.subscription_queue[sub_id] = deque() + self.subscription_queue[sub_id].append( + notif.notification_xml) + self.log.info(f'Check queue for ID:{self.subscription_id} notifications.') + if self.subscription_id not in self.subscription_queue: + self.log.warning(f'No notifications for {self.subscription_id}') + continue + while len(self.subscription_queue[self.subscription_id]): + notif_xml = self.subscription_queue[self.subscription_id].popleft() + if notif_xml: + self.log.info(f'Verifying notification {self.subscription_id}') + self.result = self.verifier.subscribe_verify(notif_xml) + self.stop() + + +class NetconfSubscriptionOnce(NetconfSubscription): + """NETCONF Subscription class for ONCE mode.""" + def __init__(self, + device: Netconf = None, + payload: List = None, + ** request): + super().__init__(device, payload, **request) + + @NetconfSubscription.cover_exceptions + def run(self): + """Check for inbound notifications.""" + self.log.info('Subscribe ONCE notification active') + t = time.time() + time_delta = 0.0 + self.log.info(f"Maximum stream time: {self.stream_max} seconds.") + + while time_delta < self.stream_max: + time_delta = time.time() - t + self.log.info(f"Delta: {time_delta} seconds.") + if self.transaction_time and self.ntp_server: + if time_delta > self.transaction_time: + self.log.error('Transaction time exceeded') + self.result.append(False) + break + if self.stopped(): + time_delta = self.stream_max + self.log.info("Terminating notification early.") + break + self.log.info('Check for incoming notifications.') + notif = self.device.take_notification(timeout=self.stream_max) + if hasattr(notif, "notification_xml"): + # Add to global queue (this might not be for this subscription) + sub_id = self.get_subscribe_id(notif.notification_xml) + if sub_id is None: + self.log.warning('NO SUBSCRIPTION ID FOUND') + self.log.info(f'Adding notification ID:{sub_id} to queue.') + if sub_id not in self.subscription_queue: + self.subscription_queue[sub_id] = deque() + self.subscription_queue[sub_id].append( + notif.notification_xml) + self.log.info(f'Check queue for {self.subscription_id} notifications.') + if self.subscription_id not in self.subscription_queue: + self.log.warning(f'No notifications for {self.subscription_id}') + continue + while len(self.subscription_queue[self.subscription_id]): + notif_xml = self.subscription_queue[self.subscription_id].popleft() + if notif_xml: + self.log.info(f'Verifying notification {self.subscription_id}') + self.result = self.verifier.subscribe_verify(notif_xml) + break + self.stop() + + +class NetconfSubscriptionPoll(NetconfSubscription): + """NETCONF Subscription class for POLL mode.""" + def __init__(self, + device: Netconf = None, + payload: List = None, + **request): + super().__init__(device, payload, **request) + + @NetconfSubscription.cover_exceptions + def run(self): + """Check for inbound notifications.""" + self.log.info('Subscribe POLL notification active') + t = time.time() + time_delta = 0.0 + self.log.info(f"Maximum stream time: {self.stream_max} seconds.") + + while time_delta < self.stream_max: + time_delta = time.time() - t + self.log.info(f"Delta: {time_delta} seconds.") + if self.stopped(): + self.time_delta = self.stream_max + self.log.info("Terminating notification early.") + break + self.log.info('Check for incoming notifications.') + notif = self.device.take_notification(timeout=self.stream_max) + if hasattr(notif, "notification_xml"): + # Add to global queue (this might not be for this subscription) + sub_id = self.get_subscribe_id(notif.notification_xml) + if sub_id is None: + self.log.warning('NO SUBSCRIPTION ID FOUND') + self.log.info(f'Adding {sub_id} notification to queue.') + if sub_id not in self.subscription_queue: + self.subscription_queue[sub_id] = deque() + self.subscription_queue[sub_id].append( + notif.notification_xml) + self.log.info(f'Check queue for {self.subscription_id} notifications.') + if self.subscription_id not in self.subscription_queue: + self.log.warning(f'No notifications for {self.subscription_id}') + continue + while len(self.subscription_queue[self.subscription_id]): + notif_xml = self.subscription_queue[self.subscription_id].popleft() + if notif_xml: + self.log.info(f'Verifying notification {self.subscription_id}') + self.result = self.verifier.subscribe_verify(notif_xml) + time.sleep(self.sample_poll) + result = netconf_send( + self.device, + [('rpc', {'rpc': self.request['rpc']})], + {}, + lock='', + lock_retry=0 + ) + if self.validate_subscribe_response(result) is False: + self.result = False + break + _, response = result[0] + sub_id = self.get_subscribe_id(response) + if sub_id is None: + self.log.error('NO POLL SUBSCRIPTION ID FOUND') + self.subscription_id = sub_id + self.stop() + + def gen_ncclient_rpc(rpc_data, prefix_type="minimal"): """Construct the XML Element(s) needed for the given config dict. @@ -342,7 +641,7 @@ def try_lock(uut, target, timer=30, sleeptime=1): break elif counter < timer: log.info("RETRYING LOCK - {0}".format(counter)) - sleep(sleeptime) + time.sleep(sleeptime) else: log.error( banner('ERROR - LOCKING FAILED. RETRY TIMER EXCEEDED!!!') diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py index fdbd002c7..15be0dbd1 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/rpcverify.py @@ -771,12 +771,17 @@ def process_one_operational_state(self, field.value = 'empty' result, log_msg = self.check_opfield(value, field) - # If sequence is applied, then - # first value found should be the target value - # Since the new_response is already trimmed from the list entry. + + # new_response contains all responses from the first match, + # hence, not necessarily, first value will be the target value + # any value in the new_response can be the target value # ----> Response is trimmed from here # K1 - # v1 ---> First value found should be the target value. + # v1 + # K2 + # v2 + # K3 + # v3 # if sequence and not result: log.error(log_msg) @@ -1176,7 +1181,7 @@ def process_sequencial_operational_state(self, Returns: bool: True if successful. """ - sequence = True + sequence = False results = [] index = 0 parent_key_indexes = {} diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/subscription.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/subscription.py new file mode 100644 index 000000000..9a66f5041 --- /dev/null +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/subscription.py @@ -0,0 +1,86 @@ +import logging +from abc import ABC +from datetime import datetime +from threading import Event, Thread +from typing import List +import traceback +from pyats.log.utils import banner + +log = logging.getLogger(__name__) + + +class Subscription(ABC, Thread): + """Base Subscription class for all notifications.""" + def __init__(self, device=None, **request): + Thread.__init__(self) + self.delay = 0 + self._stop_event = Event() + self.log = request.get('log') + if self.log is None: + self.log = logging.getLogger(__name__) + self.log.setLevel(logging.DEBUG) + self.request = request + self.verifier = request.get('verifier') + self.namespace = request.get('namespace') + self.sub_mode = request.get('sub_mode') + self.encoding = request.get('encoding') + self.transaction_time = request.get('transaction_time', 0) + self._result = True + self.errors: List[Exception] = [] + self.negative_test = request.get('negative_test', False) + self.ntp_server = "" + if device is not None: + if self.transaction_time: + self.ntp_server = device.device.testbed.servers.get( + 'ntp', {}).get('server', {}) + self.stream_max = request.get('stream_max', 60) + self.sample_poll = request.get( + 'sample_interval', request.get('sample_poll', 5)) + if self.stream_max: + self.log.info('Notification MAX timeout {0} seconds.'.format( + str(self.stream_max))) + # For transaction_time subscribtion NTP servers must be configured + if self.transaction_time and not self.ntp_server: + self._result = False + self.log.error( + banner('For transaction_time to work with Subscribtions, NTP servers must be configured.')) # noqa + raise self.NoNtpConfigured('NTP servers not configured') + + class NoNtpConfigured(Exception): + pass + + class DevieOutOfSyncWithNtp(Exception): + def __init__(self, response_timestamp: int, arrive_timestamp: int, ntp_server: str, *args: object) -> None: + super().__init__(*args) + self.response_dt = datetime.fromtimestamp( + response_timestamp) + self.ntp_dt = datetime.fromtimestamp(arrive_timestamp) + self.ntp_server = ntp_server + log.error(banner( + f"""Device is out of sync with NTP server {self.ntp_server} + Device time: {self.ntp_dt.strftime('%m/%d/%Y %H:%M:%S.%f')} + NTP time: {self.response_dt.strftime('%m/%d/%Y %H:%M:%S.%f')}""")) + + class TransactionTimeExceeded(Exception): + def __init__(self, delta_time: float, transaction_time: float, *args: object) -> None: + super().__init__(*args) + self.delta_time = delta_time + log.error(banner( + f'Response time: {delta_time} seconds exceeded transaction_time {transaction_time}', + )) + + @property + def result(self): + return self.negative_test != self._result + + @result.setter + def result(self, value): + self._result = value + + def stop(self): + self.log.info("Stopping notification stream") + self._stop_event.set() + + def stopped(self): + return self._stop_event.is_set() + \ No newline at end of file diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py index 01b6c8dcc..594604b2b 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_gnmibuilder.py @@ -127,29 +127,33 @@ }, 'protocols': { 'protocol': - { - 'identifier': 'OSPF', - 'name': '100', - 'config': - { - 'identifier': 'openconfig-policy-types:OSPF', - 'name': '100' - }, - 'bgp': + [ { - 'neighbors': + 'identifier': 'OSPF', + 'name': '100', + 'config': + { + 'identifier': 'openconfig-policy-types:OSPF', + 'name': '100' + }, + 'bgp': { - 'neighbor': + 'neighbors': { - 'neighbor-address': '1.1.1.1', - 'config': - { - 'neighbor-address': '1.1.1.1' - } + 'neighbor': + [ + { + 'neighbor-address': '1.1.1.1', + 'config': + { + 'neighbor-address': '1.1.1.1' + } + } + ] } } } - } + ] } } @@ -250,29 +254,33 @@ }, 'protocols': { 'protocol': - { - 'identifier': 'OSPF', - 'name': '100', - 'config': + [ { - 'identifier': 'openconfig-policy-types:OSPF', - 'name': '100' - }, - 'bgp': - { - 'neighbors': + 'identifier': 'OSPF', + 'name': '100', + 'config': + { + 'identifier': 'openconfig-policy-types:OSPF', + 'name': '100' + }, + 'bgp': { - 'neighbor': + 'neighbors': { - 'neighbor-address': '1.1.1.1', - 'config': - { - 'neighbor-address': '1.1.1.1' - } + 'neighbor': + [ + { + 'neighbor-address': '1.1.1.1', + 'config': + { + 'neighbor-address': '1.1.1.1' + } + } + ] } } } - } + ] } } @@ -813,22 +821,114 @@ json_val_decoded_nested_list = { "Dom-list": [ - { - "name": "default", - "eventHist-items": { - "EventHistory-list": { - "type": "nbm", "size": 10 + [ + { + "name": "default", + "eventHist-items": { + "EventHistory-list": [{ + "type": "nbm", "size": 10 + }] + } + }, + { + "name": "abc", + "eventHist-items": + { + "EventHistory-list": + [ + { + "type": "intfDebugs", "size": 10 + } + ] } } + ] + ] +} + +request_leaf_list = { + 'nodes': [ + { + 'datatype': 'identityref', + 'nodetype': 'leaf-list', + 'value': 'oc-types:IPV4', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="test11"]/\ + oc-netinst:config/oc-netinst:enabled-address-families' + } + ], + 'namespace_modules': { + 'oc-netinst': 'openconfig-network-instance', + 'oc-types': 'openconfig-types' }, - { - "name": "abc", - "eventHist-items": - { - "EventHistory-list": + 'namespace': { + 'oc-netinst': 'http://openconfig.net/yang/network-instances', + 'oc-types': 'http://openconfig.net/yang/openconfig-types' + } +} + +set_container_leaf_list = { + 'nodes': [ + { + 'nodetype': 'container', + 'xpath': '/oc-netinst:network-instances/', + 'edit-op': 'create', + 'value': '' + }, { - "type": "intfDebugs", "size": 10 + 'datatype': 'leafref', + 'default': '', + 'key': True, + 'leafref_path': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="red11"]/oc-netinst:config/oc-netinst:name', # noqa + 'nodetype': 'leaf', + 'value': '', + 'xpath': '/oc-netinst:network-instances/oc-netinst:network-instance[oc-netinst:name="red11"]' # noqa + }, + { + 'nodetype': 'leaf', + 'datatype': 'string', + 'value': 'red11', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="red11"]/\ + oc-netinst:config/oc-netinst:name', + }, + { + 'nodetype': 'leaf-list', + 'datatype': 'identityref', + 'value': 'oc-types:IPV4', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="red11"]/\ + oc-netinst:config/oc-netinst:enabled-address-families', + }, + { + 'nodetype': 'leaf-list', + 'datatype': 'identityref', + 'value': 'oc-types:IPV6', + 'xpath': '/oc-netinst:network-instances/\ + oc-netinst:network-instance[oc-netinst:name="red11"]/\ + oc-netinst:config/oc-netinst:enabled-address-families', } + ], + 'namespace_modules': { + 'oc-netinst': 'openconfig-network-instance', + 'oc-types': 'openconfig-types' + }, + 'namespace': { + 'oc-netinst': 'http://openconfig.net/yang/network-instances', + 'oc-types': 'http://openconfig.net/yang/openconfig-types' + } +} + +json_decoded_cont_leaf_list = { + "update": [ + { + "path": { + "origin": "openconfig", + "elem": [ + { + "name": "network-instances" + } + ] } } ] diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py index c0adb559a..9f0ff308e 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_rpc.py @@ -157,6 +157,43 @@ def __init__(self, *args, **kwargs): } } +gnmi_list_entry = { + "timestamp": 1694027409978062184, + "update": { + "path": { + "origin": "openconfig", + "elem": [ + { + "name": "sampling" + }, + { + "name": "sflow" + } + ] + }, + "val": { + "jsonIetfVal": '' + } + } +} + +gnmi_nested_list = { + "timestamp": 1694027409978062184, + "update": { + "path": { + "origin": "openconfig", + "elem": [ + { + "name": "network-instances" + } + ] + }, + "val": { + "jsonIetfVal": '' + } + } +} + multilist = """ @@ -395,6 +432,37 @@ def __init__(self, *args, **kwargs): """ +bgp_community_list_namespace_prefix_response = """ + + + + + SET_COMMUNITY + + 10 + permit + Setting Community values + + + + 100:10 + 100:20 + 100:30 + 100:40 + 100:200 + internet + 4465:4000 + 3000:2222 + + + + + + + + +""" + class TestRpcVerify(unittest.TestCase): """Test cases for the rpcverify.RpcVerify methods.""" @@ -409,8 +477,12 @@ def setUpClass(cls): cls.gnmi = TestGnmi() cls.operstate_gnmi = operstate_gnmi cls.gnmi_leaf_list = gnmi_leaf_list + cls.gnmi_list_entry = gnmi_list_entry + cls.gnmi_nested_list = gnmi_nested_list cls.jsonIetfVal = "" cls.leafListVal = "" + cls.listEntryVal = "" + cls.nestedListEntry = "" def setUp(self): self.jsonIetfVal = """{"statistics": {"in-octets": 330, \ @@ -426,6 +498,14 @@ def setUp(self): "name": "test10"}, "state": {"name": "test10", "type": "openconfig-network-instance-types:L3VRF", \ "enabled": true, "enabled-address-families": ["openconfig-types:IPV4", "openconfig-types:IPV6"]}}""" + self.listEntryVal = """{"config": {"enabled": true, "agent-id-ipv4": "4.4.4.4", \ +"agent-id-ipv6": "4::4"}, "collectors": {"collector": [{"address": "6.37.16.200", "port": 2055, \ +"config": {"address": "6.37.16.200", "port": 2055}}]}}""" + + self.nestedListEntry = """{"network-instance": [{"name": "DEFAULT", \ +"protocols": {"protocol": [{"identifier": "BGP", "name": "default", \ +"config": {"identifier": "openconfig-policy-types:BGP", "name": "default"}}]}}]}""" + def _base64encode(self): self.operstate_gnmi['update']['val']['jsonIetfVal'] = base64.encodebytes( bytes(self.jsonIetfVal, encoding='utf-8') @@ -433,6 +513,12 @@ def _base64encode(self): self.gnmi_leaf_list['update']['val']['jsonIetfVal'] = base64.encodebytes( bytes(self.leafListVal, encoding='utf-8') ) + self.gnmi_list_entry['update']['val']['jsonIetfVal'] = base64.encodebytes( + bytes(self.listEntryVal, encoding='utf-8') + ) + self.gnmi_nested_list['update']['val']['jsonIetfVal'] = base64.encodebytes( + bytes(self.nestedListEntry, encoding='utf-8') + ) def parse_dict_to_gnmi_msg(self, data: dict): update = proto.gnmi_pb2.Update() @@ -1845,6 +1931,271 @@ def test_auto_validate_with_same_parent_key(self): result = self.rpcv.verify_rpc_data_reply(resp, rpc_data) self.assertTrue(result) + def test_autovalidate_list_entry(self): + """check list entry enclosed in [] in response""" + opfields = [ + { + 'selected': 'true', + 'default': '', + 'name': 'address', + 'xpath': '/sampling/sflow/collectors/collector/config/address', + 'value': '6.37.16.200', + 'datatype': 'oc-inet:ip-address', + 'nodetype': 'leaf', + 'op': '==' + }, + { + 'selected': 'true', + 'default': '', + 'name': 'port', + 'xpath': '/sampling/sflow/collectors/collector/config/port', + 'value': 2055, + 'datatype': 'oc-inet:port-number', + 'nodetype': 'leaf', + 'op': '==' + } + ] + self._base64encode() + device = TestDevice(self.parse_dict_to_gnmi_msg( + self.gnmi_list_entry['update'])) + rpc_data, returns, format = self.make_test_args(opfields) + + result = yangexec.run_gnmi('get-config', device, '', '', + rpc_data, returns, format=format) + self.assertTrue(result) + + def test_autovalidate_nested_list(self): + """check nested list entry enclosed in brackets""" + opfields = [ + { + 'selected': 'true', + 'default': '', + 'name': 'identifier', + 'xpath': '/network-instances/network-instance/protocols/protocol/config/identifier', + 'value': 'oc-pol-types:BGP', + 'datatype': 'identityref', + 'nodetype': 'leaf', + 'op': '==' + }, + { + 'selected': 'true', + 'default': '', + 'name': 'name', + 'xpath': '/network-instances/network-instance/protocols/protocol/config/name', + 'value': 'default', + 'datatype': 'string', + 'nodetype': 'leaf', + 'op': '==' + } + ] + self._base64encode() + device = TestDevice(self.parse_dict_to_gnmi_msg( + self.gnmi_nested_list['update'])) + rpc_data, returns, format = self.make_test_args(opfields) + + result = yangexec.run_gnmi('get-config', device, '', '', + rpc_data, returns, format=format) + self.assertTrue(result) + + def test_auto_validate_with_namespace_prefix_without_key(self): + rpc_data = { + 'namespace': { + 'ios': 'http: //cisco.com/ns/yang/Cisco-IOS-XE-native', + 'ios-bgp': 'http://cisco.com/ns/yang/Cisco-IOS-XE-bgp', + 'ios-route-map': 'http://cisco.com/ns/yang/Cisco-IOS-XE-route-map' + }, + 'nodes': [{ + 'datatype': 'string', + 'default': '', + 'edit-op': 'create', + 'nodetype': 'leaf', + 'value': '', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf', + 'value': '', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]' + }, { + 'datatype': 'enumeration', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf', + 'value': 'permit', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:operation' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf', + 'value': 'Setting Community values', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:description' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:10', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:20', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:30', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:40', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:200', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': 'internet', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '4465:4000', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '3000:2222', + 'xpath': '/ios:native/ios:route-map[name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }], + 'datastore': 'running', + 'operation': 'edit-config' + } + resp = self.rpcv.process_rpc_reply(bgp_community_list_namespace_prefix_response) + result = self.rpcv.verify_rpc_data_reply(resp, rpc_data) + self.assertTrue(result) + + def test_auto_validate_with_namespace_prefix_with_key(self): + rpc_data = { + 'namespace': { + 'ios': 'http: //cisco.com/ns/yang/Cisco-IOS-XE-native', + 'ios-bgp': 'http://cisco.com/ns/yang/Cisco-IOS-XE-bgp', + 'ios-route-map': 'http://cisco.com/ns/yang/Cisco-IOS-XE-route-map' + }, + 'nodes': [{ + 'datatype': 'string', + 'default': '', + 'edit-op': 'create', + 'nodetype': 'leaf', + 'value': '', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf', + 'value': '', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]' + }, { + 'datatype': 'enumeration', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf', + 'value': 'permit', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:operation' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf', + 'value': 'Setting Community values', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:description' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:10', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'string', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:20', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:30', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:40', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '100:200', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': 'internet', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '4465:4000', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }, { + 'datatype': 'union', + 'default': '', + 'edit-op': 'merge', + 'nodetype': 'leaf-list', + 'value': '3000:2222', + 'xpath': '/ios:native/ios:route-map[ios:name="SET_COMMUNITY"]/ios-route-map:route-map-seq[ios-route-map:ordering-seq="10"]/ios-route-map:set/ios-route-map:community/ios-route-map:community-well-known/ios-route-map:community-list' + }], + 'datastore': 'running', + 'operation': 'edit-config' + } + resp = self.rpcv.process_rpc_reply(bgp_community_list_namespace_prefix_response) + result = self.rpcv.verify_rpc_data_reply(resp, rpc_data) + self.assertTrue(result) + + class Device: server_capabilities = [] diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py index 096f87b4a..e403bc83d 100755 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/tests/test_yangexec.py @@ -1,4 +1,3 @@ -# Python import unittest import logging import sys @@ -21,9 +20,15 @@ GnmiSubscriptionOnce, GnmiSubscriptionStream, GnmiSubscriptionPoll,) +from genie.libs.sdk.triggers.blitz.netconf_util import ( + NetconfSubscriptionStream +) from genie.libs.sdk.triggers.blitz.rpcverify import RpcVerify, OptFields from genie.libs.sdk.triggers.blitz.verifiers import GnmiDefaultVerifier -from genie.libs.sdk.triggers.blitz.tests.device_mocks import TestDevice, TestDeviceWithNtp +from genie.libs.sdk.triggers.blitz.tests.device_mocks import ( + TestDevice, + TestDeviceWithNtp, +) from dataclasses import dataclass log = logging.getLogger(__name__) @@ -235,23 +240,25 @@ def test_run_netconf_subscribe_lxml(self, netconf_send_mock): } netconf_send_mock.return_value = [( 'subscribe', - '''\n - notif-bis:ok\n2147483760 - \n\'''' + ''' + + + + notif-bis:ok + + + 2147483760 + + ''' )] result = run_netconf( operation, self.netconf_device, steps, datastore, rpc_data, returns, format=format ) - self.assertEqual(result, True) + self.assertIsInstance(result, NetconfSubscriptionStream) + result.stop() + self.assertEqual(result.subscription_id, '2147483760') + self.assertIn('2147483760', result.subscription_queue) @patch('genie.libs.sdk.triggers.blitz.yangexec.netconf_send') def test_run_netconf_subscribe_raw(self, netconf_send_mock): @@ -313,17 +320,17 @@ def test_run_netconf_subscribe_raw(self, netconf_send_mock): } netconf_send_mock.return_value = [( 'subscribe', - '''\n - notif-bis:ok\n2147483760 - \n\'''' + ''' + + + + notif-bis:ok + + + 2147483760 + + + ''' )] result = run_netconf( operation, # operation @@ -335,7 +342,10 @@ def test_run_netconf_subscribe_raw(self, netconf_send_mock): format=format # format ) - self.assertEqual(result, True) + self.assertIsInstance(result, NetconfSubscriptionStream) + result.stop() + self.assertEqual(result.subscription_id, '2147483760') + self.assertIn('2147483760', result.subscription_queue) def test_path_elem_to_xpath(self): """ Test if path_elem_to_xpath is adding prefix keys in opfields""" @@ -3021,7 +3031,7 @@ def test_get_config_transaction_time(self): notif = proto.gnmi_pb2.Notification() notif.update.append(update) response.notification.append(notif) - device = TestDevice(response) + device = TestDeviceWithNtp(response) result = run_gnmi( operation, device, steps, datastore, rpc_data, returns, format=format @@ -3037,8 +3047,10 @@ def test_get_config_transaction_time(self): def test_subscribe_poll_transaction_time(self): request = self.make_test_request() - request['transaction_time'] = 0.00000001 + request['transaction_time'] = 0.00000000001 + device = TestDeviceWithNtp(self.make_test_notification()) subscribe_thread = GnmiSubscriptionPoll( + device=device, responses=[self.make_test_notification()], **request ) @@ -3048,6 +3060,7 @@ def test_subscribe_poll_transaction_time(self): request['transaction_time'] = 2 subscribe_thread = GnmiSubscriptionPoll( + device=device, responses=[self.make_test_notification()], **request ) @@ -3057,9 +3070,10 @@ def test_subscribe_poll_transaction_time(self): def test_subscribe_once_transaction_time(self): request = self.make_test_request() - request['transaction_time'] = 0.00000001 + request['transaction_time'] = 0.00000000001 device = TestDeviceWithNtp(self.make_test_notification()) subscribe_thread = GnmiSubscriptionOnce( + device=device, responses=[self.make_test_notification()], **request ) @@ -3069,6 +3083,7 @@ def test_subscribe_once_transaction_time(self): request['transaction_time'] = 5 subscribe_thread = GnmiSubscriptionOnce( + device=device, responses=[self.make_test_notification()], **request ) @@ -3079,7 +3094,7 @@ def test_subscribe_once_transaction_time(self): def test_subscribe_stream_transaction_time(self): request = self.make_test_request() device = TestDeviceWithNtp(self.make_test_notification()) - request['transaction_time'] = 0.00000001 + request['transaction_time'] = 0.00000000001 subscribe_thread = GnmiSubscriptionStream( device=device, responses=[self.make_test_notification()], diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py index 626ccaf7b..f8fd193bb 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/verifiers.py @@ -7,6 +7,7 @@ from pprint import pformat import json from copy import deepcopy +import traceback from google.protobuf import json_format from .rpcverify import (RpcVerify, OptFields, @@ -133,7 +134,7 @@ def __init__(self, rpc_data=None, **kwargs): super().__init__(device, returns, log, format, - steps, datastore, rpc_data, ** kwargs) + steps, datastore, rpc_data, **kwargs) self.rpc_verify = RpcVerify(log=self.log) if format is None: format = {} @@ -592,6 +593,12 @@ def get_config_verify(self, """ try: decoded_response = self.decode(raw_response) + except self.ErroredResponse as e: + if not self.returns: + return self.negative_test + # Validate expected error + return self.rpc_verify.process_operational_state( + e.response, self.returns) except self.DecodeError: return self.negative_test @@ -621,9 +628,12 @@ def edit_config_verify(self, try: decoded_response = self.decode(raw_response) except self.ErroredResponse as e: + if not self.returns: + return self.negative_test + # Validate expected error return self.rpc_verify.process_operational_state( e.response, self.returns) - except BaseVerifier.DecodeError: + except self.DecodeError: return self.negative_test auto_validate = self.format.get( @@ -696,3 +706,14 @@ def decode(self, else: raise self.DecodeError() return self.rpc_verify.process_rpc_reply(response) + + def end_subscription(self, errors: List[Exception]) -> bool: + if errors: + for err in errors: + self.log.error(traceback.format_exc()) + return self.negative_test is not False + return True + + def subscribe_verify(self, raw_response: Any): + result = self.get_config_verify([('subscribe', raw_response)]) + return result diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yang_snapshot.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yang_snapshot.py index 66e356ee2..5c7cbc9ae 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yang_snapshot.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yang_snapshot.py @@ -1,7 +1,8 @@ import logging from lxml import etree from ncclient import xml_ -from genie.libs.sdk.triggers.blitz import yangexec, rpcverify +from genie.libs.sdk.triggers.blitz import yangexec, rpcverify,\ + netconf_util log = logging.getLogger(__name__) @@ -230,7 +231,7 @@ def snapshot_restore(self, device, **kwargs): if target in self.datastore_state else False target_locked = False if lock_target: - target_locked = yangexec.try_lock( + target_locked = netconf_util.try_lock( uut=connection_obj, target=target, timer=self.datastore.get('retry', 10), @@ -251,7 +252,7 @@ def snapshot_restore(self, device, **kwargs): if target == 'candidate': running_locked = False if lock_running: - running_locked = yangexec.try_lock( + running_locked = netconf_util.try_lock( uut=connection_obj, target='running', timer=self.datastore.get('retry', 10), diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py index 5170d76d6..8f337b7ec 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/blitz/yangexec.py @@ -12,7 +12,12 @@ from .requestbuilder import RestconfRequestBuilder, NO_BODY_METHODS, WITH_BODY_METHODS from .yangexec_helper import DictionaryToXML from .gnmi_util import GnmiMessage, GnmiMessageConstructor -from .netconf_util import gen_ncclient_rpc, get_datastore_state, netconf_send +from .netconf_util import ( + gen_ncclient_rpc, + get_datastore_state, + netconf_send, + NetconfSubscription +) from yang.connector.gnmi import Gnmi @@ -283,19 +288,11 @@ def run_netconf(operation: str, # TODO: get-data return may not be relevent depending on datastore log.debug('Use "get-data" yang action to verify this "edit-data".') elif rpc_data['operation'] == 'subscribe': - # check if subscription id exists in rpc reply, subscribe to device if subscription id is found - for op, res in result: - if '' in res or 'rpc-reply' in res and '' in res: - rpc_data['decode'] = rpc_verify.process_rpc_reply - rpc_data['verifier'] = rpc_verify.process_operational_state - rpc_data['format'] = format - rpc_data['returns'] = returns - - device.subscribe(rpc_data) - break - else: - log.error(banner('SUBSCRIPTION FAILED')) - return negative_test + # Activate subscription thread. + rpc_data.update(format) + rpc_data['verifier'] = verifier + rpc_data['returns'] = returns + return NetconfSubscription.run_subscribe(device, result, **rpc_data) else: try: # Validate error response diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/reload/iosxe/cat9k/reload.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/reload/iosxe/cat9k/reload.py index d4f5a52d0..2bf2a401b 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/reload/iosxe/cat9k/reload.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/reload/iosxe/cat9k/reload.py @@ -22,7 +22,7 @@ # Which key to exclude for Platform Ops comparison platform_exclude = ['maker', 'rp_uptime', 'sn', 'main_mem', 'issu', 'switchover_reason', 'config_register', 'chassis_sn', - 'sn', 'name', 'state', 'redundancy_state','version','issu_rollback_timer_reason'] + 'sn', 'name', 'state', 'redundancy_state','version','issu_rollback_timer_reason', 'chassis', 'rtr_type'] class TriggerReload(CommonReload): diff --git a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/switchover/iosxe/cat9k/switchover.py b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/switchover/iosxe/cat9k/switchover.py index 7cb7a37d1..f5747dd7f 100644 --- a/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/switchover/iosxe/cat9k/switchover.py +++ b/pkgs/sdk-pkg/src/genie/libs/sdk/triggers/ha/switchover/iosxe/cat9k/switchover.py @@ -21,7 +21,7 @@ # Which key to exclude for Platform Ops comparison platform_exclude = ['maker', 'main_mem', 'switchover_reason', 'issu', 'oc', 'sn', 'config_register', 'rp_uptime', 'chassis_sn', 'issu', - 'state', 'redundancy_state'] + 'state', 'redundancy_state', 'name', 'boot_image','chassis','rtr_type'] class TriggerSwitchover(CommonSwitchover):