Skip to content

Commit f4abc00

Browse files
authored
Merge pull request #119 from CiscoTestAutomation/release_25.10
Release 25.10
2 parents a3d9979 + d12e8d3 commit f4abc00

33 files changed

+767
-95
lines changed

docs/changelog/2025/october.rst

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
October 2025
2+
==========
3+
4+
October 28 - Unicon v25.10
5+
------------------------
6+
7+
8+
9+
.. csv-table:: Module Versions
10+
:header: "Modules", "Versions"
11+
12+
``unicon.plugins``, v25.10
13+
``unicon``, v25.10
14+
15+
16+
17+
18+
Changelogs
19+
^^^^^^^^^^
20+
--------------------------------------------------------------------------------
21+
Fix
22+
--------------------------------------------------------------------------------
23+
24+
* unicon
25+
* Modified TestUniconSettings
26+
* Fixed regex pattern to correctly match Invalid input error message in exec command.
27+
28+
* plugins/linux
29+
* Updated unit tests to accommodate the removal of the default 'uptime' command from LINUX_INIT_EXEC_COMMANDS.
30+
31+
* adapters
32+
* Updated the log collection to check for runtime directory before moving
33+
34+
* modified basemultirpconnectionprovider
35+
* Updated token discovery to handle standby locked devices
36+
37+
38+
--------------------------------------------------------------------------------
39+
New
40+
--------------------------------------------------------------------------------
41+
42+
* unicon/bases/linux/connection
43+
* Added peripheral support for Linux OS devices
44+
* Updated BaseLinuxConnection to pass device to Spawn initialization, enabling clearing of busy console lines for Linux-based platforms
45+
46+
47+
--------------------------------------------------------------------------------
48+
Add
49+
--------------------------------------------------------------------------------
50+
51+
* basemultirpconnection
52+
* Added swap_roles in Multi RP connection which is parent class to have it handled for other connections.
53+
54+
55+
--------------------------------------------------------------------------------
56+
Fix
57+
--------------------------------------------------------------------------------
58+
59+
* iosxe/cat9k/stackwise_virtual
60+
* Enhanced the designate handles for condition where a standby & b active
61+
62+

docs/changelog/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changelog
44
.. toctree::
55
:maxdepth: 2
66

7+
2025/october
78
2025/september
89
2025/august
910
2025/july
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
October 2025
2+
==========
3+
4+
October 28 - Unicon.Plugins v25.10
5+
------------------------
6+
7+
8+
9+
.. csv-table:: Module Versions
10+
:header: "Modules", "Versions"
11+
12+
``unicon.plugins``, v25.10
13+
``unicon``, v25.10
14+
15+
16+
17+
18+
Changelogs
19+
^^^^^^^^^^
20+
--------------------------------------------------------------------------------
21+
New
22+
--------------------------------------------------------------------------------
23+
24+
* iosxe/c9800
25+
26+
* plugins/linux
27+
* Added uptime command to LINUX_INIT_EXEC_COMMANDS by default.
28+
29+
* unicon
30+
* Added UT for the fix added in unicon
31+
32+
* iosxe
33+
* Updated the disable prompt pattern not to recongnise grub as disable mode prompt.
34+
35+
36+
--------------------------------------------------------------------------------
37+
Fix
38+
--------------------------------------------------------------------------------
39+
40+
* iosxe
41+
* Updated exec error pattern
42+
* Fixed ACM Configure service end-state handling.
43+
44+
* generic
45+
* Updated syslog pattern to handle RSA key log message
46+
47+

docs/changelog_plugins/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Plugins Changelog
44
.. toctree::
55
:maxdepth: 2
66

7+
2025/october
78
2025/september
89
2025/august
910
2025/july

src/unicon/plugins/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "25.9"
1+
__version__ = "25.10"
22

33
supported_chassis = [
44
'single_rp',

src/unicon/plugins/generic/patterns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self):
7777
r"^.*?(%\w+(-\S+)?-\d+-\w+|"
7878
r"yang-infra:|PKI_SSL_IPC:|Guestshell destroyed successfully|"
7979
r"%Error opening tftp:\/\/255\.255\.255\.255|Autoinstall trying|"
80-
r"audit: kauditd hold queue overflow|SECURITY WARNING|"
80+
r"audit: kauditd hold queue overflow|SECURITY WARNING|%RSA key|"
8181
r"(LC|RP)/\d+/\d+/CPU\d+:\w+\s+\d+\s+\d{2}:\d{2}:\d{2}|"
8282
r"\[OK\]"
8383
r").*\s*$"

src/unicon/plugins/iosxe/cat9k/c9800/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
from .statemachine import IosXEc9800SingleRpStateMachine
99
from .settings import IosXEc9800Settings
1010
from .. import service_implementation as svc
11-
11+
from .service_implementation import Rommon
1212

1313
class IosXEc9800ServiceList(IosXEServiceList):
1414
def __init__(self):
1515
super().__init__()
1616
self.reload = svc.Reload
17-
self.rommon = svc.Rommon
17+
self.rommon = Rommon
1818

1919

