-
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.
Merge pull request #151 from CiscoTestAutomation/release_24.1
Release 24.1
- Loading branch information
Showing
156 changed files
with
5,280 additions
and
1,030 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-------------------------------------------------------------------------------- | ||
Fix | ||
-------------------------------------------------------------------------------- | ||
|
||
* iosxe | ||
* Modified copy_to_device clean stage, update logic for image mapping when image is already loaded | ||
|
||
|
||
-------------------------------------------------------------------------------- | ||
New | ||
-------------------------------------------------------------------------------- | ||
|
||
* cheetah | ||
* Added LoadApImage | ||
* Added new clean stage load_ap_image | ||
|
||
* stages/iosxe | ||
* Updated connect stage to support rommon boot | ||
|
||
* iosxe | ||
* Added configure_type_access_list_action | ||
* API to configure ip/mac access-list with permission | ||
|
||
|
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
''' | ||
|
||
# metadata | ||
__version__ = '23.11' | ||
__version__ = '24.1' | ||
__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
44 changes: 44 additions & 0 deletions
44
pkgs/clean-pkg/src/genie/libs/clean/stages/cheetah/ap/image_handler.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,44 @@ | ||
"""Cheetah/AP Image Handler Class""" | ||
|
||
from genie.libs.clean.stages.iosxe.image_handler import ImageHandler as IosxeImageHandler | ||
from pyats.utils.fileutils import FileUtils | ||
|
||
|
||
class ImageHandler(IosxeImageHandler): | ||
|
||
def __init__(self, device, images, *args, **kwargs): | ||
super().__init__(device, images, *args, **kwargs) | ||
|
||
def update_image_references(self, section): | ||
# section.parameters['image_mapping'] shall be saved in any | ||
# stage that modifies the image name/path | ||
if 'image_mapping' in section.parameters: | ||
|
||
for index, image in enumerate(self.image): | ||
# change the saved image to the new image name/path | ||
self.image[index] = section.parameters['image_mapping'].get(image, image) | ||
|
||
def update_stamp_ap_image(self, number=''): | ||
"""Update clean section 'stamp_ap_image' with image information""" | ||
stamp_ap_image = self.device.clean.setdefault('stamp_ap_image' + number, {}) | ||
if self.override_stage_images: | ||
stamp_ap_image.update({'ap_image_path': self.image[0]}) | ||
else: | ||
stamp_ap_image.setdefault('ap_image_path', self.image[0]) | ||
|
||
def update_copy_to_linux(self, number=''): | ||
"""Update clean section 'copy_to_linux' with image information""" | ||
files = self.device.clean.setdefault('copy_to_linux' + number, {}). \ | ||
setdefault('origin', {}).setdefault('files', []) | ||
files.clear() | ||
files.extend(self.image) | ||
|
||
def update_load_ap_image(self, number=''): | ||
"""Update clean section 'load_ap_image' with image information""" | ||
load_ap_image = self.device.clean.setdefault('load_ap_image' + number, {}) | ||
if self.override_stage_images: | ||
load_ap_image.update({'ap_image_path': self.image[0]}) | ||
else: | ||
load_ap_image.setdefault('ap_image_path', self.image[0]) | ||
|
||
|
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
52 changes: 52 additions & 0 deletions
52
...pkg/src/genie/libs/clean/stages/cheetah/ap/tests/test_load_ap_image/test_load_ap_image.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,52 @@ | ||
import logging | ||
import unittest | ||
from unittest.mock import patch, Mock | ||
|
||
|
||
from genie.libs.clean.stages.tests.utils import create_test_device | ||
|
||
from pyats.aetest.steps import Steps | ||
from pyats.topology import loader | ||
|
||
|
||
# Disable logging. It may be useful to comment this out when developing tests. | ||
logging.disable(logging.CRITICAL) | ||
|
||
|
||
class TestLoadApImage(unittest.TestCase): | ||
|
||
def setUp(self): | ||
# Instantiate class object | ||
|
||
self.steps = Steps() | ||
|
||
# Instantiate device object. This also sets up commonly needed | ||
# attributes and Mock objects associated with the device. | ||
self.device = create_test_device('AP4001.7AB2.C1B6', os='cheetah', platform='ap') | ||
self.device.testbed = loader.load({}) | ||
self.device.testbed.servers = { | ||
"credentials": { | ||
"default": { | ||
"username": "username", | ||
"password": "password" | ||
} | ||
}, | ||
"address": "1.1.1.1", | ||
"protocol": "tftp", | ||
"custom": { | ||
"collection_upload_server": "tftp" | ||
} | ||
} | ||
self.device.api.execute_archive_download = Mock() | ||
|
||
@patch('pyats.utils.fileutils.FileUtils') | ||
def test_load_image(self, mock_file_utils): | ||
# need to import here because we are mocking the pyats.cli.utils.cmd function | ||
from genie.libs.clean.stages.cheetah.ap.stages import LoadApImage | ||
|
||
self.cls = LoadApImage() | ||
|
||
fu_instance = mock_file_utils.return_value | ||
fu_instance.get_auth.return_value = ('username', 'password') | ||
self.cls.load_image(self.device, self.steps, "/path/to/ap_image_path", self.device.testbed.servers) | ||
self.device.api.execute_archive_download.assert_called_once() |
Oops, something went wrong.