Skip to content

Commit f05697e

Browse files
authored
Merge pull request #178 from CiscoTestAutomation/release_24.9
Releasing v24.9
2 parents 1adfa6d + 2526cd2 commit f05697e

File tree

259 files changed

+7953
-1157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

259 files changed

+7953
-1157
lines changed

pkgs/clean-pkg/changelog/2024/august.rst

-2
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,3 @@
2424
* Modified configure_management
2525
* Added `alias_as_hostname` argument
2626
* Allows user to use the alias as the device hostname
27-
28-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--------------------------------------------------------------------------------
2+
Fix
3+
--------------------------------------------------------------------------------
4+
5+
* clean
6+
* Modified iosxe.stage.Connect.connect
7+
* Set learn hostname to False after hostname learned
8+
* Modified tftp_device_recovery
9+
* If username and password are not provided, use default username and password
10+
11+
* utils
12+
* Modified validate_clean to not raise any exceptions on passing image_management to clean yaml file
13+
14+
15+
--------------------------------------------------------------------------------
16+
New
17+
--------------------------------------------------------------------------------
18+
19+
* iosxe
20+
* Modified
21+
* Allowing a config_register option in RommonBoot stage, with a default of 0x0
22+
* Added
23+
* Added support for quad sup devices in clean to connect the active and standby
24+
* Modified Clean Connect
25+
* Added check for console speed being incorrect as well as a fix

pkgs/sdk-pkg/changelog/changelog_fix_intf_option_verify_ip_mac_binding_in_network_20240620200612.rst pkgs/clean-pkg/changelog/changelog_modify_iosxe_ChangeBootVariable_stage_20240918204515.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
Fix
33
--------------------------------------------------------------------------------
44
* IOSXE
5-
* Add option to check interface and vlan for verify_ip_mac_binding_in_network
5+
* Modified ChangeBootVariable:
6+
* Modified verify_boot_variable to verify next reload boot variables using running image if current_running_image is True

pkgs/clean-pkg/sdk_generator/output/github_clean.json

+13-13
Large diffs are not rendered by default.

