-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Taarini Sarath Chander
committed
Sep 25, 2024
1 parent
1adfa6d
commit f3d07cb
Showing
233 changed files
with
7,824 additions
and
1,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +0,0 @@ | ||
-------------------------------------------------------------------------------- | ||
New | ||
-------------------------------------------------------------------------------- | ||
|
||
* iosxe | ||
* connect stage | ||
* add password recovery for connect stage. | ||
|
||
* clean-pkg | ||
* updated the default keep configuration | ||
|
||
|
||
-------------------------------------------------------------------------------- | ||
Fix | ||
-------------------------------------------------------------------------------- | ||
|
||
* iosxe | ||
* set controller mode stage | ||
* the stage is now working properly fix the issue with stage and reload stage | ||
* Modified install_image | ||
* Added new flag skip_save_running_config to skip the step to save the the running configuration to the startup config. | ||
|
||
* generic | ||
* Modified configure_management | ||
* Added `alias_as_hostname` argument | ||
* Allows user to use the alias as the device hostname | ||
|
||
|
||
6 changes: 6 additions & 0 deletions
6
...kg/changelog/changelog_modify_iosxe_ChangeBootVariable_stage_20240918204515.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-------------------------------------------------------------------------------- | ||
Fix | ||
-------------------------------------------------------------------------------- | ||
* IOSXE | ||
* Modified ChangeBootVariable: | ||
* Modified verify_boot_variable to verify next reload boot variables using running image if current_running_image is True |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
''' | ||
|
||
# metadata | ||
__version__ = '24.8' | ||
__version__ = '24.9' | ||
__author__ = 'Cisco Systems Inc.' | ||
__contact__ = ['[email protected]', '[email protected]'] | ||
__copyright__ = 'Copyright (c) 2019, Cisco Systems Inc.' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
143 changes: 143 additions & 0 deletions
143
...s/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/mock_data/iosxe/mock_data.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
connect: &connect | ||
preface: | | ||
Trying mock_device ... | ||
Connected to mock_device. | ||
Escape character is ''^]''. | ||
prompt: "%N#" | ||
|
||
change_boot_variable_1: | ||
<<: *connect | ||
commands: | ||
? '' | ||
: new_state: execute_1 | ||
|
||
execute_1: | ||
commands: | ||
show version | include operating mode: '' | ||
config term: | ||
new_state: configure_1 | ||
write memory: | | ||
Building configuration... | ||
[OK] | ||
show bootvar: | | ||
BOOT variable = bootflash:/image.SSA.XYZ,12; | ||
CONFIG_FILE variable = | ||
BOOTLDR variable does not exist | ||
Configuration register is 0x2102 | ||
Standby BOOT variable = bootflash:/image.SSA.XYZ,12; | ||
Standby CONFIG_FILE variable = | ||
Standby BOOTLDR variable does not exist | ||
Standby Configuration register is 0x2102 | ||
prompt: "%N#" | ||
|
||
configure_1: | ||
commands: | ||
no boot system: "" | ||
end: | ||
new_state: execute_1 | ||
line console: | ||
new_state: configure_line | ||
boot system bootflash:/image.SSA.XYZ: "" | ||
config-register 0x2102: "" | ||
prompt: "%N(config)#" | ||
|
||
change_boot_variable_2: | ||
<<: *connect | ||
commands: | ||
? '' | ||
: new_state: execute_2 | ||
|
||
execute_2: | ||
commands: | ||
show version | include operating mode: '' | ||
show version: | | ||
show version | ||
Cisco IOS XE Software, Version BLD_POLARIS_DEV_LATEST_20240916_114854 | ||
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] | ||
Copyright (c) 1986-2024 by Cisco Systems, Inc. | ||
Compiled Mon 16-Sep-24 05:40 by mcpre | ||
Cisco IOS-XE software, Copyright (c) 2005-2024 by cisco Systems, Inc. | ||
All rights reserved. Certain components of Cisco IOS-XE software are | ||
licensed under the GNU General Public License ("GPL") Version 2.0. The | ||
software code licensed under GPL Version 2.0 is free software that comes | ||
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such | ||
GPL code under the terms of GPL Version 2.0. For more details, see the | ||
documentation or "License Notice" file accompanying the IOS-XE software, | ||
or the applicable URL provided on the flyer accompanying the IOS-XE | ||
software. | ||
ROM: 17.3(1r) | ||
R2 uptime is 18 hours, 55 minutes | ||
Uptime for this control processor is 18 hours, 57 minutes | ||
System returned to ROM by Reload Command | ||
System image file is "harddisk:packages.conf" | ||
Last reload reason: Reload Command | ||
This product contains cryptographic features and is subject to United | ||
States and local country laws governing import, export, transfer and | ||
use. Delivery of Cisco cryptographic products does not imply | ||
third-party authority to import, export, distribute or use encryption. | ||
Importers, exporters, distributors and users are responsible for | ||
compliance with U.S. and local country laws. By using this product you | ||
agree to comply with applicable laws and regulations. If you are unable | ||
to comply with U.S. and local laws, return this product immediately. | ||
A summary of U.S. laws governing Cisco cryptographic products may be found at: | ||
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html | ||
If you require further assistance please contact us by sending email to | ||
[email protected]. | ||
License Type: Smart License is permanent | ||
License Level: advipservices | ||
Next reload license Level: advipservices | ||
Smart Licensing Status: Smart Licensing Using Policy | ||
cisco ASR1006-X (RP3) processor (revision RP3) with 4087430K/24590K bytes of memory. | ||
Processor board ID FXS2239Q329 | ||
Router operating mode: Autonomous | ||
20 Gigabit Ethernet interfaces | ||
2 Ten Gigabit Ethernet interfaces | ||
32768K bytes of non-volatile configuration memory. | ||
8388608K bytes of physical memory. | ||
7600127K bytes of eUSB flash at bootflash:. | ||
97620247K bytes of SATA hard disk at harddisk:. | ||
Configuration register is 0x2102 | ||
config term: | ||
new_state: configure_2 | ||
write memory: | | ||
Building configuration... | ||
[OK] | ||
show bootvar: | | ||
BOOT variable = harddisk:packages.conf,12; | ||
CONFIG_FILE variable = | ||
BOOTLDR variable does not exist | ||
Configuration register is 0x2102 | ||
Standby BOOT variable = harddisk:packages.conf,12; | ||
Standby CONFIG_FILE variable = | ||
Standby BOOTLDR variable does not exist | ||
Standby Configuration register is 0x2102 | ||
prompt: "%N#" | ||
|
||
configure_2: | ||
commands: | ||
no boot system: "" | ||
end: | ||
new_state: execute_2 | ||
line console: | ||
new_state: configure_line | ||
boot system harddisk:packages.conf: "" | ||
config-register 0x2102: "" | ||
prompt: "%N(config)#" |
92 changes: 92 additions & 0 deletions
92
...ibs/clean/stages/iosxe/asr1k/tests/test_change_boot_variable/test_change_boot_variable.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import unittest | ||
|
||
from pyats.results import Passed | ||
from pyats.topology import loader | ||
from pyats.aetest.steps import Steps | ||
|
||
from genie.libs.clean.stages.iosxe.stages import ChangeBootVariable | ||
|
||
|
||
class TestChangeBootVariable1(unittest.TestCase): | ||
""" Run unit testing on a mocked IOSXE asr1k device """ | ||
|
||
def test_change_boot_variable_pass(self): | ||
testbed = """ | ||
devices: | ||
router: | ||
connections: | ||
defaults: | ||
class: unicon.Unicon | ||
a: | ||
command: mock_device_cli --os iosxe --mock_data_dir mock_data --state change_boot_variable_1 | ||
protocol: unknown | ||
os: iosxe | ||
platform: asr1k | ||
model: ASR1001-HX | ||
type: router | ||
custom: | ||
abstraction: | ||
order: [os, platform, model] | ||
""" | ||
testbed = loader.load(testbed) | ||
device = testbed.devices['router'] | ||
device.connect( | ||
learn_hostname=True, | ||
init_config_commands=[], | ||
init_exec_commands=[] | ||
) | ||
|
||
# Make sure we have a unique Steps() object for result verification | ||
steps = Steps() | ||
|
||
# And we want the following methods to be mocked to simulate the stage. | ||
change_boot_variable = ChangeBootVariable() | ||
|
||
image = 'bootflash:/image.SSA.XYZ' | ||
|
||
change_boot_variable(steps=steps, device=device, images=[image]) | ||
|
||
# Check the results is as expected. | ||
self.assertEqual(Passed, steps.details[0].result) | ||
|
||
def test_change_boot_variable_with_current_running_image(self): | ||
testbed = """ | ||
devices: | ||
router: | ||
connections: | ||
defaults: | ||
class: unicon.Unicon | ||
a: | ||
command: mock_device_cli --os iosxe --mock_data_dir mock_data --state change_boot_variable_2 | ||
protocol: unknown | ||
os: iosxe | ||
platform: asr1k | ||
model: ASR1001-HX | ||
type: router | ||
custom: | ||
abstraction: | ||
order: [os, platform, model] | ||
""" | ||
testbed = loader.load(testbed) | ||
device = testbed.devices['router'] | ||
device.connect( | ||
learn_hostname=True, | ||
init_config_commands=[], | ||
init_exec_commands=[] | ||
) | ||
# Make sure we have a unique Steps() object for result verification | ||
steps = Steps() | ||
|
||
# And we want the following methods to be mocked to simulate the stage. | ||
change_boot_variable = ChangeBootVariable() | ||
|
||
image = 'bootflash:/image.SSA.XYZ' | ||
|
||
with self.assertLogs(level='INFO') as log: | ||
change_boot_variable(steps=steps, device=device, images=[image], current_running_image=True) | ||
self.assertIn("INFO:genie.libs.clean.stages.iosxe.stages:" + | ||
"Verifying next reload boot variables Using the running image due to 'current_running_image: True'", | ||
log.output) | ||
|
||
# Check the results is as expected. | ||
self.assertEqual(Passed, steps.details[0].result) |
Oops, something went wrong.