Skip to content

Commit

Permalink
Merge pull request #160 from CiscoTestAutomation/release_24.3
Browse files Browse the repository at this point in the history
Release 24.3
  • Loading branch information
omehrabi authored Mar 29, 2024
2 parents f332a71 + fc57a61 commit cdaa366
Show file tree
Hide file tree
Showing 2,737 changed files with 50,639 additions and 31,824 deletions.
24 changes: 24 additions & 0 deletions pkgs/clean-pkg/changelog/2024/march.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* clean
* clean
* add template to not a stage list.

* clean-pkg
* ncs540/stages
* Update install_and_replace to use reload instead of execute api

* clean/utils
* Updated get_clean_template api to load other clean packages using entrypoint.


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

* clean/iosxe
* Updated iosxe generic templates.


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.2'
__version__ = '24.3'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'
Expand Down
2 changes: 1 addition & 1 deletion pkgs/clean-pkg/src/genie/libs/clean/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Logger
log = logging.getLogger(__name__)

NOT_A_STAGE = ['device_recovery', 'images', 'order', 'mgt_itf']
NOT_A_STAGE = ['device_recovery', 'images', 'order', 'mgt_itf', 'template']

GLOBAL_STAGE_REUSE_LIMIT = 3

Expand Down
22 changes: 6 additions & 16 deletions pkgs/clean-pkg/src/genie/libs/clean/stages/iosxr/ncs540/stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ def install_replace_failure():
action="sendline()",
loop_continue=True,
continue_timer=False),
Statement(
pattern=r".*Install replace operation(.*)has started.*",
loop_continue=True,
continue_timer=False),
Statement(
pattern=r".*Install operation will continue in the background.*",
loop_continue=True,
continue_timer=False),
Statement(
pattern=r".*Failed to start replace.*",
action=install_replace_failure,
Expand All @@ -154,17 +146,15 @@ def install_replace_failure():
try:
if server:
install_replace_command = "install replace {protocol}://{server};{vrf}/{image}".format(protocol=protocol,\
server=server, vrf=vrf, image=image[0])
server=server, \
vrf=vrf, \
image=image[0])
else:
install_replace_command = "install replace {0}".format(image[0])

device.execute(install_replace_command,
reply=install_replace_dialog,
)
# Timeout for install operation
log.info("Sleeping for {install_timeout} seconds to wait for the install to run in the background"
.format(install_timeout=str(install_timeout)))
time.sleep(install_timeout)
device.reload(reload_command=install_replace_command,
reply=install_replace_dialog)

except Exception as e:
step.failed("Failed to install the image. Reason: "
"{}".format(str(e)))
Expand Down
112 changes: 1 addition & 111 deletions pkgs/clean-pkg/src/genie/libs/clean/templates/iosxe/templates.py
Original file line number Diff line number Diff line change
@@ -1,119 +1,9 @@
DEFAULT = {
'connect': {},
'apply_configuration': {
'configuration': r"%CLEANARG{preconfig_str}",
'copy_vdc_all': r"%CLEANARG{copy_vdc_all}",
},
'change_boot_variable': {
'images': r"%CLEANARG{boot_variable}",
'timeout': r"%CLEANARG{timeout}"
},
'tftp_boot': {
'image': r"%CLEANARG{images}",
'ip_address': r"%CLEANARG{ip_address}",
'gateway': r"%CLEANARG{gateway}",
'subnet_mask': r"%CLEANARG{subnet_mask}",
'tftp_server': r"%CLEANARG{tftp_server}",
'recovery_password': r"%CLEANARG{recovery_password}",
'recovery_username':r"%CLEANARG{recovery_username}",
'save_system_config': r"%CLEANARG{save_system_config}",
'timeout': r"%CLEANARG{timeout}"
},
'install_remove_inactive': {
'timeout': r"%CLEANARG{timeout}",
},
'install_image': {
'images': r"%CLEANARG{images}",
'save_system_config': r"%CLEANARG{save_system_config}",
'install_timeout': r"%CLEANARG{install_timeout}",
'reload_timeout': r"%CLEANARG{reload_timeout}"
},
'ping_server': {
'server': r"%CLEANARG{server}",
'vrf': r"%CLEANARG{vrf}",
},
'copy_to_linux':{
'protocol': r"%CLEANARG{protocol}",
'append_hostname': r"%CLEANARG{hostname_check}",
'copy_attempts': r"%CLEANARG{copy_attempts}",
'destination': {
'directory': r"%CLEANARG{directory}",
'hostname': r"%CLEANARG{server}"
},
'origin': {
'files': r"%CLEANARG{files_to_copy}",
'hostname': r"%CLEANARG{server}",
},
'overwrite': r"%CLEANARG{overwrite}"
},
'copy_to_device': {
'origin': {
'files': r"%CLEANARG{files_to_copy}",
'hostname': r"%CLEANARG{server}",
},
'destination': {
'directory': r"%CLEANARG{directory}",
},
'protocol': r"%CLEANARG{protocol}",
'vrf': r"%CLEANARG{vrf}",
'overwrite': r"%CLEANARG{overwrite}",
'expected_num_images': r"%CLEANARG{num_images}",
'timeout': r"%CLEANARG{timeout}",
'check_file_stability': False
},
'write_erase': {
'timeout': r"%CLEANARG{timeout}"
},
'reload': {
'check_modules': {
'check': r"%CLEANARG{check}"
},
'reload_service_args': {
'timeout': r"%CLEANARG{timeout}",
'prompt_recovery': r"%CLEANARG{prompt_recovery}"
}
},
'verify_running_image': {
'images': r"%CLEANARG{images}"
},
'backup_file_on_device': {
'copy_dir': r"%CLEANARG{copy_dir}",
'copy_file': r"%CLEANARG{file_name}"
},
'delete_backup_from_device': {
'delete_dir': r"%CLEANARG{delete_dir}",
'delete_dir_stby': r"%CLEANARG{delete_dir_stby}",
'delete_file': r"%CLEANARG{file_name}"
},
'delete_files_from_server': {
'server': r"%CLEANARG{server}",
'files': r"%CLEANARG{files_to_delete}",
'protocol': r"%CLEANARG{protocol}"
},
'powercycle': {},

'order': ['connect',
'apply_configuration',
'change_boot_variable',
'tftp_boot',
'install_remove_inactive',
'install_image',
'ping_server',
'copy_to_linux',
'copy_to_device',
'write_erase',
'reload',
'verify_running_image',
'backup_file_on_device',
'delete_backup_from_device',
'delete_files_from_server',
'powercycle']
]
}


