Skip to content

Commit

Permalink
Merge pull request #106 from CiscoTestAutomation/release_24.11
Browse files Browse the repository at this point in the history
Releasing v24.11
  • Loading branch information
lsheikal authored Nov 27, 2024
2 parents bb8271e + 9951e78 commit f31a0d9
Show file tree
Hide file tree
Showing 21 changed files with 558 additions and 65 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ develop:
@echo ""
@pip uninstall -y $(PKG_NAME)
@pip install $(DEPENDENCIES)
@$(PYTHON) setup.py develop --no-deps
@pip install -e . --no-deps
@echo ""
@echo "Completed building and installing: $@"
@echo ""
Expand All @@ -97,7 +97,7 @@ undevelop:
@echo "Uninstalling $(PKG_NAME) development distributable: $@"
@echo ""

@$(PYTHON) setup.py develop --no-deps -q --uninstall
@pip uninstall $(PKG_NAME) -y

@echo ""
@echo "Completed uninstalling: $@"
Expand Down
29 changes: 29 additions & 0 deletions docs/changelog/2024/november.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
November 2024
==========

November 26 - Unicon v24.11
------------------------



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

``unicon.plugins``, v24.11
``unicon``, v24.11




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

* unicon/bases
* Router/connection_provider
* Updated designate_handles to not change state of standby if it is locked.
* Added quad device specific unlock_standby method to execute configs only on Active console


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/november
2024/october
2024/September
2024/august
Expand Down
50 changes: 50 additions & 0 deletions docs/changelog_plugins/2024/november.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
November 2024
==========

November 26 - Unicon.Plugins v24.11
------------------------



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

``unicon.plugins``, v24.11
``unicon``, v24.11




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

* iosxe
* Added UT for Quad device to test scenario when standby console is disabled

* iosxr
* SPITFIRE plugin
* Added UNICON_BACKEND_DECODE_ERROR_LIMIT with a default value of 10, to handle scenarios when the device is slow

* hvrp
* Update config pattern
* Update configure service to handle immediate vs two-stage config mode

* nxos
* modify regex to handle new error pattern for NXOS

* generic
* Modified enable_secret regex pattern to accommodate various outputs
* Updated password_handler to pass password if password key in context dict


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

* iosxe
* Update prompt recovery command


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/november
2024/october
2024/September
2024/august
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.10'
__version__ = '24.11'

supported_chassis = [
'single_rp',
Expand Down
2 changes: 1 addition & 1 deletion src/unicon/plugins/generic/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self):

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*$'
self.enable_secret = r'^.*?(Enter|Confirm) enable secret( \[<Use current secret>\])?:\s*$'
self.enable_password = r'^.*?enable[\r\n]*.*?[Pp]assword( for )?(\S+)?: ?$'

self.enter_your_selection_2 = r'^.*?Enter your selection( \[2])?:\s*$'
Expand Down
2 changes: 2 additions & 0 deletions src/unicon/plugins/generic/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ def password_handler(spawn, context, session):
if context.get('username', '') == spawn.last_sent.rstrip() or ssh_tacacs_handler(spawn, context):
if (tacacs_password := context.get('tacacs_password')):
spawn.sendline(tacacs_password)
elif context.get('password'):
spawn.sendline(context['password'])
else:
spawn.sendline(context['line_password'])

Expand Down
8 changes: 4 additions & 4 deletions src/unicon/plugins/hvrp/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def __init__(self):
self.username = r'^.*[Ll]ogin:'
self.password = r'^.*[Pp]assword:'

# <HOSTNAME-01> | <HOSTNAME>#
# <HOSTNAME>
self.enable_prompt = r'^(.*)\<%N.*\>$'


# [~HOSTNAME] | <HOSTNAME-01> # # breaks on [\y\n] # Warning: All the configuration will be saved to the next startup configuration. Continue? [y/n]:
self.config_prompt = r'^.*\[(~|\*)%N.*\]'
# [~HOSTNAME] # two-stage config mode
# [HOSTNAME] # immediate config mode
self.config_prompt = r'^.*\[(?P<two_stage>~|\*)?%N.*\]'

# Exit with uncommitted changes? [yes,no] (yes)
self.commit_changes_prompt = r'Exit with uncommitted changes? [yes,no] (yes)\s*'
Expand Down
20 changes: 19 additions & 1 deletion src/unicon/plugins/hvrp/service_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,22 @@ def __init__(self, connection, context, **kwargs):
self.start_state = 'config'
self.end_state = 'enable'
self.service_name = 'config'
self.commit_cmd = 'commit'

def pre_service(self, *args, **kwargs):
super().pre_service(*args, **kwargs)

# Check if device is operating in two-stage configuration mode.
# =============================================================
spawn = self.get_spawn()
two_stage = spawn.match.last_match.groupdict().get('two_stage')

# In the two-stage mode, if the user has modified configurations but has
# not submit the modification, the system prompt ~ is changed to *,
# prompting the user that the configurations are not submitted. After
# the user runs the commit command to submit the configurations, the
# system prompt * is restored to ~.

