Skip to content

Commit

Permalink
Merge pull request #155 from CiscoTestAutomation/release_24.2
Browse files Browse the repository at this point in the history
Releasing v24.2
  • Loading branch information
lsheikal authored Mar 5, 2024
2 parents d7728d1 + 3113659 commit 00354ee
Show file tree
Hide file tree
Showing 113 changed files with 2,548 additions and 501 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ CYTHON_CMD = compileAll
RELATED_PKGS = genie.libs.health genie.libs.clean genie.libs.conf genie.libs.ops genie.libs.robot genie.libs.sdk
RELATED_PKGS += genie.libs.filetransferutils
# pinning the version of pysnmp and pyasn1 to fix the type error when using execute_power_cycle_device api
DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==5.0.29 pyasn1==0.4.8
# Adding pyasyncore pkg to fix pysnmp scripts for python 3.12
DEPENDENCIES = restview psutil Sphinx wheel asynctest pysnmp-lextudio==5.0.29 pyasn1==0.4.8 pyasyncore
DEPENDENCIES += sphinx-rtd-theme==1.1.0 pyftpdlib tftpy\<0.8.1 robotframework
DEPENDENCIES += Cython==3.0.0 requests ruamel.yaml grpcio protobuf jinja2
# Internal variables.
Expand Down
16 changes: 16 additions & 0 deletions pkgs/clean-pkg/changelog/2024/february.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* modified and added hasattr
* is_ha triggered error added hasattr and attributes.


--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* iosxe
* Update failed pattern for install image stage


