summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_nxapi/tests/cli
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/nxos_nxapi/tests/cli')
-rw-r--r--test/integration/targets/nxos_nxapi/tests/cli/configure.yaml141
-rw-r--r--test/integration/targets/nxos_nxapi/tests/cli/disable.yaml31
-rw-r--r--test/integration/targets/nxos_nxapi/tests/cli/enable.yaml34
-rw-r--r--test/integration/targets/nxos_nxapi/tests/cli/nxapi_ssl.yaml246
4 files changed, 0 insertions, 452 deletions
diff --git a/test/integration/targets/nxos_nxapi/tests/cli/configure.yaml b/test/integration/targets/nxos_nxapi/tests/cli/configure.yaml
deleted file mode 100644
index d5bac17d49..0000000000
--- a/test/integration/targets/nxos_nxapi/tests/cli/configure.yaml
+++ /dev/null
@@ -1,141 +0,0 @@
----
-- debug: msg="START cli/configure.yaml"
-
-- set_fact: nxapi_sandbox_option="yes"
- when: platform is search('N7K')
-
-- name: Setup - put NXAPI in stopped state
- nxos_nxapi:
- state: absent
-
-- block:
- - name: Configure NXAPI HTTPS
- nxos_nxapi: &configure_https
- enable_http: no
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- enable_https: yes
- https_port: 9443
- register: result
-
- - nxos_command:
- commands:
- - show nxapi | json
- register: result
-
- - include: tasks/platform/n7k/assert_changes_https.yaml
- when: platform is match('N7K')
-
- - include: tasks/platform/n5k/assert_changes_https.yaml
- when: platform is search('N5K|N6K')
-
- - include: tasks/platform/default/assert_changes_https.yaml
- when: platform is not search('N35|N5K|N6K|N7K')
-
- - name: Configure NXAPI HTTPS again
- nxos_nxapi: *configure_https
- register: result
-
- - name: Assert configuration is idempotent
- assert: &assert_false
- that:
- - result.changed == false
-
- - name: Configure NXAPI HTTPS & HTTP
- nxos_nxapi: &configure_https_http
- enable_http: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- enable_https: yes
- https_port: 9443
- register: result
-
- - nxos_command:
- commands:
- - show nxapi | json
- register: result
-
- - include: tasks/platform/n7k/assert_changes_https_http.yaml
- when: platform is match('N7K')
-
- - include: tasks/platform/n5k/assert_changes_https_http.yaml
- when: platform is match('N5K')
-
- - include: tasks/platform/default/assert_changes_https_http.yaml
- when: platform is not search('N35|N5K|N6K|N7K')
-
- - name: Configure NXAPI HTTPS & HTTP again
- nxos_nxapi: *configure_https_http
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure different NXAPI HTTPS & HTTP ports
- nxos_nxapi: &configure_https_http_ports
- enable_http: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- enable_https: yes
- http_port: 99
- https_port: 500
- register: result
-
- - nxos_command:
- commands:
- - show nxapi | json
- register: result
-
- - include: tasks/platform/n7k/assert_changes_https_http_ports.yaml
- when: platform is match('N7K')
-
- - include: tasks/platform/n5k/assert_changes_https_http_ports.yaml
- when: platform is match('N5K')
-
- - include: tasks/platform/default/assert_changes_https_http_ports.yaml
- when: platform is not search('N35|N5K|N6K|N7K')
-
- - name: Configure different NXAPI HTTPS & HTTP ports again
- nxos_nxapi: *configure_https_http_ports
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTP
- nxos_nxapi: &configure_http
- enable_http: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- enable_https: no
- register: result
-
- - nxos_command:
- commands:
- - show nxapi | json
- register: result
-
- - include: tasks/platform/n7k/assert_changes_http.yaml
- when: platform is match('N7K')
-
- - include: tasks/platform/n5k/assert_changes_http.yaml
- when: platform is match('N5K')
-
- - include: tasks/platform/default/assert_changes_http.yaml
- when: platform is not search('N35|N5K|N6K|N7K')
-
- - name: Configure NXAPI HTTP again
- nxos_nxapi: *configure_http
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- always:
- - name: Cleanup - Disable NXAPI
- nxos_nxapi:
- state: absent
- register: result
-
- - name: Cleanup - Re-enable NXAPI
- nxos_nxapi:
- state: present
- register: result
-
- - debug: msg="END cli/configure.yaml"
diff --git a/test/integration/targets/nxos_nxapi/tests/cli/disable.yaml b/test/integration/targets/nxos_nxapi/tests/cli/disable.yaml
deleted file mode 100644
index 58ce878bed..0000000000
--- a/test/integration/targets/nxos_nxapi/tests/cli/disable.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
----
-- debug: msg="START cli/disable.yaml"
-
-- name: Disable NXAPI
- nxos_nxapi:
- state: absent
- register: result
-
-- name: Check NXAPI state
- nxos_command:
- commands:
- - show feature | grep nxapi
- register: result
-
-- name: Assert NXAPI is disabled
- assert:
- that:
- result.stdout[0] is search('disabled')
-
-- name: Disable NXAPI again
- nxos_nxapi:
- state:
- absent
- register: result
-
-- name: Assert idempotence
- assert:
- that:
- result.changed == false
-
-- debug: msg="END cli/disable.yaml"
diff --git a/test/integration/targets/nxos_nxapi/tests/cli/enable.yaml b/test/integration/targets/nxos_nxapi/tests/cli/enable.yaml
deleted file mode 100644
index f15bfe9c3f..0000000000
--- a/test/integration/targets/nxos_nxapi/tests/cli/enable.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
----
-- debug: msg="START cli/enable.yaml"
-
-- name: Setup - put NXAPI in stopped state
- nxos_nxapi:
- state: absent
- register: result
-
-- name: Enable NXAPI
- nxos_nxapi:
- state: present
- register: result
-
-- name: Check NXAPI state
- nxos_command:
- commands:
- - show feature | grep nxapi
- register: result
-
-- name: Assert NXAPI is enabled
- assert:
- that: result.stdout[0] is search('enabled')
-
-- name: Enable NXAPI again
- nxos_nxapi:
- register: result
-
-- name: Assert idempotence
- assert:
- that:
- result.changed == false
-
-
-- debug: msg="END cli/enable.yaml"
diff --git a/test/integration/targets/nxos_nxapi/tests/cli/nxapi_ssl.yaml b/test/integration/targets/nxos_nxapi/tests/cli/nxapi_ssl.yaml
deleted file mode 100644
index eeace84f95..0000000000
--- a/test/integration/targets/nxos_nxapi/tests/cli/nxapi_ssl.yaml
+++ /dev/null
@@ -1,246 +0,0 @@
----
-- block:
- - debug: msg="START cli/nxapi_ssl.yaml"
-
- - name: Configure NXAPI HTTPs w/weak ciphers
- nxos_nxapi: &configure_https_weak_ciphers
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- ssl_strong_ciphers: no
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc ciphers
- register: result
-
- - name: Assert weak ciphers configuration
- assert: &weak_ciphers
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl ciphers weak'
-
- - name: Configure NXAPI HTTP w/weak ciphers again
- nxos_nxapi: *configure_https_weak_ciphers
- register: result
-
- - name: Assert configuration is idempotent
- assert: &assert_false
- that:
- - result.changed == false
-
- - name: Configure NXAPI HTTPs w/strong ciphers
- nxos_nxapi: &configure_https_strong_ciphers
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- ssl_strong_ciphers: yes
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc ciphers
- register: result
-
- - name: Assert strong ciphers configuration
- assert: &strong_ciphers
- that:
- - result.stdout_lines[0][0] == 'no nxapi ssl ciphers weak'
-
- - name: Configure NXAPI HTTPs w/strong ciphers again
- nxos_nxapi: *configure_https_strong_ciphers
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTPs w/default TLSv1
- nxos_nxapi: &configure_https_default
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc protocols
- register: result
-
- - name: Assert NXAPI HTTPs w/default TLSv1 configuration
- assert: &default_configuration
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl protocols TLSv1'
-
- - name: Configure NXAPI HTTPs w/default again
- nxos_nxapi: *configure_https_default
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTPs TLSv1.1 -default TLSv1
- nxos_nxapi: &configure_https_tlsv1_1
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- tlsv1_1: yes
- tlsv1_0: no
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc protocols
- register: result
-
- - name: Assert NXAPI HTTPs w/TLSv1.1 configuration
- assert: &tlsv1_1_configuration
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl protocols TLSv1.1'
-
- - name: Configure NXAPI HTTPs w/TLSv1.1 -default TLSv1 again
- nxos_nxapi: *configure_https_tlsv1_1
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTPs TLSv1.2 -default TLSv1
- nxos_nxapi: &configure_https_tlsv1_2
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- tlsv1_2: yes
- tlsv1_0: no
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc protocols
- register: result
-
- - name: Assert NXAPI HTTPs w/TLSv1.2 configuration
- assert: &tlsv1_2_configuration
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl protocols TLSv1.2'
-
- - name: Configure NXAPI HTTPs w/TLSv1.2 -default TLSv1 again
- nxos_nxapi: *configure_https_tlsv1_2
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTPs w/TLS1.2 +default TLSv1
- nxos_nxapi: &configure_https_tlsv1_2_default
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- ssl_strong_ciphers: yes
- tlsv1_2: yes
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc protocols
- register: result
-
- - name: Assert NXAPI HTTPs w/TLS1.2 +default TLSv1 configuration
- assert: &tlsv1_2_default_configuration
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl protocols TLSv1 TLSv1.2'
-
- - name: Configure NXAPI HTTPs w/TLS1.2 again
- nxos_nxapi: *configure_https_tlsv1_2_default
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTPs w/TLS1.2 TLS1.1 -default TLSv1
- nxos_nxapi: &configure_https_tlsv1_2_tlsv1_1
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- ssl_strong_ciphers: yes
- tlsv1_0: no
- tlsv1_1: yes
- tlsv1_2: yes
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc protocols
- register: result
-
- - name: Assert NXAPI HTTPs w/TLS1.2 TLS1.2 -default TLSv1 configuration
- assert: &tlsv1_2_tlsv1_1_configuration
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl protocols TLSv1.1 TLSv1.2'
-
- - name: Configure NXAPI HTTPs w/TLS1.2 TLS1.1 -default TLSv1 again
- nxos_nxapi: *configure_https_tlsv1_2_tlsv1_1
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTPs w/TLS1.2 TLS1.1 +default TLSv1
- nxos_nxapi: &configure_https_tlsv1_2_tlsv1_1_default
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- ssl_strong_ciphers: yes
- tlsv1_1: yes
- tlsv1_2: yes
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc protocols
- register: result
-
- - name: Assert NXAPI HTTPs w/TLS1.2 TLS1.1 +default TLSv1 configuration
- assert: &tlsv1_2_tlsv1_1_default_configuration
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl protocols TLSv1 TLSv1.1 TLSv1.2'
-
- - name: Configure NXAPI HTTPs w/TLS1.2 TLS1.1 +default TLSv1 again
- nxos_nxapi: *configure_https_tlsv1_2_tlsv1_1_default
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- - name: Configure NXAPI HTTPs with explicit TLS1.2 TLS1.1 TLSv1
- nxos_nxapi: &configure_https_tlsv1_2_tlsv1_1_tlsv1_0
- enable_https: yes
- enable_sandbox: "{{nxapi_sandbox_option|default(omit)}}"
- ssl_strong_ciphers: yes
- tlsv1_0: yes
- tlsv1_1: yes
- tlsv1_2: yes
- register: result
-
- - nxos_command:
- commands:
- - show run all | inc nxapi | inc protocols
- register: result
-
- - name: Assert NXAPI HTTPs w/TLS1.2 TLS1.2 TLSv1 configuration
- assert: &tlsv1_2_tlsv1_1_tlsv1_0_configuration
- that:
- - result.stdout_lines[0][0] == 'nxapi ssl protocols TLSv1 TLSv1.1 TLSv1.2'
-
- - name: Configure NXAPI HTTPs w/TLS1.2 TLS1.1 TLSv1 again
- nxos_nxapi: *configure_https_tlsv1_2_tlsv1_1_tlsv1_0
- register: result
-
- - name: Assert configuration is idempotent
- assert: *assert_false
-
- always:
- - name: Cleanup - Disable NXAPI
- nxos_nxapi:
- state: absent
- register: result
-
- - name: Cleanup - Re-enable NXAPI
- nxos_nxapi:
- state: present
- register: result
-
- - debug: msg="END cli/nxapi_ssl.yaml"
-
- when: (platform is match("N9K") or platform is match("N3K") or platform is match("N9K-F") or platform is match("N35") or platform is match("N3L")) and major_version is version('9.2', '>=')