if two_stage:
self.commit_cmd = 'commit'
else:
self.commit_cmd = ''
3 changes: 0 additions & 3 deletions src/unicon/plugins/iosxe/quad/statemachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ class IosXEQuadStateMachine(IosXEDualRpStateMachine):
def create(self):
super().create()

# Remove standby_locked state
self.remove_state('standby_locked')

# Add RPR state
rpr = State('rpr', patterns.rpr_state)
self.add_state(rpr)
2 changes: 2 additions & 0 deletions src/unicon/plugins/iosxe/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def __init__(self):
# A single cycle of retries wasn't enough to recover an iosxe device
# just rebooted after a "write erase".
self.PROMPT_RECOVERY_RETRIES = 2
self.PROMPT_RECOVERY_COMMANDS = ['\r', '\x1e', '\x03']

self.ERROR_PATTERN = [
r'^%\s*[Ii]nvalid (command|input)',
r'^%\s*[Ii]ncomplete (command|input)',
Expand Down
1 change: 1 addition & 0 deletions src/unicon/plugins/iosxr/spitfire/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self):
'session-timeout 0'
]
self.CONFIG_TIMEOUT = 600
self.UNICON_BACKEND_DECODE_ERROR_LIMIT = 10
self.STANDBY_STATE_REGEX = r'Standby node .* is (.*)'

# Default commands: Enter key , Ctrl-C, Enter Key
Expand Down
4 changes: 2 additions & 2 deletions src/unicon/plugins/nxos/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def __init__(self):
r'^%\s*[Nn]ot supported.*',
r'^%\s*[Ff]ail.*',
r'^%\s*[Aa]bort.*'
r'^%\s*[Ee](RROR|rror).*',
r'^%\s*Ambiguous command'
r'^%?\s*[Ee](RROR|rror).*',
r'^%\s*Ambiguous command',
]

self.GUESTSHELL_CONFIG_CMDS = []
Expand Down
11 changes: 11 additions & 0 deletions src/unicon/plugins/tests/mock_data/hvrp/hvrp_mock_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,15 @@ bgp_config_uncommitted_change:
- "0:,0,2,0"
new_state: bgp_config

exec2:
prompt: <%N>
commands:
"system-view":
new_state: config2

config2:
prompt: "[%N]"
commands:
"bgp 65000": ""
"return":
new_state: exec2
118 changes: 118 additions & 0 deletions src/unicon/plugins/tests/mock_data/iosxe/cat9k_vwlc_reload_logs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@


Cisco Systems, Inc.

170 West Tasman Drive

San Jose, California 95134-1706




Cisco IOS Software [IOSXE], C9800-CL Software (C9800-CL-K9_IOSXE), Experimental Version 17.17.20240919:014147 [BLD_POLARIS_DEV_LATEST_20240919_003342:/nobackup/mcpre/s2c-build-ws 101]

Copyright (c) 1986-2024 by Cisco Systems, Inc.

Compiled Wed 18-Sep-24 18:42 by mcpre



This software version supports only Smart Licensing as the software licensing mechanism.



Please read the following carefully before proceeding. By downloading,

installing, and/or using any Cisco software product, application, feature,

license, or license key (collectively, the "Software"), you accept and

agree to the following terms. If you do not agree, do not proceed and do not

use this Software.


This Software and its use are governed by Cisco's General Terms and any

relevant supplemental terms found at

https://www.cisco.com/site/us/en/about/legal/contract-experience/index.html.

If you have a negotiated agreement with Cisco that includes this Software, the

terms of that agreement apply as well. In the event of a conflict, the order

of precedence stated in your negotiated agreement controls.


Cisco Software is licensed on a term and/or subscription-basis. The license to

the Software is valid only for the duration of the specified term, or in the

case of a subscription-based license, only so long as all required subscription

payments are current and fully paid-up. While Cisco may provide you

licensing-related alerts, it is your sole responsibility to monitor your usage.

Using Cisco Software without a valid license is not permitted and may result in

fees charged to your account. Cisco reserves the right to terminate access to,

or restrict the functionality of, any Cisco Software, or any features thereof,

that are being used without a valid license.



% Failed to initialize nvram


Database already initialized

FIPS: Flash Key Check : Key Not Found, FIPS Mode Not Enabled

platform initcisco C9800-CL (VXE) processor (revision VXE) with 4016588K/3075K bytes of memory.

Processor board ID 9U9NBR9CPLO

Router operating mode: Autonomous

1 Virtual Ethernet interface

3 Gigabit Ethernet interfaces

32768K bytes of non-volatile configuration memory.

8084084K bytes of physical memory.

6201343K bytes of virtual hard disk at bootflash:.

0K bytes of Cloud S3 Storage at cloudfs:.

Installation mode is BUNDLE



No startup-config, starting autoinstall/pnp/ztp...


Autoinstall will terminate if any input is detected on console


Autoinstall trying DHCPv4 on Vlan1


--------------------------------------------------

System is booted with ASCII based startup configuration

due to missing binary configuration or previous condition.

Please perform "write mem" to generate binary

configuration. System uses binary-config internally to

reduce overall bootime significantly.

--------------------------------------------------
Loading

0 comments on commit f31a0d9

Please sign in to comment.