DEFAULT_ARGS = {
"directory": "bootflash:",
"vrf": "management",
"copy_vdc_all": False,
"overwrite": False,
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ def setUp(self):
# attributes and Mock objects associated with the device.
self.device = create_test_device('PE1', os='iosxe')

def test_install_remove_inactive_pass(self):
def test_connect_in_template(self):
# setting the expected output as default hostname in the iosxe template
Expected_output = 180

#To get the iosxe specific template
Actual_output = self.device.api.clean.template

# Check that the result is expected
self.assertEqual(Expected_output, Actual_output['install_remove_inactive']['timeout'])
self.assertIn('connect', Actual_output)

15 changes: 13 additions & 2 deletions pkgs/clean-pkg/src/genie/libs/clean/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,19 @@ def deprecate_msg(self):
def get_clean_template(device, template='DEFAULT'):
"""API to return the clean template as a loaded dictionary."""

abstract = Lookup.from_device(device, packages={'clean': clean})
return getattr(abstract.clean.templates.templates, template)
# Check for other clean packages, if not fall back to generic clean
for entrypoint in iter_entry_points(group=CLEAN_PLUGIN_ENTRYPOINT):
try:
# Load the clean entry point
clean_entry = entrypoint.load()
if clean_entry:
abstract = Lookup.from_device(device, packages={'entry': clean_entry})
return getattr(abstract.entry.templates.templates, template)
except Exception as e:
continue
else:
abstract = Lookup.from_device(device, packages={'clean': clean})
return getattr(abstract.clean.templates.templates, template)

def raise_(ex):
""" General purpose raiser.
Expand Down
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.2'
__version__ = '24.3'
__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.2'
__version__ = '24.3'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
execute:
prompt: "%N#"
commands:
show version | include operating mode: ''
"copy tftp://172.19.1.250//auto/tftp-kmukku/9300m-tb2/meraki.bin flash:/meraki.bin": |
Loading /auto/tftp-kmukku/9300m-tb2/meraki.bin from 172.19.1.250 (via GigabitEthernet0/0): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%Error opening tftp://255.255.255.255/network-confg (Timed out)!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Expand All @@ -10,10 +11,10 @@ execute:
1269880464 bytes copied in 103.256 secs (12298370 bytes/sec)

"copy tftp://172.19.1.250//auto/tftp-kmukku/9300m-tb2/meraki1.bin flash:/meraki1.bin": |
Loading /auto/tftp-kmukku/9300m-tb2/meraki1.bin from 172.19.1.250 (via GigabitEthernet0/0): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%Error
[OK - 1269880464 bytes]
1269880464 bytes copied in 103.256 secs (12298370 bytes/sec)
Loading /auto/tftp-kmukku/9300m-tb2/meraki1.bin from 172.19.1.250 (via GigabitEthernet0/0): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%Error
[OK - 1269880464 bytes]
1269880464 bytes copied in 103.256 secs (12298370 bytes/sec)
"copy tftp://127.0.0.1/somefile.bin flash:":
new_state: confirm_abort_copy

Expand All @@ -28,4 +29,4 @@ confirm_abort_copy:
[OK - 5581609 bytes]
new_state: execute
"":
new_state: execute
new_state: execute
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.2'
__version__ = '24.3'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['asg-genie-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2020, Cisco Systems Inc.'
Expand Down
35 changes: 35 additions & 0 deletions pkgs/ops-pkg/changelog/2024/march.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* iosxe
* Added learn support for show terminal
* Modified Platform
* Added label to platform ops model

* iosxr
* Added learn support for show terminal

* nxos
* Added learn support for show terminal

* cheetah
* Added learn support for platform and interface

* platform
* Cleanup of redundant functions under ios and iosxe to use from utils.common


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

* ops
* Modified Lisp
* Fixed List Ops and added unittest symlink

* iosxr
* Platform
* Update platform tempalte to include device_family from show version for the value of chassis.


Loading

0 comments on commit cdaa366

Please sign in to comment.