summaryrefslogtreecommitdiff
path: root/test/integration/targets/junos_l2_interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/junos_l2_interfaces')
-rw-r--r--test/integration/targets/junos_l2_interfaces/defaults/main.yaml3
-rw-r--r--test/integration/targets/junos_l2_interfaces/meta/main.yaml2
-rw-r--r--test/integration/targets/junos_l2_interfaces/tasks/main.yaml2
-rw-r--r--test/integration/targets/junos_l2_interfaces/tasks/netconf.yaml17
-rw-r--r--test/integration/targets/junos_l2_interfaces/tests/netconf/_base_config.yaml14
-rw-r--r--test/integration/targets/junos_l2_interfaces/tests/netconf/_remove_config.yaml18
-rw-r--r--test/integration/targets/junos_l2_interfaces/tests/netconf/deleted.yaml81
-rw-r--r--test/integration/targets/junos_l2_interfaces/tests/netconf/merged.yaml58
-rw-r--r--test/integration/targets/junos_l2_interfaces/tests/netconf/overridden.yaml63
-rw-r--r--test/integration/targets/junos_l2_interfaces/tests/netconf/replaced.yaml58
-rw-r--r--test/integration/targets/junos_l2_interfaces/tests/netconf/rtt.yml70
11 files changed, 0 insertions, 386 deletions
diff --git a/test/integration/targets/junos_l2_interfaces/defaults/main.yaml b/test/integration/targets/junos_l2_interfaces/defaults/main.yaml
deleted file mode 100644
index 164afead28..0000000000
--- a/test/integration/targets/junos_l2_interfaces/defaults/main.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-testcase: "[^_].*"
-test_items: []
diff --git a/test/integration/targets/junos_l2_interfaces/meta/main.yaml b/test/integration/targets/junos_l2_interfaces/meta/main.yaml
deleted file mode 100644
index 191a0f2ea1..0000000000
--- a/test/integration/targets/junos_l2_interfaces/meta/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-dependencies:
- - prepare_junos_tests
diff --git a/test/integration/targets/junos_l2_interfaces/tasks/main.yaml b/test/integration/targets/junos_l2_interfaces/tasks/main.yaml
deleted file mode 100644
index cc27f174fd..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tasks/main.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- { include: netconf.yaml, tags: ['netconf'] }
diff --git a/test/integration/targets/junos_l2_interfaces/tasks/netconf.yaml b/test/integration/targets/junos_l2_interfaces/tasks/netconf.yaml
deleted file mode 100644
index 3f3ca7832d..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tasks/netconf.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
----
-- name: collect all netconf test cases
- find:
- paths: "{{ role_path }}/tests/netconf"
- patterns: "{{ testcase }}.yml"
- use_regex: true
- connection: local
- register: test_cases
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test case (connection=netconf)
- include: "{{ test_case_to_run }} ansible_connection=netconf"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
diff --git a/test/integration/targets/junos_l2_interfaces/tests/netconf/_base_config.yaml b/test/integration/targets/junos_l2_interfaces/tests/netconf/_base_config.yaml
deleted file mode 100644
index afb39ef977..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tests/netconf/_base_config.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- debug:
- msg: "Start junos_l2_interfaces base config ansible_connection={{ ansible_connection }}"
-
-- name: Configure vlan
- junos_config:
- lines:
- - set vlans vlan100 vlan-id 100
- - set vlans vlan200 vlan-id 200
- - set vlans vlan300 vlan-id 300
- - set vlans vlan400 vlan-id 400
-
-- debug:
- msg: "End junos_l2_interfaces base config ansible_connection={{ ansible_connection }}"
diff --git a/test/integration/targets/junos_l2_interfaces/tests/netconf/_remove_config.yaml b/test/integration/targets/junos_l2_interfaces/tests/netconf/_remove_config.yaml
deleted file mode 100644
index b570ef8966..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tests/netconf/_remove_config.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-- debug:
- msg: "Start junos_l2_interfaces deleted remove l2 interface config ansible_connection={{ ansible_connection }}"
-
-- name: "Setup - remove interface config"
- junos_config:
- lines:
- - delete interfaces ge-0/0/1
- - delete interfaces ge-0/0/2
- - delete interfaces ge-0/0/3
- - delete interfaces lo0
- - delete vlans vlan100
- - delete vlans vlan200
- - delete vlans vlan300
- - delete vlans vlan400
-
-- debug:
- msg: "End junos_l2_interfaces deleted remove l2 interface config ansible_connection={{ ansible_connection }}"
diff --git a/test/integration/targets/junos_l2_interfaces/tests/netconf/deleted.yaml b/test/integration/targets/junos_l2_interfaces/tests/netconf/deleted.yaml
deleted file mode 100644
index 66f50c5cb8..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tests/netconf/deleted.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
----
-- debug:
- msg: "START junos_l2_interfaces deleted integration tests on connection={{ ansible_connection }}"
-
-- include_tasks: _remove_config.yaml
-- include_tasks: _base_config.yaml
-
-- set_fact:
- expected_deleted_output:
- - name: ge-0/0/1
- unit: 0
- enhanced_layer: True
- access:
- vlan: vlan100
-
-- block:
- - name: Configure initial state for l2 interface
- junos_l2_interfaces: &initial
- config:
- - name: ge-0/0/1
- access:
- vlan: vlan100
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan200
- - vlan300
- native_vlan: "400"
- state: merged
- register: result
-
- - name: Delete the provided l2 interface configuration from running configuration
- junos_l2_interfaces: &deleted
- config:
- - name: ge-0/0/2
- state: deleted
- register: result
-
- - name: Assert the configuration is reflected on host
- assert:
- that:
- - "{{ expected_deleted_output | symmetric_difference(result['after']) |length == 0 }}"
-
- - name: Delete the provided l2 interface configuration from running configuration (IDEMPOTENT)
- junos_l2_interfaces: *deleted
- register: result
-
- - name: Assert that the previous task was idempotent
- assert:
- that:
- - "result['changed'] == false"
-
- - name: Configure initial state for interface
- junos_l2_interfaces: *initial
- register: result
-
- - name: Delete the all l2 interface configuration from running configuration
- junos_l2_interfaces:
- state: deleted
- register: result
-
- - name: Assert the configuration is reflected on host
- assert:
- that:
- - "{{ result['after'] == [] }}"
-
- - name: Delete the all l2 interface configuration from running configuration (IDEMPOTENT)
- junos_l2_interfaces:
- state: deleted
- register: result
-
- - name: Assert that the previous task was idempotent
- assert:
- that:
- - "result['changed'] == false"
-
- always:
- - include_tasks: _remove_config.yaml
-
-- debug:
- msg: "END junos_l2_interfaces deleted integration tests on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/junos_l2_interfaces/tests/netconf/merged.yaml b/test/integration/targets/junos_l2_interfaces/tests/netconf/merged.yaml
deleted file mode 100644
index e6fcefa50d..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tests/netconf/merged.yaml
+++ /dev/null
@@ -1,58 +0,0 @@
----
-- debug:
- msg: "START junos_l2_interfaces merged integration tests on connection={{ ansible_connection }}"
-
-- include_tasks: _remove_config.yaml
-- include_tasks: _base_config.yaml
-
-- set_fact:
- expected_merged_output:
- - name: ge-0/0/1
- access:
- vlan: vlan100
- enhanced_layer: True
- unit: 0
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan200
- - vlan300
- native_vlan: "400"
- enhanced_layer: True
- unit: 0
-
-- block:
- - name: Merge the provided configuration with the exisiting running configuration
- junos_l2_interfaces: &merged
- config:
- - name: ge-0/0/1
- access:
- vlan: vlan100
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan200
- - vlan300
- native_vlan: "400"
- state: merged
- register: result
-
- - name: Assert the configuration is reflected on host
- assert:
- that:
- - "{{ expected_merged_output | symmetric_difference(result['after']) |length == 0 }}"
-
- - name: Merge the provided l2 interface configuration from running configuration (IDEMPOTENT)
- junos_l2_interfaces: *merged
- register: result
-
- - name: Assert that the previous task was idempotent
- assert:
- that:
- - "result['changed'] == false"
-
- always:
- - include_tasks: _remove_config.yaml
-
-- debug:
- msg: "END junos_l2_interfaces merged integration tests on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/junos_l2_interfaces/tests/netconf/overridden.yaml b/test/integration/targets/junos_l2_interfaces/tests/netconf/overridden.yaml
deleted file mode 100644
index 12133e1803..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tests/netconf/overridden.yaml
+++ /dev/null
@@ -1,63 +0,0 @@
----
-- debug:
- msg: "START junos_l2_interfaces override integration tests on connection={{ ansible_connection }}"
-
-- include_tasks: _remove_config.yaml
-- include_tasks: _base_config.yaml
-
-- set_fact:
- expected_overridden_output:
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan100
- native_vlan: "200"
- enhanced_layer: True
- unit: 0
-
-- block:
- - name: Setup initial l2 configuration
- junos_l2_interfaces:
- config:
- - name: ge-0/0/1
- access:
- vlan: vlan100
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan200
- - vlan300
- native_vlan: "400"
- state: overridden
- register: result
-
- - name: Override the provided configuration with the exisiting running configuration
- junos_l2_interfaces: &overridden
- config:
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan100
- native_vlan: "200"
- state: overridden
- register: result
-
- - name: Assert the configuration is reflected on host
- assert:
- that:
- - "{{ expected_overridden_output | symmetric_difference(result['after']) |length == 0 }}"
-
- - name: Override the provided l2 interface configuration from running configuration (IDEMPOTENT)
- junos_l2_interfaces: *overridden
- register: result
-
- - name: Assert that the previous task was idempotent
- assert:
- that:
- - "result['changed'] == false"
-
- always:
- - include_tasks: _remove_config.yaml
-
-- debug:
- msg: "END junos_l2_interfaces override integration tests on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/junos_l2_interfaces/tests/netconf/replaced.yaml b/test/integration/targets/junos_l2_interfaces/tests/netconf/replaced.yaml
deleted file mode 100644
index b73e8ae8d1..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tests/netconf/replaced.yaml
+++ /dev/null
@@ -1,58 +0,0 @@
----
-- debug:
- msg: "START junos_l2_interfaces replaced integration tests on connection={{ ansible_connection }}"
-
-- include_tasks: _remove_config.yaml
-- include_tasks: _base_config.yaml
-
-- set_fact:
- expected_replaced_output:
- - name: ge-0/0/1
- trunk:
- allowed_vlans:
- - vlan100
- - vlan300
- native_vlan: "400"
- enhanced_layer: True
- unit: 0
- - name: ge-0/0/2
- access:
- vlan: vlan200
- enhanced_layer: True
- unit: 0
-
-- block:
- - name: Replace the provided configuration with the exisiting running configuration
- junos_l2_interfaces: &replaced
- config:
- - name: ge-0/0/1
- trunk:
- allowed_vlans:
- - vlan100
- - vlan300
- native_vlan: "400"
- - name: ge-0/0/2
- access:
- vlan: vlan200
- state: replaced
- register: result
-
- - name: Assert the configuration is reflected on host
- assert:
- that:
- - "{{ expected_replaced_output | symmetric_difference(result['after']) |length == 0 }}"
-
- - name: Replace the provided interface configuration from running configuration (IDEMPOTENT)
- junos_l2_interfaces: *replaced
- register: result
-
- - name: Assert that the previous task was idempotent
- assert:
- that:
- - "result['changed'] == false"
-
- always:
- - include_tasks: _remove_config.yaml
-
-- debug:
- msg: "END junos_l2_interfaces replaced integration tests on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/junos_l2_interfaces/tests/netconf/rtt.yml b/test/integration/targets/junos_l2_interfaces/tests/netconf/rtt.yml
deleted file mode 100644
index 5ee829103f..0000000000
--- a/test/integration/targets/junos_l2_interfaces/tests/netconf/rtt.yml
+++ /dev/null
@@ -1,70 +0,0 @@
----
-- debug:
- msg: "START junos_l2_interfaces round trip integration tests on connection={{ ansible_connection }}"
-
-- include_tasks: _remove_config.yaml
-- include_tasks: _base_config.yaml
-
-- set_fact:
- expected_revert_output:
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan100
- native_vlan: "200"
- enhanced_layer: True
- unit: 0
-
-- block:
- - name: Apply the provided configuration (base config)
- junos_l2_interfaces:
- config:
- - name: ge-0/0/2
- trunk:
- allowed_vlans:
- - vlan100
- native_vlan: "200"
- state: merged
- register: base_config
-
- - name: Gather interfaces facts
- junos_facts:
- gather_subset:
- - default
- gather_network_resources:
- - l2_interfaces
-
- - name: Apply the provided configuration (config to be reverted)
- junos_l2_interfaces:
- config:
- - name: ge-0/0/1
- trunk:
- allowed_vlans:
- - vlan100
- - vlan300
- native_vlan: "400"
- - name: ge-0/0/2
- access:
- vlan: vlan200
- state: replaced
- register: result
-
- - name: Assert that changes were applied
- assert:
- that: "result['changed'] == true"
-
- - name: Revert back to base config using facts round trip
- junos_l2_interfaces:
- config: "{{ ansible_facts['network_resources']['l2_interfaces'] }}"
- state: overridden
- register: revert
-
- - name: Assert that config was reverted
- assert:
- that: "{{ expected_revert_output | symmetric_difference(revert['after']) |length == 0 }}"
-
- always:
- - include_tasks: _remove_config.yaml
-
-- debug:
- msg: "END junos_l2_interfaces round trip integration tests on connection={{ ansible_connection }}"