forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/fix nxos_nxapi to use show run (ansible#28675)
* Refactor/fix nxos_nxapi to use show run * Fix unit tests * Python 3 compatibility
- Loading branch information
Showing
11 changed files
with
45 additions
and
24 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,2 +1,4 @@ | ||
--- | ||
# Only cli tests for this module since cli is used | ||
# to test nxapi | ||
- { include: cli.yaml, tags: ['cli'] } |
7 changes: 7 additions & 0 deletions
7
test/integration/targets/nxos_nxapi/tasks/platform/default/assert_changes.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,7 @@ | ||
--- | ||
- name: Assert configuration changes | ||
assert: | ||
that: | ||
- result.stdout[0]['TABLE_listen_on_port']['ROW_listen_on_port'].l_port | ||
- result.stdout[0]['TABLE_listen_on_port']['ROW_listen_on_port'].l_port | string | search("9443") | ||
- result.stdout[0]['operation_status'].o_status == 'nxapi enabled' |
7 changes: 7 additions & 0 deletions
7
test/integration/targets/nxos_nxapi/tasks/platform/n7k/assert_changes.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,7 @@ | ||
--- | ||
- name: Assert configuration changes | ||
assert: | ||
that: | ||
- result.stdout[0].http_port is not defined | ||
- result.stdout[0].https_port | string | search("9443") | ||
- result.stdout[0].sandbox_status == 'Enabled' |
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
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
- name: Enable NXAPI | ||
nxos_nxapi: | ||
state: started | ||
state: present | ||
provider: "{{ cli }}" | ||
register: result | ||
|
||
|
2 changes: 0 additions & 2 deletions
2
test/units/modules/network/nxos/fixtures/nxos_nxapi/n3k/show_nxapi
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
test/units/modules/network/nxos/fixtures/nxos_nxapi/n3k/show_run_all
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,2 @@ | ||
feature nxapi | ||
nxapi http port 80 |
4 changes: 0 additions & 4 deletions
4
test/units/modules/network/nxos/fixtures/nxos_nxapi/n7k/show_nxapi
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
test/units/modules/network/nxos/fixtures/nxos_nxapi/n7k/show_run_all
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,5 @@ | ||
feature nxapi | ||
nxapi http port 80 | ||
no nxapi https | ||
no nxapi sandbox | ||
|