Skip to content

Commit

Permalink
Merge pull request #95 from CiscoTestAutomation/release_24.2
Browse files Browse the repository at this point in the history
Releasing v24.2
  • Loading branch information
lsheikal authored Feb 27, 2024
2 parents e07178f + 77047c3 commit ddf617c
Show file tree
Hide file tree
Showing 15 changed files with 331 additions and 121 deletions.
61 changes: 61 additions & 0 deletions docs/changelog/2024/february.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
February 2024
==========

February 27 - Unicon v24.2
------------------------



.. csv-table:: Module Versions
:header: "Modules", "Versions"

``unicon.plugins``, v24.2
``unicon``, v24.2

Install Instructions
^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
bash$ pip install unicon.plugins
bash$ pip install unicon
Upgrade Instructions
^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
bash$ pip install --upgrade unicon.plugins
bash$ pip install --upgrade unicon
Features and Bug Fixes:
^^^^^^^^^^^^^^^^^^^^^^^




Changelogs
^^^^^^^^^^
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* connection_provider
* Updated try/except to log error message as warning

* unicon.eal
* Add EOF handler for connection errors with telnet backend

* sshutils
* Add a new pattern for add tunnel


--------------------------------------------------------------------------------
New
--------------------------------------------------------------------------------

* utils
* AbstractTokenDiscovey
* Update the logic so the paltform set to sdwan if device is in controller mode.


1 change: 1 addition & 0 deletions docs/changelog/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
.. toctree::
:maxdepth: 2

2024/february
2024/january
2023/november
2023/october
Expand Down
59 changes: 59 additions & 0 deletions docs/changelog_plugins/2024/february.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
February 2024
==========

February 27 - Unicon.Plugins v24.2
------------------------



.. csv-table:: Module Versions
:header: "Modules", "Versions"

``unicon.plugins``, v24.2
``unicon``, v24.2

Install Instructions
^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
bash$ pip install unicon.plugins
bash$ pip install unicon
Upgrade Instructions
^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
bash$ pip install --upgrade unicon.plugins
bash$ pip install --upgrade unicon
Features and Bug Fixes:
^^^^^^^^^^^^^^^^^^^^^^^




Changelogs
^^^^^^^^^^
--------------------------------------------------------------------------------
Fix
--------------------------------------------------------------------------------

* generic
* Add EOF statement to handle connection loss when using telnet backend

* iosxe
* Added below config error patterns
* % Invalid address
* % Deletion of RD in progress; wait for it to complete


--------------------------------------------------------------------------------
Add
--------------------------------------------------------------------------------

* utils
* Update assertRegexpMatches to assertRegex to fix attribute error in python 3.12


1 change: 1 addition & 0 deletions docs/changelog_plugins/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Plugins Changelog
.. toctree::
:maxdepth: 2

2024/february
2024/january
2023/november
2023/october
Expand Down
2 changes: 1 addition & 1 deletion src/unicon/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '24.1'
__version__ = '24.2'

supported_chassis = [
'single_rp',
Expand Down
5 changes: 4 additions & 1 deletion src/unicon/plugins/generic/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ def __init__(self):
""" initialises all generic patterns
"""
super().__init__()
# self.enable_prompt = r'.*%N#\s?$'
self.default_hostname_pattern = r'WLC|RouterRP|Router|[Ss]witch|Controller|ios'

self.enable_prompt = r'^(.*?)(Router|Router-stby|Router-sdby|RouterRP|RouterRP-standby|%N-standby|%N\(standby\)|%N-sdby|%N-stby|(S|s)witch|(S|s)witch\(standby\)|Controller|ios|-Slot[0-9]+|%N)(\(boot\))*#\s?$'

# self.disable_prompt = r'.*%N>\s?$'
self.disable_prompt = r'^(.*?)(Router|Router-stby|Router-sdby|RouterRP|RouterRP-standby|%N-standby|%N-sdby|%N-stby|(S|s)witch|s(S|s)witch\(standby\)|Controller|ios|-Slot[0-9]+|%N)(\(boot\))*>\s?$'

# self.config_prompt = r'.*%N\(config.*\)#\s?$'
self.config_prompt = r'^(.*)\(.*(con|cfg|ipsec-profile|ca-trustpoint|gkm-local-server)\S*\)#\s?$'
self.rommon_prompt = r'^(.*?)(rommon[\s\d]*>|switch:)\s?$'
# self.standby_enable_prompt = r'^(.*?)(RouterRP-standby|%N-standby|%N-sdby|%N\(standby\))#\s?$'
Expand Down Expand Up @@ -68,7 +71,7 @@ def __init__(self):

self.config_locked = r'Configuration (mode )?(is )?locked|Config mode cannot be entered'

self.config_start = r'\nEnter configuration commands, one per line\.\s+End with CNTL/Z\.\s*$'
self.config_start = r'Enter configuration commands, one per line\.\s+End with CNTL/Z\.\s*$'

self.enable_secret = r'^.*?(Enter|Confirm) enable secret:\s*$'

Expand Down
8 changes: 7 additions & 1 deletion src/unicon/plugins/generic/service_statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ def config_session_locked_handler(context):
loop_continue=False,
continue_timer=False)

eof_statement = Statement(pattern='__eof__',
action=connection_closed_handler,
args=None,
loop_continue=False,
continue_timer=False)

