summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_interface/tests
diff options
context:
space:
mode:
authorAnsible Core Team <info@ansible.com>2020-03-09 09:40:35 +0000
committerAnsible Core Team <info@ansible.com>2020-03-09 09:40:35 +0000
commitecd1907190ce9d7d744548227a47d3827ce3ab65 (patch)
tree71f94fa4ed330319cf9152971d49841d8aeb9b4c /test/integration/targets/nxos_interface/tests
parente39b1dec45fe86210b669d6b1b117753b5b2c9f9 (diff)
downloadansible-ecd1907190ce9d7d744548227a47d3827ce3ab65.tar.gz
Migrated to cisco.nxos
Diffstat (limited to 'test/integration/targets/nxos_interface/tests')
-rw-r--r--test/integration/targets/nxos_interface/tests/common/intent.yaml63
-rw-r--r--test/integration/targets/nxos_interface/tests/common/sanity.yaml117
-rw-r--r--test/integration/targets/nxos_interface/tests/common/set_state_absent.yaml29
-rw-r--r--test/integration/targets/nxos_interface/tests/common/set_state_present.yaml32
-rw-r--r--test/integration/targets/nxos_interface/tests/common/sub_int.yaml73
5 files changed, 0 insertions, 314 deletions
diff --git a/test/integration/targets/nxos_interface/tests/common/intent.yaml b/test/integration/targets/nxos_interface/tests/common/intent.yaml
deleted file mode 100644
index b3c0f42fb3..0000000000
--- a/test/integration/targets/nxos_interface/tests/common/intent.yaml
+++ /dev/null
@@ -1,63 +0,0 @@
-- debug: msg="START connection={{ ansible_connection }} nxos_interface intent test"
-
-- set_fact: testint1="{{ nxos_int1 }}"
-- set_fact: testint2="{{ nxos_int2 }}"
-
-- name: "Setup: Put interfaces into a default state"
- nxos_config:
- lines:
- - "default interface {{ testint1 }}"
- - "default interface {{ testint2 }}"
- ignore_errors: yes
-
-- name: Check intent arguments
- nxos_interface:
- name: "{{ testint2 }}"
- admin_state: up
- tx_rate: ge(0)
- rx_rate: ge(0)
- register: result
-
-- assert:
- that:
- - "result.failed == false"
-
-- name: "Clear interface {{ testint2 }} counters before next task"
- nxos_command:
- commands: "clear counters interface {{ testint2 }}"
- ignore_errors: yes
-
-- name: Check intent arguments (failed condition)
- nxos_interface:
- name: "{{ testint2 }}"
- admin_state: down
- tx_rate: gt(10000)
- rx_rate: lt(0)
- ignore_errors: yes
- register: result
-
-- assert:
- that:
- - "result.failed == true"
- - "'tx_rate gt(10000)' in result.failed_conditions"
- - "'rx_rate lt(0)' in result.failed_conditions"
-
-- name: aggregate definition of interface
- nxos_interface:
- aggregate:
- - { name: "{{ testint1 }}", description: "Test aggregation on first interface" }
- - { name: "{{ testint2 }}", mode: layer3 }
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: "TearDown: Put interfaces into a default state"
- nxos_config:
- lines:
- - "default interface {{ testint1 }}"
- - "default interface {{ testint2 }}"
- ignore_errors: yes
-
-- debug: msg="END connection={{ ansible_connection }} nxos_interface intent test"
diff --git a/test/integration/targets/nxos_interface/tests/common/sanity.yaml b/test/integration/targets/nxos_interface/tests/common/sanity.yaml
deleted file mode 100644
index 3151152eb0..0000000000
--- a/test/integration/targets/nxos_interface/tests/common/sanity.yaml
+++ /dev/null
@@ -1,117 +0,0 @@
----
-- debug: msg="START connection={{ ansible_connection }} nxos_interface sanity test"
-
-- set_fact: testint="{{ nxos_int1 }}"
-
-- name: "Setup: Enable feature interface-vlan"
- nxos_feature:
- feature: interface-vlan
- state: enabled
- ignore_errors: yes
-
-- name: "Setup: Put interface {{ testint }} into a default state"
- nxos_config: &intcleanup
- lines:
- - "default interface {{ testint }}"
- ignore_errors: yes
-
-- name: "Setup: Remove possibly existing vlan interfaces"
- nxos_config: &vlanintcleanup
- lines:
- - "no interface vlan 2"
- - "no interface vlan 710"
- - "no interface vlan 711"
- - "no interface vlan 712"
- ignore_errors: yes
-
-- block:
- - name: "Configure layer3 params"
- nxos_interface: &l3config
- interface: "{{ testint }}"
- mode: layer3
- description: 'Configured by Ansible - Layer3'
- admin_state: up
- state: present
- register: result
-
- - assert: &true
- that:
- - "result.changed == true"
-
- - name: "Check Idempotence"
- nxos_interface: *l3config
- register: result
-
- - assert: &false
- that:
- - "result.changed == false"
-
- - name: "Configure layer2 params"
- nxos_interface: &l2config
- interface: "{{ testint }}"
- mode: layer2
- description: 'Configured by Ansible - Layer2'
- admin_state: down
- state: present
- register: result
-
- - assert: *true
-
- - name: "Check Idempotence"
- nxos_interface: *l2config
- register: result
-
- - assert: *false
-
- - name: Create VLAN Interfaces
- nxos_interface: &createvlans
- interface: "{{ item.os_svi_int }}"
- description: "{{ item.os_svi_desc }}"
- with_items: &vlanitems
- - {os_svi_int: vlan2, os_svi_desc: SVI_VLAN2}
- - {os_svi_int: vlan710, os_svi_desc: SVI_VLAN710}
- - {os_svi_int: vlan711, os_svi_desc: SVI_VLAN711}
- - {os_svi_int: vlan712, os_svi_desc: SVI_VLAN712}
- register: result
-
- - assert: *true
-
- - name: Configure Required SVI
- nxos_l3_interface: &addips
- aggregate:
- - {name: vlan2, ipv4: 192.168.2.1/24}
- - {name: vlan710, ipv4: 192.168.3.1/24}
- - {name: vlan711, ipv4: 192.168.4.1/24}
- - {name: vlan712, ipv4: 192.168.5.1/24}
- register: result
-
- - assert: *true
-
- - name: Create VLAN Interfaces Idempotence Check
- nxos_interface: *createvlans
- with_items: *vlanitems
- register: result
-
- - assert: *false
-
- - name: Configure Required SVI Idempotence Check
- nxos_l3_interface: *addips
- register: result
-
- - assert: *false
-
- always:
- - name: "Set interface back to default"
- nxos_config: *intcleanup
- ignore_errors: yes
-
- - name: "Remove vlan interfaces"
- nxos_config: *vlanintcleanup
-
- - name: "Setup: Disable feature interface-vlan"
- nxos_feature:
- feature: interface-vlan
- state: disabled
- ignore_errors: yes
-
- - debug: msg="END connection={{ ansible_connection }} nxos_interface sanity test"
diff --git a/test/integration/targets/nxos_interface/tests/common/set_state_absent.yaml b/test/integration/targets/nxos_interface/tests/common/set_state_absent.yaml
deleted file mode 100644
index 06b06671ea..0000000000
--- a/test/integration/targets/nxos_interface/tests/common/set_state_absent.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
----
-- debug: msg="START connection={{ ansible_connection }}/set_state_absent.yaml"
-
-- name: setup
- nxos_config:
- lines:
- - interface Loopback1
-
-- name: set state=absent
- nxos_interface:
- interface: Loopback1
- state: absent
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: verify state=absent
- nxos_interface:
- interface: Loopback1
- state: absent
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- debug: msg="END connection={{ ansible_connection }}/set_state_absent.yaml"
diff --git a/test/integration/targets/nxos_interface/tests/common/set_state_present.yaml b/test/integration/targets/nxos_interface/tests/common/set_state_present.yaml
deleted file mode 100644
index ff2bf8c232..0000000000
--- a/test/integration/targets/nxos_interface/tests/common/set_state_present.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-- debug: msg="START connection={{ ansible_connection }}/set_state_present.yaml"
-
-- name: setup
- nxos_config:
- lines:
- - no interface Loopback1
- ignore_errors: yes # Fails if the interface is already absent
-
-- name: set state=present
- nxos_interface:
- interface: Loopback1
- state: present
- description: 'Configured by Ansible - Layer3'
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: verify state=present
- nxos_interface:
- interface: Loopback1
- state: present
- description: 'Configured by Ansible - Layer3'
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- debug: msg="END connection={{ ansible_connection }}/set_state_present.yaml"
diff --git a/test/integration/targets/nxos_interface/tests/common/sub_int.yaml b/test/integration/targets/nxos_interface/tests/common/sub_int.yaml
deleted file mode 100644
index 16d7fa6028..0000000000
--- a/test/integration/targets/nxos_interface/tests/common/sub_int.yaml
+++ /dev/null
@@ -1,73 +0,0 @@
----
-- debug: msg="START connection={{ ansible_connection }} nxos_interface sub-interface test"
-
-- set_fact: testint="{{ nxos_int1 }}"
-
-- name: Setup - delete sub-interface
- nxos_interface: &rm
- name: "{{ testint }}.20"
- state: absent
- ignore_errors: yes
-
-- name: Setup - Ensure the interface is layer3
- nxos_interface:
- name: "{{ testint }}"
- mode: layer3
-
-- name: Create sub-interface
- nxos_interface: &sub_int
- name: "{{ testint }}.20"
- description: "sub-interface Configured by Ansible"
- admin_state: up
- mtu: 800
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Create sub-interface (Idempotence)
- nxos_interface: *sub_int
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: Make admin_state down
- nxos_interface: &state_down
- name: "{{ testint }}.20"
- description: "sub-interface Configured by Ansible"
- admin_state: down
- mtu: 800
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Create sub-interface (Idempotence)
- nxos_interface: *state_down
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: Remove sub-interface
- nxos_interface: *rm
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Remove sub-interface (Idempotence)
- nxos_interface: *rm
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- debug: msg="END connection={{ ansible_connection }} nxos_interface sub-interface test"