From a6099ee728cdfe6a535135ee4feb13777b5c6d88 Mon Sep 17 00:00:00 2001 From: guay Date: Mon, 30 Jan 2023 12:23:32 -0600 Subject: [PATCH 1/3] Add +!* pattern in check_config_mode --- netmiko/nokia/nokia_srl.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/netmiko/nokia/nokia_srl.py b/netmiko/nokia/nokia_srl.py index 781467aeb..6794268d3 100644 --- a/netmiko/nokia/nokia_srl.py +++ b/netmiko/nokia/nokia_srl.py @@ -79,7 +79,7 @@ def config_mode( def check_config_mode( self, - check_string: str = r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* )candidate", + check_string: str = r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* )candidate", pattern: str = r"#", force_regex: bool = True, ) -> bool: @@ -161,5 +161,7 @@ def _has_uncommitted_changes(self, prompt: str) -> bool: The exclamation mark (!) in the prompt indicates that another user has commited changes to the running datastore. """ - matches = re.search(r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* )candidate", prompt) + matches = re.search( + r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* )candidate", prompt + ) return True if matches and "*" in matches.group() else False From 4793ce58f68c13e88d14b6b7381fa4135ce0598a Mon Sep 17 00:00:00 2001 From: guay Date: Tue, 31 Jan 2023 11:30:04 -0600 Subject: [PATCH 2/3] Add +! in check_config_mode --- netmiko/nokia/nokia_srl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netmiko/nokia/nokia_srl.py b/netmiko/nokia/nokia_srl.py index 6794268d3..930e7ced0 100644 --- a/netmiko/nokia/nokia_srl.py +++ b/netmiko/nokia/nokia_srl.py @@ -79,7 +79,7 @@ def config_mode( def check_config_mode( self, - check_string: str = r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* )candidate", + check_string: str = r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* | \+\! )candidate", pattern: str = r"#", force_regex: bool = True, ) -> bool: @@ -162,6 +162,6 @@ def _has_uncommitted_changes(self, prompt: str) -> bool: changes to the running datastore. """ matches = re.search( - r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* )candidate", prompt + r"\n--{( | \* | \+ | \+\* | \!\+ | \!\* | \+\!\* | \+\! )candidate", prompt ) return True if matches and "*" in matches.group() else False From b943599fb389ff026404927ff4708fa0ff0eb3f2 Mon Sep 17 00:00:00 2001 From: guay Date: Wed, 28 Jun 2023 11:57:27 -0500 Subject: [PATCH 3/3] Fix nokia srl test --- tests/etc/test_devices.yml.example | 1 + tests/test_nokia_srl/README.md | 2 +- tests/test_nokia_srl/test_srl.sh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 tests/test_nokia_srl/test_srl.sh diff --git a/tests/etc/test_devices.yml.example b/tests/etc/test_devices.yml.example index 70839d115..f365b9583 100644 --- a/tests/etc/test_devices.yml.example +++ b/tests/etc/test_devices.yml.example @@ -269,6 +269,7 @@ nokia_srl: ip: clab-srltest-srl1 username: admin password: 'admin' + use_keys: "True" audiocode_72: device_type: audiocode_72 diff --git a/tests/test_nokia_srl/README.md b/tests/test_nokia_srl/README.md index f90c599be..c273b135d 100644 --- a/tests/test_nokia_srl/README.md +++ b/tests/test_nokia_srl/README.md @@ -15,7 +15,7 @@ The containerlab node hostname is clab-srltest-srl1. ## Run the test ``` -sudo sh test_srl.sh +./test_srl.sh ``` ## Destroy containerlab Node diff --git a/tests/test_nokia_srl/test_srl.sh b/tests/test_nokia_srl/test_srl.sh old mode 100644 new mode 100755 index 7e00f17e6..fdc4900c7 --- a/tests/test_nokia_srl/test_srl.sh +++ b/tests/test_nokia_srl/test_srl.sh @@ -5,8 +5,8 @@ RETURN_CODE=0 echo "Starting tests...:" \ && echo "Nokia SR Linux" \ && cd .. \ -&& py.test -s -x -v test_netmiko_show.py --test_device nokia_srl \ -&& py.test -s -x -v test_netmiko_config.py --test_device nokia_srl \ +&& pytest -s -x -v test_netmiko_show.py --test_device nokia_srl \ +&& pytest -s -x -v test_netmiko_config.py --test_device nokia_srl \ || RETURN_CODE=1 exit $RETURN_CODE