pkgs/clean-pkg/src/genie/libs/clean/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'''
99

1010
# metadata
11-
__version__ = '24.8'
11+
__version__ = '24.9'
1212
__author__ = 'Cisco Systems Inc.'
1313
1414
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.'

pkgs/clean-pkg/src/genie/libs/clean/recovery/iosxe/recovery.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ def tftp_device_recovery(spawn, timeout, device, tftp_boot, item, recovery_passw
103103
Returns:
104104
None
105105
"""
106-
107106
dialog = TftpRommonDialog()
108107

109108
# Add a statement to the dialog which will match the device hostname
@@ -113,6 +112,17 @@ def tftp_device_recovery(spawn, timeout, device, tftp_boot, item, recovery_passw
113112
action=print_message,
114113
args={'message': 'Device has reached privileged exec prompt'}))
115114

115+
credentials = device.credentials
116+
117+
if recovery_username is None:
118+
recovery_username = to_plaintext(credentials.get('default', {}).get('username'))
119+
120+
if recovery_password is None:
121+
recovery_password = to_plaintext(credentials.get('default', {}).get('password'))
122+
123+
if recovery_en_password is None:
124+
recovery_en_password = to_plaintext(credentials.get('enable', {}).get('password'))
125+
116126
dialog.dialog.process(
117127
spawn,
118128
timeout=timeout,

pkgs/clean-pkg/src/genie/libs/clean/recovery/recovery.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ def recovery_processor(
286286
if hasattr(device, 'is_ha') and device.is_ha:
287287
log.info('Device is HA! checking all the subconnections.')
288288
for index, connection in enumerate(device.subconnections,1):
289-
bring_to_any_state(connection, connection_timeout)
290-
log.info(f'subconnection {index} is in {connection.state_machine.current_state}')
289+
if device.get_rp_state(target=connection.alias) != 'IN_CHASSIS_STANDBY':
290+
bring_to_any_state(connection, connection_timeout)
291+
log.info(f'subconnection {index} is in {connection.state_machine.current_state}')
291292
else:
292293
bring_to_any_state(device, connection_timeout)
293294
log.info(f'Device is in {device.state_machine.current_state}')

pkgs/clean-pkg/src/genie/libs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
connect: &connect
2+
preface: |
3+
Trying mock_device ...
4+
5+
Connected to mock_device.
6+
7+
Escape character is ''^]''.
8+
prompt: "%N#"
9+
10+
change_boot_variable_1:
11+
<<: *connect
12+
commands:
13+
? ''
14+
: new_state: execute_1
15+
16+
execute_1:
17+
commands:
18+
show version | include operating mode: ''
19+
config term:
20+
new_state: configure_1
21+
write memory: |
22+
Building configuration...
23+
[OK]
24+
show bootvar: |
25+
BOOT variable = bootflash:/image.SSA.XYZ,12;
26+
CONFIG_FILE variable =
27+
BOOTLDR variable does not exist
28+
Configuration register is 0x2102
29+
30+
Standby BOOT variable = bootflash:/image.SSA.XYZ,12;
31+
Standby CONFIG_FILE variable =
32+
Standby BOOTLDR variable does not exist
33+
Standby Configuration register is 0x2102
34+
prompt: "%N#"
35+
36+
configure_1:
37+
commands:
38+
no boot system: ""
39+
end:
40+
new_state: execute_1
41+
line console:
42+
new_state: configure_line
43+
boot system bootflash:/image.SSA.XYZ: ""
44+
config-register 0x2102: ""
45+
prompt: "%N(config)#"
46+
47+
change_boot_variable_2:
48+
<<: *connect
49+
commands:
50+
? ''
51+
: new_state: execute_2
52+
53+
execute_2:
54+
commands:
55+
show version | include operating mode: ''
56+
show version: |
57+
show version
58+
Cisco IOS XE Software, Version BLD_POLARIS_DEV_LATEST_20240916_114854
59+
Cisco IOS Software [IOSXE], ASR1000 Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Experimental Version 17.17.20240916:124022 [BLD_POLARIS_DEV_LATEST_20240916_114854:/nobackup/mcpre/s2c-build-ws 103]
60+
Copyright (c) 1986-2024 by Cisco Systems, Inc.
61+
Compiled Mon 16-Sep-24 05:40 by mcpre
62+
63+
64+
Cisco IOS-XE software, Copyright (c) 2005-2024 by cisco Systems, Inc.
65+
All rights reserved. Certain components of Cisco IOS-XE software are
66+
licensed under the GNU General Public License ("GPL") Version 2.0. The
67+
software code licensed under GPL Version 2.0 is free software that comes
68+
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
69+
GPL code under the terms of GPL Version 2.0. For more details, see the
70+
documentation or "License Notice" file accompanying the IOS-XE software,
71+
or the applicable URL provided on the flyer accompanying the IOS-XE
72+
software.
73+
74+
75+
ROM: 17.3(1r)
76+
77+
R2 uptime is 18 hours, 55 minutes
78+
Uptime for this control processor is 18 hours, 57 minutes
79+
System returned to ROM by Reload Command
80+
System image file is "harddisk:packages.conf"
81+
Last reload reason: Reload Command
82+
83+
84+
85+
This product contains cryptographic features and is subject to United
86+
States and local country laws governing import, export, transfer and
87+
use. Delivery of Cisco cryptographic products does not imply
88+
third-party authority to import, export, distribute or use encryption.
89+
Importers, exporters, distributors and users are responsible for
90+
compliance with U.S. and local country laws. By using this product you
91+
agree to comply with applicable laws and regulations. If you are unable
92+
to comply with U.S. and local laws, return this product immediately.
93+
94+
A summary of U.S. laws governing Cisco cryptographic products may be found at:
95+
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
96+
97+
If you require further assistance please contact us by sending email to
98+
99+
100+
License Type: Smart License is permanent
101+
License Level: advipservices
102+
Next reload license Level: advipservices
103+
104+
Smart Licensing Status: Smart Licensing Using Policy
105+
106+
cisco ASR1006-X (RP3) processor (revision RP3) with 4087430K/24590K bytes of memory.
107+
Processor board ID FXS2239Q329
108+
Router operating mode: Autonomous
109+
20 Gigabit Ethernet interfaces
110+
2 Ten Gigabit Ethernet interfaces
111+
32768K bytes of non-volatile configuration memory.
112+
8388608K bytes of physical memory.
113+
7600127K bytes of eUSB flash at bootflash:.
114+
97620247K bytes of SATA hard disk at harddisk:.
115+
116+
Configuration register is 0x2102
117+
config term:
118+
new_state: configure_2
119+
write memory: |
120+
Building configuration...
121+
[OK]
122+
show bootvar: |
123+
BOOT variable = harddisk:packages.conf,12;
124+
CONFIG_FILE variable =
125+
BOOTLDR variable does not exist
126+
Configuration register is 0x2102
127+
128+
Standby BOOT variable = harddisk:packages.conf,12;
129+
Standby CONFIG_FILE variable =
130+
Standby BOOTLDR variable does not exist
131+
Standby Configuration register is 0x2102
132+
prompt: "%N#"
133+
134+
configure_2:
135+
commands:
136+
no boot system: ""
137+
end:
138+
new_state: execute_2
139+
line console:
140+
new_state: configure_line
141+
boot system harddisk:packages.conf: ""
142+
config-register 0x2102: ""
143+
prompt: "%N(config)#"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import unittest
2+
3+
from pyats.results import Passed
4+
from pyats.topology import loader
5+
from pyats.aetest.steps import Steps
6+
7+
from genie.libs.clean.stages.iosxe.stages import ChangeBootVariable
8+
9+
10+
class TestChangeBootVariable1(unittest.TestCase):
11+
""" Run unit testing on a mocked IOSXE asr1k device """
12+
13+
def test_change_boot_variable_pass(self):
14+
testbed = """
15+
devices:
16+
router:
17+
connections:
18+
defaults:
19+
class: unicon.Unicon
20+
a:
21+
command: mock_device_cli --os iosxe --mock_data_dir mock_data --state change_boot_variable_1
22+
protocol: unknown
23+
os: iosxe
24+
platform: asr1k
25+
model: ASR1001-HX
26+
type: router
27+
custom:
28+
abstraction:
29+
order: [os, platform, model]
30+
"""
31+
testbed = loader.load(testbed)
32+
device = testbed.devices['router']
33+
device.connect(
34+
learn_hostname=True,
35+
init_config_commands=[],
36+
init_exec_commands=[]
37+
)
38+
39+
# Make sure we have a unique Steps() object for result verification
40+
steps = Steps()
41+
42+
# And we want the following methods to be mocked to simulate the stage.
43+
change_boot_variable = ChangeBootVariable()
44+
45+
image = 'bootflash:/image.SSA.XYZ'
46+
47+
change_boot_variable(steps=steps, device=device, images=[image])
48+
49+
# Check the results is as expected.
50+
self.assertEqual(Passed, steps.details[0].result)
51+
52+
def test_change_boot_variable_with_current_running_image(self):
53+
testbed = """
54+
devices:
55+
router:
56+
connections:
57+
defaults:
58+
class: unicon.Unicon
59+
a:
60+
command: mock_device_cli --os iosxe --mock_data_dir mock_data --state change_boot_variable_2
61+
protocol: unknown
62+
os: iosxe
63+
platform: asr1k
64+
model: ASR1001-HX
65+
type: router
66+
custom:
67+
abstraction:
68+
order: [os, platform, model]
69+
"""
70+
testbed = loader.load(testbed)
71+
device = testbed.devices['router']
72+
device.connect(
73+
learn_hostname=True,
74+
init_config_commands=[],
75+
init_exec_commands=[]
76+
)
77+
# Make sure we have a unique Steps() object for result verification
78+
steps = Steps()
79+
80+
# And we want the following methods to be mocked to simulate the stage.
81+
change_boot_variable = ChangeBootVariable()
82+
83+
image = 'bootflash:/image.SSA.XYZ'
84+
85+
with self.assertLogs(level='INFO') as log:
86+
change_boot_variable(steps=steps, device=device, images=[image], current_running_image=True)
87+
self.assertIn("INFO:genie.libs.clean.stages.iosxe.stages:" +
88+
"Verifying next reload boot variables Using the running image due to 'current_running_image: True'",
89+
log.output)
90+
91+
# Check the results is as expected.
92+
self.assertEqual(Passed, steps.details[0].result)

0 commit comments

Comments
 (0)