2 changes: 1 addition & 1 deletion pkgs/clean-pkg/sdk_generator/output/github_clean.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
"uid": "InstallImage",
"url": "https://github.com/CiscoTestAutomation/genielibs/tree/master/pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/cat3k/stages.py#L12"
},
"doc": "This stage installs a provided image onto the device using the install\nCLI. It also handles the automatic reloading of your device after the\ninstall is complete.\n\nStage Schema\n------------\ninstall_image:\n images (list): Image to install\n\n directory (str): directory where packages.conf is created\n\n\n save_system_config (bool, optional): Whether or not to save the system\n config if it was modified. Defaults to False.\n\n install_timeout (int, optional): Maximum time in seconds to wait for install\n process to finish. Defaults to 500.\n\n reload_timeout (int, optional): Maximum time in seconds to wait for reload\n process to finish. Defaults to 800.\n\n verify_running_image (bool, optional): Compare the image filename with the running\n image version on device. If a match is found, the stage will be skipped.\n Defaults to True.\n\n reload_service_args (optional):\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex strings to check for errors.\n Default: [r\"FAILED:.* \",]\n\n <Key>: <Value>\n Any other arguments that the Unicon reload service supports\n\nExample\n-------\ninstall_image:\n images:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n save_system_config: True\n install_timeout: 1000\n reload_timeout: 1000\n\n",
"doc": "This stage installs a provided image onto the device using the install\nCLI. It also handles the automatic reloading of your device after the\ninstall is complete.\n\nStage Schema\n------------\ninstall_image:\n images (list): Image to install\n\n directory (str): directory where packages.conf is created\n\n\n save_system_config (bool, optional): Whether or not to save the system\n config if it was modified. Defaults to False.\n\n install_timeout (int, optional): Maximum time in seconds to wait for install\n process to finish. Defaults to 500.\n\n reload_timeout (int, optional): Maximum time in seconds to wait for reload\n process to finish. Defaults to 800.\n\n verify_running_image (bool, optional): Compare the image filename with the running\n image version on device. If a match is found, the stage will be skipped.\n Defaults to True.\n\n reload_service_args (optional):\n\n reload_creds (str, optional): The credential to use after the reload is\n complete. The credential name comes from the testbed yaml file.\n Defaults to the 'default' credential.\n\n prompt_recovery (bool, optional): Enable or disable the prompt recovery\n feature of unicon. Defaults to True.\n\n error_pattern (list, optional): List of regex strings to check for errors.\n Default: [r\"FAILED:.*?$\",]\n\n <Key>: <Value>\n Any other arguments that the Unicon reload service supports\n\nExample\n-------\ninstall_image:\n images:\n - /auto/some-location/that-this/image/stay-isr-image.bin\n save_system_config: True\n install_timeout: 1000\n reload_timeout: 1000\n\n",
"module_name": "stages.stages",
"package": "genie.libs.clean",
"uid": "InstallImage",
Expand Down
2 changes: 1 addition & 1 deletion pkgs/clean-pkg/src/genie/libs/clean/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = '24.1'
__version__ = '24.2'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'
Expand Down
4 changes: 2 additions & 2 deletions pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ def recovery_processor(
# check if device is in any known state
log.info(f'Check device {device.name} has valid unicon state.')
try:
if device.is_ha:
log.info('Device is HA! checking all the subconnetions.')
if hasattr(device, 'is_ha') and device.is_ha:
log.info('Device is HA! checking all the subconnections.')
for index, connection in enumerate(device.subconnections,1):
bring_to_any_state(connection, connection_timeout)
log.info(f'subconnection {index} is in {connection.state_machine.current_state}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def install_image(self, steps, device, images, save_system_config=SAVE_SYSTEM_CO
args=None,
loop_continue=False,
continue_timer=False),
Statement(pattern=r"FAILED:.* ",
Statement(pattern=r"FAILED:.*?$",
action=None,
loop_continue=False,
continue_timer=False),
Expand All @@ -111,7 +111,7 @@ def install_image(self, steps, device, images, save_system_config=SAVE_SYSTEM_CO
try:
device.reload('install add file {} activate commit'.format(images[0]),
reply=install_add_one_shot_dialog,
append_error_pattern=['FAILED:.* '],
append_error_pattern=['FAILED:.*$'],
timeout=install_timeout,
device_recovery=False)
except Exception as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ def test_iosxe_install_image(self):

cls.install_image(steps=steps, device=device, images=['sftp://server/image.bin'])
device.reload.assert_has_calls([
call('install add file sftp://server/image.bin activate commit', reply=ANY, timeout=500, append_error_pattern=['FAILED:.* '], device_recovery=False)])
call('install add file sftp://server/image.bin activate commit', reply=ANY, timeout=500, append_error_pattern=['FAILED:.*$'], device_recovery=False)])

self.assertEqual(Passed, steps.details[0].result)
10 changes: 5 additions & 5 deletions pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ class InstallImage(BaseStage):
feature of unicon. Defaults to True.
error_pattern (list, optional): List of regex strings to check for errors.
Default: [r"FAILED:.* ",]
Default: [r"FAILED:.*?$",]
<Key>: <Value>
Any other arguments that the Unicon reload service supports
Expand All @@ -570,7 +570,7 @@ class InstallImage(BaseStage):
RELOAD_SERVICE_ARGS = {
'reload_creds': 'default',
'prompt_recovery': True,
'error_pattern': [r"FAILED:.* ",],
'error_pattern': [r"FAILED:.*?$",],
}
ISSU = False
SKIP_BOOT_VARIABLE = False
Expand Down Expand Up @@ -731,7 +731,7 @@ def install_image(self, steps, device, images,
action='sendline(y)',
loop_continue=True,
continue_timer=False),
Statement(pattern=r"FAILED:.* ",
Statement(pattern=r"FAILED:.*?$",
action=None,
loop_continue=False,
continue_timer=False),
Expand Down Expand Up @@ -2160,7 +2160,7 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT,
try:
device.api.configure_rommon_tftp()
except Exception as e:
step.failed(f'Failed to set rommon variables. {e}')
step.passx(f'Failed to set rommon variables. {e}')
else:
log.info("Successfully set the rommon variables")

Expand All @@ -2172,7 +2172,7 @@ def connect(self, steps, device, via=VIA, alias=ALIAS, timeout=TIMEOUT,
# Gets the recovery details from clean yaml
device.api.device_rommon_boot()
except Exception as e:
step.failed(f'Failed to boot device from rommon. {e}')
step.passx(f'Failed to boot device from rommon. {e}')
else:
log.info("Successfully booted the device from rommon.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_iosxe_install_image_pass(self):

device.reload.assert_has_calls([
call('install add file sftp://server/image.bin activate commit', reply=ANY,
reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.* '],
reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.*?$'],
timeout=500, device_recovery=False)
])
self.assertEqual(Passed, steps.details[0].result)
Expand All @@ -358,7 +358,7 @@ def test_iosxe_install_image_grub_boot_image(self):

device.reload.assert_has_calls([
call('install add file sftp://server/image.bin activate commit', reply=ANY,
reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.* '],
reload_creds='default', prompt_recovery=True, error_pattern=['FAILED:.*?$'],
grub_boot_image='packages.conf', device_recovery=False, timeout=500)
])
self.assertEqual(Passed, steps.details[0].result)
Empty file.
2 changes: 1 addition & 1 deletion pkgs/conf-pkg/src/genie/libs/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'''

# metadata
__version__ = '24.1'
__version__ = '24.2'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'''

__version__ = '24.1'
__version__ = '24.2'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pkgs/health-pkg/src/genie/libs/health/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = '24.1'
__version__ = '24.2'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.'
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pkgs/ops-pkg/src/genie/libs/ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'''

# metadata
__version__ = '24.1'
__version__ = '24.2'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pkgs/robot-pkg/src/genie/libs/robot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = '24.1'
__version__ = '24.2'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
77 changes: 77 additions & 0 deletions pkgs/sdk-pkg/changelog/2024/february.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* iosxe
* Added unconfigure_policy_map_with_pps
* New API to unconfigure policy-map pps
* Added api test_configure_cdp_1
* added api for validate show interface {interface}
* Added configure_ip_http_client_secure_trustpoint
* API to configure_ip_http_client_secure_trustpoint
* Added hw_module_filesystem_security_lock
* API to enable/disable filesystem's security-lock
* Added API verify_interface_capabilities_multiple_media_types
* Added API to verify the interface media type
* Added API verify_interfaces_transceiver_supported
* Added API to verify the transceivers supported in the device
* Updated `configure_management_gnmi` API to support secure server
* Modified `generate_rsa_ssl_key` API to support legacy 3des
* Modified `get_file_contents` API, added removal of carriage return option
* Modified `configure_pki_import`, added device key and root CA options
* Added new api `generate_pkcs12` to generate pkcs12 file.
* Added API unconfigure_ip_igmp_querier_query_interval
* Added API for unconfigure ip igmp querier query interval
* Added API unconfigure_ip_igmp_querier_max_response_time
* Added API for unconfigure ip igmp querier max response time
* Added API unconfigure_ip_igmp_querier_tcn_query_count
* Added API for unconfigure ip igmp querier tcn query count
* Added API unconfigure_ip_igmp_querier_tcn_query_interval
* Added API for unconfigure ip igmp querier tcn query interval
* Added API unconfigure_ip_igmp_querier_timer_expiry
* Added API for unconfigure ip igmp querier timer expiry

* api utils
* Add
* check_and_wait decorator

* makefile
* Added pyasyncore dependency to fix pysnmp script


--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* linux
* Add api get_valid_ipv4_address
* added api to validate and return ipv4 address
* Add api get_ip_route_for_ipv4
* added api to get the routing ip form routing table
* Modified get_snmp_snmpwalk
* Added timeout parameter to increase timeout of execute operation

* iosxe/rommon
* configure
* Updated `configure_rommon_tftp` API to set TFTP_FILE as the rommon variable.
* utils
* Updated `device_rommon_boot` API with a an option to boot using TFTP_FILE.

* iosxe
* Modified configure_sdm_prefer_custom_template
* added parameters custom_template, entried and priority
* Modified get_snmp_snmpwalk
* Added timeout parameter to increase timeout of execute operation
* `get_running_config_dict` API
* Added `output` parameter to pass the output of `show running-config` command.


--------------------------------------------------------------------------------
Modify
--------------------------------------------------------------------------------

* iosxe
* Modified configure_virtual_template
* modified api to configure ipv6_pool_name


Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* CHEETAH
* Modified execute_archive_download:
* Changed if-else logic to make api generic
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* IOSXE
* Updated get_boot_variables
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------
* IOSXE
* Updated regex to consider interface shorthand without the "/" character
Loading

0 comments on commit 00354ee

Please sign in to comment.