summaryrefslogtreecommitdiff
path: root/test/integration/targets/eos_config
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/eos_config')
-rw-r--r--test/integration/targets/eos_config/config.txt21
-rw-r--r--test/integration/targets/eos_config/defaults/main.yaml3
-rw-r--r--test/integration/targets/eos_config/meta/main.yml2
-rw-r--r--test/integration/targets/eos_config/tasks/cli.yaml17
-rw-r--r--test/integration/targets/eos_config/tasks/cli_config.yaml17
-rw-r--r--test/integration/targets/eos_config/tasks/eapi.yaml17
-rw-r--r--test/integration/targets/eos_config/tasks/main.yaml4
-rw-r--r--test/integration/targets/eos_config/templates/basic/cmds.j24
-rw-r--r--test/integration/targets/eos_config/templates/basic/config.j24
-rw-r--r--test/integration/targets/eos_config/templates/defaults/config.j23
-rw-r--r--test/integration/targets/eos_config/templates/defaults/test.j24
-rw-r--r--test/integration/targets/eos_config/tests/cli/backup.yaml134
-rw-r--r--test/integration/targets/eos_config/tests/cli/check_mode.yaml93
-rw-r--r--test/integration/targets/eos_config/tests/cli/config.yaml51
-rw-r--r--test/integration/targets/eos_config/tests/cli/defaults.yaml42
-rw-r--r--test/integration/targets/eos_config/tests/cli/save.yaml32
-rw-r--r--test/integration/targets/eos_config/tests/cli/src_basic.yaml39
-rw-r--r--test/integration/targets/eos_config/tests/cli/src_invalid.yaml19
-rw-r--r--test/integration/targets/eos_config/tests/cli/src_match_none.yaml41
-rw-r--r--test/integration/targets/eos_config/tests/cli/sublevel.yaml40
-rw-r--r--test/integration/targets/eos_config/tests/cli/sublevel_block.yaml61
-rw-r--r--test/integration/targets/eos_config/tests/cli/sublevel_exact.yaml65
-rw-r--r--test/integration/targets/eos_config/tests/cli/sublevel_strict.yaml65
-rw-r--r--test/integration/targets/eos_config/tests/cli/sublevel_strict_mul_parents.yaml79
-rw-r--r--test/integration/targets/eos_config/tests/cli/toplevel.yaml37
-rw-r--r--test/integration/targets/eos_config/tests/cli/toplevel_after.yaml44
-rw-r--r--test/integration/targets/eos_config/tests/cli/toplevel_before.yaml44
-rw-r--r--test/integration/targets/eos_config/tests/cli_config/cli_backup.yaml113
-rw-r--r--test/integration/targets/eos_config/tests/cli_config/cli_basic.yaml35
-rw-r--r--test/integration/targets/eos_config/tests/eapi/backup.yaml50
-rw-r--r--test/integration/targets/eos_config/tests/eapi/defaults.yaml42
-rw-r--r--test/integration/targets/eos_config/tests/eapi/save.yaml32
-rw-r--r--test/integration/targets/eos_config/tests/eapi/src_basic.yaml38
-rw-r--r--test/integration/targets/eos_config/tests/eapi/src_invalid.yaml18
-rw-r--r--test/integration/targets/eos_config/tests/eapi/src_match_none.yaml40
-rw-r--r--test/integration/targets/eos_config/tests/eapi/sublevel.yaml41
-rw-r--r--test/integration/targets/eos_config/tests/eapi/sublevel_block.yaml59
-rw-r--r--test/integration/targets/eos_config/tests/eapi/sublevel_exact.yaml65
-rw-r--r--test/integration/targets/eos_config/tests/eapi/sublevel_strict.yaml64
-rw-r--r--test/integration/targets/eos_config/tests/eapi/toplevel.yaml37
-rw-r--r--test/integration/targets/eos_config/tests/eapi/toplevel_after.yaml44
-rw-r--r--test/integration/targets/eos_config/tests/eapi/toplevel_before.yaml44
42 files changed, 0 insertions, 1704 deletions
diff --git a/test/integration/targets/eos_config/config.txt b/test/integration/targets/eos_config/config.txt
deleted file mode 100644
index fba5bde0e0..0000000000
--- a/test/integration/targets/eos_config/config.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-!
-! boot system flash:/vEOS-lab.swi
-!
-transceiver qsfp default-mode 4x10G
-!
-hostname localhost
-!
-spanning-tree mode mstp
-!
-no aaa root
-!
-interface Ethernet1
-!
-interface Ethernet2
-!
-!
-no ip routing
-!
-!
-end
-
diff --git a/test/integration/targets/eos_config/defaults/main.yaml b/test/integration/targets/eos_config/defaults/main.yaml
deleted file mode 100644
index 9ef5ba5165..0000000000
--- a/test/integration/targets/eos_config/defaults/main.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-testcase: "*"
-test_items: []
diff --git a/test/integration/targets/eos_config/meta/main.yml b/test/integration/targets/eos_config/meta/main.yml
deleted file mode 100644
index e5c8cd02f0..0000000000
--- a/test/integration/targets/eos_config/meta/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-dependencies:
- - prepare_eos_tests
diff --git a/test/integration/targets/eos_config/tasks/cli.yaml b/test/integration/targets/eos_config/tasks/cli.yaml
deleted file mode 100644
index 82d196e4ed..0000000000
--- a/test/integration/targets/eos_config/tasks/cli.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
----
-- name: collect all cli test cases
- find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
- register: test_cases
- delegate_to: localhost
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test cases (connection=network_cli)
- include: "{{ test_case_to_run }} ansible_connection=network_cli"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
- tags: connection_network_cli
diff --git a/test/integration/targets/eos_config/tasks/cli_config.yaml b/test/integration/targets/eos_config/tasks/cli_config.yaml
deleted file mode 100644
index baaa0a139e..0000000000
--- a/test/integration/targets/eos_config/tasks/cli_config.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
----
-- name: collect all cli_config test cases
- find:
- paths: "{{ role_path }}/tests/cli_config"
- patterns: "{{ testcase }}.yaml"
- register: test_cases
- delegate_to: localhost
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test case (connection=network_cli)
- include: "{{ test_case_to_run }} ansible_connection=network_cli"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
- tags: connection_network_cli
diff --git a/test/integration/targets/eos_config/tasks/eapi.yaml b/test/integration/targets/eos_config/tasks/eapi.yaml
deleted file mode 100644
index 2cf18b6b53..0000000000
--- a/test/integration/targets/eos_config/tasks/eapi.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
----
-- name: collect all eapi test cases
- find:
- paths: "{{ role_path }}/tests/eapi"
- patterns: "{{ testcase }}.yaml"
- delegate_to: localhost
- register: test_cases
-
-- name: set test_items
- set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-
-- name: run test cases (connection=httpapi)
- include: "{{ test_case_to_run }} ansible_connection=httpapi"
- with_items: "{{ test_items }}"
- loop_control:
- loop_var: test_case_to_run
- tags: connection_httpapi
diff --git a/test/integration/targets/eos_config/tasks/main.yaml b/test/integration/targets/eos_config/tasks/main.yaml
deleted file mode 100644
index 8befd2711f..0000000000
--- a/test/integration/targets/eos_config/tasks/main.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- { include: cli.yaml, tags: ['cli'] }
-- { include: cli_config.yaml, tags: ['cli_config'] }
-- { include: eapi.yaml, tags: ['eapi'] }
diff --git a/test/integration/targets/eos_config/templates/basic/cmds.j2 b/test/integration/targets/eos_config/templates/basic/cmds.j2
deleted file mode 100644
index c68cce8e17..0000000000
--- a/test/integration/targets/eos_config/templates/basic/cmds.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-ip access-list test
- 10 permit ip host 192.168.0.2 host 192.168.0.1
- 20 permit ip host 192.168.0.1 host 192.168.0.2
-!
diff --git a/test/integration/targets/eos_config/templates/basic/config.j2 b/test/integration/targets/eos_config/templates/basic/config.j2
deleted file mode 100644
index 82a61b62df..0000000000
--- a/test/integration/targets/eos_config/templates/basic/config.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-interface Ethernet2
- description this is a test
- shutdown
-
diff --git a/test/integration/targets/eos_config/templates/defaults/config.j2 b/test/integration/targets/eos_config/templates/defaults/config.j2
deleted file mode 100644
index 8ff8f305c0..0000000000
--- a/test/integration/targets/eos_config/templates/defaults/config.j2
+++ /dev/null
@@ -1,3 +0,0 @@
-interface Ethernet2
- description this is a test
- no shutdown
diff --git a/test/integration/targets/eos_config/templates/defaults/test.j2 b/test/integration/targets/eos_config/templates/defaults/test.j2
deleted file mode 100644
index 82a61b62df..0000000000
--- a/test/integration/targets/eos_config/templates/defaults/test.j2
+++ /dev/null
@@ -1,4 +0,0 @@
-interface Ethernet2
- description this is a test
- shutdown
-
diff --git a/test/integration/targets/eos_config/tests/cli/backup.yaml b/test/integration/targets/eos_config/tests/cli/backup.yaml
deleted file mode 100644
index e75a40afdb..0000000000
--- a/test/integration/targets/eos_config/tests/cli/backup.yaml
+++ /dev/null
@@ -1,134 +0,0 @@
----
-- debug: msg="START cli/backup.yaml on connection={{ ansible_connection }}"
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- connection: local
-
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- connection: local
-
-- name: delete backup files
- file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{backup_files.files|default([])}}"
-
-- name: configure device with config
- eos_config:
- src: basic/config.j2
- backup: yes
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- connection: local
-
-- assert:
- that:
- - "backup_files.files is defined"
-
-- name: delete configurable backup file path
- file:
- path: "{{ item }}"
- state: absent
- with_items:
- - "{{ role_path }}/backup_test_dir/"
- - "{{ role_path }}/backup/backup.cfg"
-
-- name: take configuration backup in custom filename and directory path
- eos_config:
- backup: yes
- backup_options:
- filename: backup.cfg
- dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}"
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: check if the backup file-1 exist
- find:
- paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}/backup.cfg"
- register: backup_file
- connection: local
-
-- assert:
- that:
- - "backup_file.files is defined"
-
-- name: take configuration backup in custom filename
- eos_config:
- backup: yes
- backup_options:
- filename: backup.cfg
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: check if the backup file-2 exist
- find:
- paths: "{{ role_path }}/backup/backup.cfg"
- register: backup_file
- connection: local
-
-- assert:
- that:
- - "backup_file.files is defined"
-
-- name: take configuration backup in custom path and default filename
- eos_config:
- backup: yes
- backup_options:
- dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}"
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: check if the backup file-3 exist
- find:
- paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_file
- connection: local
-
-- assert:
- that:
- - "backup_file.files is defined"
-
-- debug: msg="END cli/backup.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/check_mode.yaml b/test/integration/targets/eos_config/tests/cli/check_mode.yaml
deleted file mode 100644
index 3961239547..0000000000
--- a/test/integration/targets/eos_config/tests/cli/check_mode.yaml
+++ /dev/null
@@ -1,93 +0,0 @@
----
-- debug:
- msg: "START cli/check_mode.yaml on connection={{ ansible_connection }}"
-
-- name: invalid configuration in check mode
- eos_config:
- lines:
- - ip address 119.31.1.1 255.255.255.256
- parents: interface Loopback911
- become: yes
- check_mode: 1
- vars:
- ansible_eos_use_sessions: 1
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.msg is defined"
- - "result.failed == true"
- - "'Invalid input' in result.msg"
-
-- name: valid configuration in check mode
- eos_config:
- before:
- - "no ip access-list test"
- src: basic/cmds.j2
- become: yes
- check_mode: yes
- register: config
-
-- name: check if session is removed
- eos_command:
- commands:
- - show configuration sessions | json
- become: yes
- register: result
-
-- assert:
- that:
- - "config.session not in result.stdout[0].sessions"
-
-- name: configuration in check mode + no config session
- eos_config:
- lines:
- - ip address 119.31.1.1 255.255.255.254
- parents: interface Loopback911
- become: yes
- check_mode: 1
- vars:
- ansible_eos_use_sessions: 0
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.failed == true"
-
-- name: invalid configuration in check mode + no config session
- eos_config:
- lines:
- - ip address 119.31.1.1 255.255.255.256
- parents: interface Loopback911
- diff_against: running
- become: yes
- check_mode: 1
- vars:
- ansible_eos_use_sessions: 0
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: valid configuration in check mode + no config session
- eos_config:
- lines:
- - ip address 119.31.1.1 255.255.255.255
- parents: interface Loopback911
- diff_against: running
- become: yes
- check_mode: yes
- register: result
- vars:
- ansible_eos_use_sessions: 0
-
-- assert:
- that:
- - "result.changed == true"
- - "'session' not in result"
-
-- debug: msg="END cli/check_mode.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/config.yaml b/test/integration/targets/eos_config/tests/cli/config.yaml
deleted file mode 100644
index 428326f058..0000000000
--- a/test/integration/targets/eos_config/tests/cli/config.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
----
-- debug: msg="START cli/config.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines: hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- name: get current running-config
- eos_command:
- commands: show running-config
- become: yes
- register: config
-
-- name: configure hostname
- eos_config:
- lines: hostname foo
- config: "{{ config.stdout[0] }}"
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
-
-- name: get current running-config
- eos_command:
- commands: show running-config
- become: yes
- register: config
-
-- name: configure hostname again
- eos_config:
- lines: hostname foo
- config: "{{ config.stdout[0] }}"
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- debug: msg="END cli/config.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/defaults.yaml b/test/integration/targets/eos_config/tests/cli/defaults.yaml
deleted file mode 100644
index cd87b4e7d3..0000000000
--- a/test/integration/targets/eos_config/tests/cli/defaults.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-- debug: msg="START cli/defaults.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: configure device with defaults included
- eos_config:
- src: defaults/config.j2
- defaults: yes
- become: yes
- register: result
-
-- debug: var=result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: check device with defaults included
- eos_config:
- src: defaults/config.j2
- defaults: yes
- become: yes
- register: result
-
-- debug: var=result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.updates is not defined"
-
-- debug: msg="END cli/defaults.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/save.yaml b/test/integration/targets/eos_config/tests/cli/save.yaml
deleted file mode 100644
index cad82c26b7..0000000000
--- a/test/integration/targets/eos_config/tests/cli/save.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-- debug: msg="START cli/save.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-
-- name: save config always
- eos_config: &always
- save_when: always
- become: yes
- register: result
-
-- assert: &changed
- that:
- - "result.changed == true"
-
-- name: save should always run
- eos_config: *always
- become: yes
- register: result
-
-- assert: *changed
-
-- debug: msg="END cli/save.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/src_basic.yaml b/test/integration/targets/eos_config/tests/cli/src_basic.yaml
deleted file mode 100644
index 174d814aa0..0000000000
--- a/test/integration/targets/eos_config/tests/cli/src_basic.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
----
-- debug: msg="START cli/src_basic.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: configure device with config
- eos_config:
- src: basic/config.j2
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-# https://github.com/ansible/ansible-modules-core/issues/4807
- - "result.updates is defined"
-
-- name: check device with config
- eos_config:
- src: basic/config.j2
- defaults: yes
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-# https://github.com/ansible/ansible-modules-core/issues/4807
- - "result.updates is not defined"
-
-- debug: msg="END cli/src_basic.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/src_invalid.yaml b/test/integration/targets/eos_config/tests/cli/src_invalid.yaml
deleted file mode 100644
index 8931c7cf87..0000000000
--- a/test/integration/targets/eos_config/tests/cli/src_invalid.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
----
-- debug: msg="START cli/src_invalid.yaml on connection={{ ansible_connection }}"
-
-
-# Defend https://github.com/ansible/ansible-modules-core/issues/4797
-- name: configure with invalid src
- eos_config:
- src: basic/foobar.j2
- become: yes
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.changed == false"
- - "result.failed == true"
- - "result.msg == 'path specified in src not found'"
-
-- debug: msg="END cli/src_invalid.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/src_match_none.yaml b/test/integration/targets/eos_config/tests/cli/src_match_none.yaml
deleted file mode 100644
index 74c5043612..0000000000
--- a/test/integration/targets/eos_config/tests/cli/src_match_none.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-- debug: msg="START cli/src_match_none.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: configure device with config
- eos_config:
- src: basic/config.j2
- match: none
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-# https://github.com/ansible/ansible-modules-core/issues/4807
- #- "result.updates is not defined"
-
-- name: check device with config
- eos_config:
- src: basic/config.j2
- defaults: yes
- become: yes
- register: result
-
-- assert:
- that:
- # Idempotent test
-# https://github.com/ansible/ansible-modules-core/issues/4807
- - "result.changed == false"
- - "result.updates is not defined"
-
-- debug: msg="END cli/src_match_none.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/sublevel.yaml b/test/integration/targets/eos_config/tests/cli/sublevel.yaml
deleted file mode 100644
index 21c3f9caa4..0000000000
--- a/test/integration/targets/eos_config/tests/cli/sublevel.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-- debug: msg="START cli/sublevel.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines: no vlan 10
- match: none
- become: yes
-
-- name: configure sub level command
- eos_config:
- lines: name test
- parents: vlan 10
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'vlan 10' in result.updates"
- - "'name test' in result.updates"
-
-- name: configure sub level command idempotent check
- eos_config:
- lines: name test
- parents: vlan 10
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no vlan 10
- match: none
- become: yes
-
-- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/sublevel_block.yaml b/test/integration/targets/eos_config/tests/cli/sublevel_block.yaml
deleted file mode 100644
index 9fbd1412f6..0000000000
--- a/test/integration/targets/eos_config/tests/cli/sublevel_block.yaml
+++ /dev/null
@@ -1,61 +0,0 @@
----
-- debug: msg="START cli/sublevel_block.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: none
- become: yes
-
-- name: configure sub level command using block resplace
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- replace: block
- after: exit
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ip access-list test' in result.updates"
- - "'10 permit ip host 192.0.2.1 any log' in result.updates"
- - "'20 permit ip host 192.0.2.2 any log' in result.updates"
- - "'30 permit ip host 192.0.2.3 any log' in result.updates"
- - "'40 permit ip host 192.0.2.4 any log' in result.updates"
-
-- name: check sub level command using block replace
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- replace: block
- after: exit
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/eos_config/tests/cli/sublevel_exact.yaml
deleted file mode 100644
index 5b733255da..0000000000
--- a/test/integration/targets/eos_config/tests/cli/sublevel_exact.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
----
-- debug: msg="START cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- - 50 permit ip host 192.0.2.5 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: none
- become: yes
-
-- name: configure sub level command using exact match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: exact
- replace: block
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ip access-list test' in result.updates"
- - "'10 permit ip host 192.0.2.1 any log' in result.updates"
- - "'20 permit ip host 192.0.2.2 any log' in result.updates"
- - "'30 permit ip host 192.0.2.3 any log' in result.updates"
- - "'40 permit ip host 192.0.2.4 any log' in result.updates"
- - "'50 permit ip host 192.0.2.5 any log' not in result.updates"
-
-- name: check sub level command using exact match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- match: exact
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/eos_config/tests/cli/sublevel_strict.yaml
deleted file mode 100644
index be055f69e2..0000000000
--- a/test/integration/targets/eos_config/tests/cli/sublevel_strict.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
----
-- debug: msg="START cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- - 50 permit ip host 192.0.2.5 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: none
- become: yes
-
-- name: configure sub level command using strict match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.3 any log
- - 30 permit ip host 192.0.2.2 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: strict
- replace: block
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ip access-list test' in result.updates"
- - "'10 permit ip host 192.0.2.1 any log' in result.updates"
- - "'30 permit ip host 192.0.2.2 any log' in result.updates"
- - "'20 permit ip host 192.0.2.3 any log' in result.updates"
- - "'40 permit ip host 192.0.2.4 any log' in result.updates"
- - "'50 permit ip host 192.0.2.5 any log' not in result.updates"
-
-- name: check sub level command using strict match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.3 any log
- - 30 permit ip host 192.0.2.2 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- match: strict
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/sublevel_strict_mul_parents.yaml b/test/integration/targets/eos_config/tests/cli/sublevel_strict_mul_parents.yaml
deleted file mode 100644
index 4db54724cf..0000000000
--- a/test/integration/targets/eos_config/tests/cli/sublevel_strict_mul_parents.yaml
+++ /dev/null
@@ -1,79 +0,0 @@
----
-- debug:
- msg: "START cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines:
- - class-map type qos match-any c1
- - match ip access-group 10
- - policy-map type qos p1
- - class c1
- before: ['no policy-map type qos p1', 'no class-map type qos match-any c1']
- match: none
- become: yes
-
-- block:
- - name: configure sub level command using strict match
- eos_config:
- lines:
- - set cos 1
- - set dscp 62
- parents: ['policy-map type qos p1', 'class c1']
- match: strict
- # session-config diffs does not produce a diff here for some reason.
- # check against running-config instead.
- diff_against: running
- register: result
- become: yes
-
- - assert:
- that:
- - "result.changed == true"
- - "'set cos 1' in result.updates"
- - "'set dscp 62' in result.updates"
-
- - name: change sub level command order and config with strict match
- eos_config:
- lines:
- - set dscp 62
- - set cos 1
- parents: ['policy-map type qos p1', 'class c1']
- match: strict
- diff_against: running
- register: result
- become: yes
-
- - assert:
- that:
- - "result.changed == true"
- - "'set cos 1' in result.updates"
- - "'set dscp 62' in result.updates"
-
- - name: Config sub level command with strict match (Idempotency)
- eos_config:
- lines:
- #EOS does not change order of class action if reconfigured
- #so we have to use old order for Idempotency
- - set cos 1
- - set dscp 62
- parents: ['policy-map type qos p1', 'class c1']
- match: strict
- diff_against: running
- register: result
- become: yes
-
- - assert:
- that:
- - "result.changed == false"
-
- always:
- - name: teardown
- eos_config:
- lines:
- - no policy-map type qos p1
- - no class-map type qos match-any c1
- match: none
- become: yes
-
-- debug: msg="END cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/toplevel.yaml b/test/integration/targets/eos_config/tests/cli/toplevel.yaml
deleted file mode 100644
index 2c9211427c..0000000000
--- a/test/integration/targets/eos_config/tests/cli/toplevel.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
----
-- debug: msg="START cli/toplevel.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines: hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- name: configure top level command
- eos_config:
- lines: hostname foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
-
-- name: configure top level command idempotent check
- eos_config:
- lines: hostname foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/toplevel_after.yaml b/test/integration/targets/eos_config/tests/cli/toplevel_after.yaml
deleted file mode 100644
index 56bf934435..0000000000
--- a/test/integration/targets/eos_config/tests/cli/toplevel_after.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
----
-- debug: msg="START cli/toplevel_after.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines:
- - snmp-server contact ansible
- - "hostname {{ inventory_hostname_short }}"
- match: none
- become: yes
-
-- name: configure top level command with before
- eos_config:
- lines: hostname foo
- after: snmp-server contact bar
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
- - "'snmp-server contact bar' in result.updates"
-
-- name: configure top level command with before idempotent check
- eos_config:
- lines: hostname foo
- after: snmp-server contact foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines:
- - no snmp-server contact
- - hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli/toplevel_before.yaml b/test/integration/targets/eos_config/tests/cli/toplevel_before.yaml
deleted file mode 100644
index 449e1bf36c..0000000000
--- a/test/integration/targets/eos_config/tests/cli/toplevel_before.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
----
-- debug: msg="START cli/toplevel_before.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- lines:
- - "snmp-server contact ansible"
- - "hostname {{ inventory_hostname_short }}"
- match: none
- become: yes
-
-- name: configure top level command with before
- eos_config:
- lines: hostname foo
- before: snmp-server contact bar
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
- - "'snmp-server contact bar' in result.updates"
-
-- name: configure top level command with before idempotent check
- eos_config:
- lines: hostname foo
- before: snmp-server contact foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines:
- - no snmp-server contact
- - "hostname {{ inventory_hostname_short }}"
- match: none
- become: yes
-
-- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli_config/cli_backup.yaml b/test/integration/targets/eos_config/tests/cli_config/cli_backup.yaml
deleted file mode 100644
index a431c01fde..0000000000
--- a/test/integration/targets/eos_config/tests/cli_config/cli_backup.yaml
+++ /dev/null
@@ -1,113 +0,0 @@
-- debug: msg="END cli_config/backup.yaml on connection={{ ansible_connection }}"
-
-- name: delete configurable backup file path
- file:
- path: "{{ item }}"
- state: absent
- with_items:
- - "{{ role_path }}/backup_test_dir/"
- - "{{ role_path }}/backup/backup.cfg"
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- connection: local
-
-- name: delete backup files
- file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{backup_files.files|default([])}}"
-
-- name: take config backup
- cli_config:
- backup: yes
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- connection: local
-
-- assert:
- that:
- - "backup_files.files is defined"
-
-- name: take configuration backup in custom filename and directory path
- cli_config:
- backup: yes
- backup_options:
- filename: backup.cfg
- dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}"
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: check if the backup file-1 exist
- find:
- paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}/backup.cfg"
- register: backup_file
- connection: local
-
-- assert:
- that:
- - "backup_file.files is defined"
-
-- name: take configuration backup in custom filename
- cli_config:
- backup: yes
- backup_options:
- filename: backup.cfg
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: check if the backup file-2 exist
- find:
- paths: "{{ role_path }}/backup/backup.cfg"
- register: backup_file
- connection: local
-
-- assert:
- that:
- - "backup_file.files is defined"
-
-- name: take configuration backup in custom path and default filename
- cli_config:
- backup: yes
- backup_options:
- dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}"
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: check if the backup file-3 exist
- find:
- paths: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_file
- connection: local
-
-- assert:
- that:
- - "backup_file.files is defined"
-
-- debug: msg="END cli_config/backup.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/cli_config/cli_basic.yaml b/test/integration/targets/eos_config/tests/cli_config/cli_basic.yaml
deleted file mode 100644
index 73b3175ab8..0000000000
--- a/test/integration/targets/eos_config/tests/cli_config/cli_basic.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
----
-- debug: msg="START cli_config/cli_basic.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- cli_config: &rm
- config: |
- interface Ethernet2
- no description
- no shutdown
- become: yes
-
-- name: configure device with config
- cli_config: &conf
- config: "{{ lookup('template', 'basic/config.j2') }}"
- register: result
- become: yes
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Idempotence
- cli_config: *conf
- register: result
- become: yes
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- cli_config: *rm
- become: yes
-
-- debug: msg="END cli_config/cli_basic.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/eapi/backup.yaml b/test/integration/targets/eos_config/tests/eapi/backup.yaml
deleted file mode 100644
index 45dfa4e0c7..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/backup.yaml
+++ /dev/null
@@ -1,50 +0,0 @@
----
-- debug: msg="START eapi/backup.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- connection: local
-
-- name: delete backup files
- file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{backup_files.files|default([])}}"
-
-- name: configure device with config
- eos_config:
- src: basic/config.j2
- backup: yes
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- register: backup_files
- connection: local
-
-- assert:
- that:
- - "backup_files.files is defined"
-
-- debug: msg="END eapi/backup.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/eos_config/tests/eapi/defaults.yaml b/test/integration/targets/eos_config/tests/eapi/defaults.yaml
deleted file mode 100644
index 70ef101eb9..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/defaults.yaml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-- debug: msg="START eapi/defaults.yaml"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: configure device with defaults included
- eos_config:
- src: defaults/config.j2
- defaults: yes
- become: yes
- register: result
-
-- debug: var=result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is defined"
-
-- name: check device with defaults included
- eos_config:
- src: defaults/config.j2
- defaults: yes
- become: yes
- register: result
-
-- debug: var=result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.updates is not defined"
-
-- debug: msg="END eapi/defaults.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/save.yaml b/test/integration/targets/eos_config/tests/eapi/save.yaml
deleted file mode 100644
index 9a6895bec5..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/save.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
----
-- debug: msg="START eapi/save.yaml"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-
-- name: save config always
- eos_config: &always
- save_when: always
- become: yes
- register: result
-
-- assert: &changed
- that:
- - "result.changed == true"
-
-- name: save should always run
- eos_config: *always
- become: yes
- register: result
-
-- assert: *changed
-
-- debug: msg="END eapi/save.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/src_basic.yaml b/test/integration/targets/eos_config/tests/eapi/src_basic.yaml
deleted file mode 100644
index bda5ffba98..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/src_basic.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
----
-- debug: msg="START eapi/src_basic.yaml"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: configure device with config
- eos_config:
- src: basic/config.j2
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-# https://github.com/ansible/ansible-modules-core/issues/4807
- - "result.updates is defined"
-
-- name: check device with config
- eos_config:
- src: basic/config.j2
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-# https://github.com/ansible/ansible-modules-core/issues/4807
- - "result.updates is not defined"
-
-- debug: msg="END eapi/src_basic.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/src_invalid.yaml b/test/integration/targets/eos_config/tests/eapi/src_invalid.yaml
deleted file mode 100644
index d3deade606..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/src_invalid.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-- debug: msg="START eapi/src_invalid.yaml"
-
-
-# Defend https://github.com/ansible/ansible-modules-core/issues/4797
-- name: configure with invalid src
- eos_config:
- src: basic/foobar.j2
- register: result
- ignore_errors: yes
-
-- assert:
- that:
- - "result.changed == false"
- - "result.failed == true"
- - "result.msg == 'path specified in src not found'"
-
-- debug: msg="END eapi/src_invalid.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/src_match_none.yaml b/test/integration/targets/eos_config/tests/eapi/src_match_none.yaml
deleted file mode 100644
index 3485e33334..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/src_match_none.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-- debug: msg="START eapi/src_match_none.yaml"
-
-- name: setup
- eos_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Ethernet2
- match: none
- become: yes
-
-- name: configure device with config
- eos_config:
- src: basic/config.j2
- match: none
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-# https://github.com/ansible/ansible-modules-core/issues/4807
- - "result.updates is defined"
-
-- name: check device with config
- eos_config:
- src: basic/config.j2
- become: yes
- register: result
-
-- assert:
- that:
- # Idempotent test
-# https://github.com/ansible/ansible-modules-core/issues/4807
- - "result.changed == false"
- - "result.updates is not defined"
-
-- debug: msg="END eapi/src_match_none.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/sublevel.yaml b/test/integration/targets/eos_config/tests/eapi/sublevel.yaml
deleted file mode 100644
index 4e9017bf7d..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/sublevel.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-- debug: msg="START eapi/sublevel.yaml"
-
-- name: setup
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- name: configure sub level command
- eos_config:
- lines: 10 permit ip any any log
- parents: ip access-list test
- after: exit
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ip access-list test' in result.updates"
- - "'10 permit ip any any log' in result.updates"
-
-- name: configure sub level command idempotent check
- eos_config:
- lines: 10 permit ip any any log
- parents: ip access-list test
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- debug: msg="END eapi/sublevel.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/sublevel_block.yaml b/test/integration/targets/eos_config/tests/eapi/sublevel_block.yaml
deleted file mode 100644
index e8a05dda0d..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/sublevel_block.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
----
-- debug: msg="START eapi/sublevel_block.yaml"
-
-- name: setup
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- parents: ip access-list test
- before: no ip access-list test
- match: none
- become: yes
-
-- name: configure sub level command using block resplace
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- after: end
- replace: block
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ip access-list test' in result.updates"
- - "'10 permit ip host 192.0.2.1 any log' in result.updates"
- - "'20 permit ip host 192.0.2.2 any log' in result.updates"
- - "'30 permit ip host 192.0.2.3 any log' in result.updates"
- - "'40 permit ip host 192.0.2.4 any log' in result.updates"
-
-- name: check sub level command using block replace
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- replace: block
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- debug: msg="END eapi/sublevel_block.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/sublevel_exact.yaml b/test/integration/targets/eos_config/tests/eapi/sublevel_exact.yaml
deleted file mode 100644
index 048b41a32a..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/sublevel_exact.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
----
-- debug: msg="START eapi/sublevel_exact.yaml"
-
-- name: setup
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- - 50 permit ip host 192.0.2.5 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: none
- become: yes
-
-- name: configure sub level command using exact match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: exact
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ip access-list test' in result.updates"
- - "'10 permit ip host 192.0.2.1 any log' in result.updates"
- - "'20 permit ip host 192.0.2.2 any log' in result.updates"
- - "'30 permit ip host 192.0.2.3 any log' in result.updates"
- - "'40 permit ip host 192.0.2.4 any log' in result.updates"
- - "'50 permit ip host 192.0.2.5 any log' not in result.updates"
-
-- name: check sub level command using exact match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- before: no ip access-list test
- parents: ip access-list test
- match: exact
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- debug: msg="END eapi/sublevel_exact.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/sublevel_strict.yaml b/test/integration/targets/eos_config/tests/eapi/sublevel_strict.yaml
deleted file mode 100644
index cd88c16d95..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/sublevel_strict.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
----
-- debug: msg="START eapi/sublevel_strict.yaml"
-
-- name: setup
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.2 any log
- - 30 permit ip host 192.0.2.3 any log
- - 40 permit ip host 192.0.2.4 any log
- - 50 permit ip host 192.0.2.5 any log
- parents: ip access-list test
- before: no ip access-list test
- match: none
- become: yes
-
-- name: configure sub level command using strict match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.3 any log
- - 30 permit ip host 192.0.2.2 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- before: no ip access-list test
- after: exit
- match: strict
- replace: block
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ip access-list test' in result.updates"
- - "'10 permit ip host 192.0.2.1 any log' in result.updates"
- - "'30 permit ip host 192.0.2.2 any log' in result.updates"
- - "'20 permit ip host 192.0.2.3 any log' in result.updates"
- - "'40 permit ip host 192.0.2.4 any log' in result.updates"
- - "'50 permit ip host 192.0.2.5 any log' not in result.updates"
-
-- name: check sub level command using strict match
- eos_config:
- lines:
- - 10 permit ip host 192.0.2.1 any log
- - 20 permit ip host 192.0.2.3 any log
- - 30 permit ip host 192.0.2.2 any log
- - 40 permit ip host 192.0.2.4 any log
- parents: ip access-list test
- match: strict
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: no ip access-list test
- match: none
- become: yes
-
-- debug: msg="END eapi/sublevel_strict.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/toplevel.yaml b/test/integration/targets/eos_config/tests/eapi/toplevel.yaml
deleted file mode 100644
index ef3c276418..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/toplevel.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
----
-- debug: msg="START eapi/toplevel.yaml"
-
-- name: setup
- eos_config:
- lines: hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- name: configure top level command
- eos_config:
- lines: hostname foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
-
-- name: configure top level command idempotent check
- eos_config:
- lines: hostname foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines: hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- debug: msg="END eapi/toplevel.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/toplevel_after.yaml b/test/integration/targets/eos_config/tests/eapi/toplevel_after.yaml
deleted file mode 100644
index 4e091dd2af..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/toplevel_after.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
----
-- debug: msg="START eapi/toplevel_after.yaml"
-
-- name: setup
- eos_config:
- lines:
- - snmp-server contact ansible
- - "hostname {{ inventory_hostname_short }}"
- match: none
- become: yes
-
-- name: configure top level command with before
- eos_config:
- lines: hostname foo
- after: snmp-server contact bar
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
- - "'snmp-server contact bar' in result.updates"
-
-- name: configure top level command with before idempotent check
- eos_config:
- lines: hostname foo
- after: snmp-server contact foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines:
- - no snmp-server contact
- - hostname {{ inventory_hostname_short }}
- match: none
- become: yes
-
-- debug: msg="END eapi/toplevel_after.yaml"
diff --git a/test/integration/targets/eos_config/tests/eapi/toplevel_before.yaml b/test/integration/targets/eos_config/tests/eapi/toplevel_before.yaml
deleted file mode 100644
index 6ba92ab140..0000000000
--- a/test/integration/targets/eos_config/tests/eapi/toplevel_before.yaml
+++ /dev/null
@@ -1,44 +0,0 @@
----
-- debug: msg="START eapi/toplevel_before.yaml"
-
-- name: setup
- eos_config:
- lines:
- - "snmp-server contact ansible"
- - "hostname {{ inventory_hostname_short }}"
- match: none
- become: yes
-
-- name: configure top level command with before
- eos_config:
- lines: hostname foo
- before: snmp-server contact bar
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.updates"
- - "'snmp-server contact bar' in result.updates"
-
-- name: configure top level command with before idempotent check
- eos_config:
- lines: hostname foo
- before: snmp-server contact foo
- become: yes
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- eos_config:
- lines:
- - no snmp-server contact
- - "hostname {{ inventory_hostname_short }}"
- match: none
- become: yes
-
-- debug: msg="END eapi/toplevel_before.yaml"