reload_statement_list = [save_env, confirm_reset, reload_confirm,
reload_confirm_ios, reload_confirm_iosxe, useracess,
confirm_config, setup_dialog, auto_install_dialog,
Expand All @@ -348,7 +354,7 @@ def config_session_locked_handler(context):
generic_statements.syslog_msg_stmt,
# Below statements have loop_continue=False
password_stmt, press_enter, press_return,
connection_closed_stmt
connection_closed_stmt, eof_statement
]

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
Expand Down
7 changes: 5 additions & 2 deletions src/unicon/plugins/generic/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ def __init__(self):
self.BOOT_FILESYSTEM = 'bootflash:'
self.BOOT_FILE_REGEX = r'(\S+\.bin)'

# Time to wait for the config prompt to appear
self.CONFIG_TRANSITION_WAIT = 15
# Wait for the config prompt to appear
# before checking for the config prompt.
# This may need to be adjusted if the RTT between
# the execution host and lab device is high.
self.CONFIG_TRANSITION_WAIT = 0.2

# If learn_hostname is requested but no hostname was actually learned,
# substitute this default hostname when occurances of HOSTNAME_SUBST_PAT
Expand Down
5 changes: 3 additions & 2 deletions src/unicon/plugins/iosxe/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self):
r'% Unknown command or computer name, or unable to find computer address'
]
self.CONFIGURE_ERROR_PATTERN = [
r'^%\s*[Ii]nvalid (command|input|number)',
r'^%\s*[Ii]nvalid (command|input|number|address)',
r'routing table \S+ does not exist',
r'^%\s*SR feature is not configured yet, please enable Segment-routing first.',
r'^%\s*\S+ overlaps with \S+',
Expand All @@ -31,7 +31,8 @@ def __init__(self):
r'% Specify remote-as or peer-group commands first',
r'% Policy commands not allowed without an address family',
r'% Color set already. Deconfigure first',
r'Invalid policy name, \S+ does not exist'
r'Invalid policy name, \S+ does not exist',
r'% Deletion of RD in progress; wait for it to complete'
]

self.EXECUTE_MATCHED_RETRIES = 1
Expand Down
36 changes: 18 additions & 18 deletions src/unicon/plugins/nxos/service_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ class HaNxosReloadPatterns:
# NXOS reload pattern
def __init__(self):
self.reboot = r'(.*?)This command will reboot the system. \(y\/n\)\? \[n\]'
self.secure_password = r'^.*Do you want to enforce secure password standard \(yes\/no\) \[y\]\:'
self.auto_provision = r'Abort( Power On)? Auto Provisioning and continue with normal setup \?\(yes\/no\)\[n\]\:'
self.enable_vdc = r'Do you want to enable admin vdc\s?\(yes\/no\)\s?\[n\]\:'
self.admin_password = r'^.*(Enter|Confirm) the password for .*admin'
self.snmp_port = r'^.*Enable the SNMP port\? \(yes\/no\) \[y\]:'
self.boot_vdc = r'^.*Boot up system with default vdc \(yes\/no\) \[y\]\:'
self.reload_proceed = r'^(.*)Proceed with reload\? \[confirm\]$'
self.loader_prompt = r'^(.*)loader\s*>'
self.redundant = r'^.*REDUNDANCY mode is (RPR|SSO).*'
self.config_byte = r'Uncompressed configuration from [0-9]+ bytes to [0-9]+ bytes'
self.login_notready = r'^.*is not ready or active for login.*'
self.setup_dialog = r'^.*(initial|basic) configuration dialog.*\s?'
self.autoinstall_dialog = r'^(.*)Would you like to terminate autoinstall\? ?\[yes\]: $'
self.useracess = r'^.*User Access Verification'
self.username = r'^.*([Uu]sername|[Ll]ogin): ?$'
self.password = r'^.*[Pp]assword: ?$'
self.secure_password = r'(.*?)Do you want to enforce secure password standard \(yes\/no\) \[y\]\:'
self.auto_provision = r'(.*?)Abort( Power On)? Auto Provisioning and continue with normal setup \?\(yes\/no\)\[n\]\:'
self.enable_vdc = r'(.*?)Do you want to enable admin vdc\s?\(yes\/no\)\s?\[n\]\:'
self.admin_password = r'^(.*?)(Enter|Confirm) the password for .*admin'
self.snmp_port = r'^(.*?)Enable the SNMP port\? \(yes\/no\) \[y\]:'
self.boot_vdc = r'^(.*?)Boot up system with default vdc \(yes\/no\) \[y\]\:'
self.reload_proceed = r'^(.*?)Proceed with reload\? \[confirm\]$'
self.loader_prompt = r'^(.*?)loader\s*>'
self.redundant = r'^(.*?)REDUNDANCY mode is (RPR|SSO).*'
self.config_byte = r'^(.*?)Uncompressed configuration from [0-9]+ bytes to [0-9]+ bytes'
self.login_notready = r'^(.*?)is not ready or active for login.*'
self.setup_dialog = r'^(.*?)(initial|basic) configuration dialog.*\s?'
self.autoinstall_dialog = r'^(.*?)Would you like to terminate autoinstall\? ?\[yes\]: $'
self.useracess = r'^(.*?)User Access Verification'
self.username = r'^(.*?)([Uu]sername|[Ll]ogin): ?$'
self.password = r'^(.*?)[Pp]assword: ?$'
self.run_init = r' Entering runlevel'
self.system_up = r'System is coming up ... Please wait'
self.skip_poap = r'^.*System is not fully online. Skip POAP\? \(yes\/no\)\[n\]:\s*$'
self.system_up = r'^(.*?)System is coming up ... Please wait'
self.skip_poap = r'^(.*?)System is not fully online. Skip POAP\? \(yes\/no\)\[n\]:\s*$'
Loading

0 comments on commit ddf617c

Please sign in to comment.