2020
class IosXEc9800SingleRpConnection(IosXESingleRpConnection):
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
3+
from unicon.eal.dialogs import Dialog
4+
from unicon.core.errors import SubCommandFailure
5+
from unicon.plugins.generic.service_implementation import Execute as GenericExecute
6+
7+
class Rommon(GenericExecute):
8+
"""C9800-specific Rommon service.
9+
Requires explicit config_register to be passed when invoked.
10+
No Enable Break parsing (not in C9800 show boot output).
11+
"""
12+
def __init__(self, connection, context, **kwargs):
13+
super().__init__(connection, context, **kwargs)
14+
self.start_state = 'rommon'
15+
self.end_state = 'rommon'
16+
self.service_name = 'rommon'
17+
self.timeout = kwargs.get('reload_timeout', 600)
18+
self.__dict__.update(kwargs)
19+
20+
def pre_service(self, *args, **kwargs):
21+
sm = self.get_sm()
22+
con = self.connection
23+
sm.go_to('enable', con.spawn, context=self.context)
24+
confreg = kwargs.get('config_register', "0x0")
25+
try:
26+
con.configure(f'config-register {confreg}')
27+
except Exception as err:
28+
raise SubCommandFailure(f"Failed to configure config-register {confreg}", err)
29+
30+
super().pre_service(*args, **kwargs)

src/unicon/plugins/iosxe/cat9k/stackwise_virtual/connection_provider.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
Authors:
33
44
"""
5-
5+
import re
66
from unicon.eal.dialogs import Dialog
77
from unicon.bases.routers.connection_provider import BaseStackRpConnectionProvider
88

99
from unicon.plugins.generic.statements import connection_statement_list, custom_auth_statements
1010

11-
1211
class StackwiseVirtualConnectionProvider(BaseStackRpConnectionProvider):
1312
""" Implements Stack Connection Provider,
1413
This class overrides the base class with the
@@ -49,9 +48,11 @@ def designate_handles(self):
4948
con.log.debug('{} in state: {}'.format(subcon.alias, subcon.state_machine.current_state))
5049

5150
if subcon1.state_machine.current_state == 'enable':
51+
target_con = subcon1
5252
target_alias = subcon1_alias
5353
other_alias = subcon2_alias
5454
elif subcon2.state_machine.current_state == 'enable':
55+
target_con = subcon2
5556
target_alias = subcon2_alias
5657
other_alias = subcon1_alias
5758

@@ -60,7 +61,6 @@ def designate_handles(self):
6061
con._handles_designated = True
6162

6263
device = con.device
63-
6464
try:
6565
# To check if the device is in SVL state
6666
output = device.parse("show switch")
@@ -72,7 +72,23 @@ def designate_handles(self):
7272
# There are case when in non-SVL the device connection
7373
# becomes active for both connection and there isn't a standby state
7474
# it would have either active and member state or just active state
75-
super().designate_handles()
75+
76+
# Verify the active and standby
77+
target_con.spawn.sendline(target_con.spawn.settings.SHOW_REDUNDANCY_CMD)
78+
output = target_con.spawn.expect(
79+
target_con.state_machine.get_state('enable').pattern,
80+
timeout=con.settings.EXEC_TIMEOUT).match_output
81+
82+
state = re.findall(target_con.spawn.settings.REDUNDANCY_STATE_PATTERN, output, flags=re.M)
83+
target_con.log.debug(f'{target_con.spawn} state: {state}')
84+
if any('active' in s.lower() for s in state):
85+
con._set_active_alias(target_alias)
86+
con._set_standby_alias(other_alias)
87+
elif any('standby' in s.lower() for s in state):
88+
con._set_standby_alias(target_alias)
89+
con._set_active_alias(other_alias)
90+
else:
91+
raise ConnectionError('unable to designate handles')
7692

7793
except Exception:
7894
con.log.exception("Failed to designate handle for SVL stack")

src/unicon/plugins/iosxe/patterns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self):
2323
self.want_continue_confirm = r'.*Do you want to continue\?\s*\[confirm]\s*$'
2424
self.want_continue_yes = r'.*Do you want to continue\?\s*\[y/n]\?\s*\[yes]:\s*$'
2525
self.disable_prompt = \
26-
r'^(.*?)(\(unlicensed\))?(wlc|WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(recovery-mode\))?(\(rp-rec-mode\))?(\(standby\))?(-stby)?(-standby)?(\(boot\))?(?<! -)>\s?$'
26+
r'^(?!.*?grub)(.*?)(\(unlicensed\))?(wlc|WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(recovery-mode\))?(\(rp-rec-mode\))?(\(standby\))?(-stby)?(-standby)?(\(boot\))?(?<! -)>\s?$'
2727
self.enable_prompt = \
2828
r'^(.*?)(\(unlicensed\))?(wlc|WLC|Router|RouterRP|Switch|ios|switch|%N)([0-9])?(\(recovery-mode\))?(\(rp-rec-mode\))?(\(standby\))?(-stby)?(-standby)?(\(boot\))?#[\s\x07]*$'
2929
self.maintenance_mode_prompt = \

0 commit comments

Comments
 (0)