summaryrefslogtreecommitdiff
path: root/test/integration/targets/iosxr_config/tests/cli
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/iosxr_config/tests/cli')
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/backup.yaml123
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml30
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/comment.yaml36
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/commit_label.yaml70
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/misplaced_sublevel.yaml27
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/replace_config.yaml43
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/route_policy.yaml53
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/src_basic.yaml35
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml18
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml37
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel.yaml37
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml54
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml58
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml59
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/sublevel_strict_mul_parents.yaml67
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel.yaml33
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml40
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml40
-rw-r--r--test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml36
19 files changed, 0 insertions, 896 deletions
diff --git a/test/integration/targets/iosxr_config/tests/cli/backup.yaml b/test/integration/targets/iosxr_config/tests/cli/backup.yaml
deleted file mode 100644
index 2ed758b03c..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/backup.yaml
+++ /dev/null
@@ -1,123 +0,0 @@
----
-- debug: msg="START cli/backup.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- connection: local
- register: backup_files
-
-- name: delete backup files
- file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{backup_files.files|default([])}}"
-
-- name: configure device with config
- iosxr_config:
- src: basic/config.j2
- backup: yes
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is not defined"
-
-- name: collect any backup files
- find:
- paths: "{{ role_path }}/backup"
- pattern: "{{ inventory_hostname_short }}_config*"
- connection: local
- register: backup_files
-
-- 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
- iosxr_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
- iosxr_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
- iosxr_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/iosxr_config/tests/cli/comment-too-long.yaml b/test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml
deleted file mode 100644
index 856f9ef386..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/comment-too-long.yaml
+++ /dev/null
@@ -1,30 +0,0 @@
----
-- debug: msg="START cli/comment-too-long.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-# Defend against https://github.com/ansible/ansible-modules-core/issues/5146
-- name: Commit message too long
- iosxr_config:
- src: basic/config.j2
- comment: "this is a really long message aaaaabbbbbbcdde end-of-message"
- register: result
- ignore_errors: true
-
-- assert:
- that:
- - "result.changed == false"
- - "result.updates is not defined"
-# Defend https://github.com/ansible/ansible-modules-core/issues/5146
- - "'comment argument cannot be more than 60 characters' in result.msg"
-# Check for the correct error message (and not a generic "Invalid input detected") once fixed
-
-
-- debug: msg="END cli/comment-too-long.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/comment.yaml b/test/integration/targets/iosxr_config/tests/cli/comment.yaml
deleted file mode 100644
index 9d8fe312b4..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/comment.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-- debug: msg="START cli/comment.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-- name: configure device with comment
- iosxr_config:
- src: basic/config.j2
- comment: "this is sensible commit message"
- exclusive: true
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "result.updates is not defined"
-
-- name: check device with config
- iosxr_config:
- src: basic/config.j2
- exclusive: true
- register: result
-
-- assert:
- that:
- - "result.changed == false"
- - "result.updates is not defined"
-
-- debug: msg="END cli/comment.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/commit_label.yaml b/test/integration/targets/iosxr_config/tests/cli/commit_label.yaml
deleted file mode 100644
index f62ad35bee..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/commit_label.yaml
+++ /dev/null
@@ -1,70 +0,0 @@
----
-- debug: msg="START cli/commit_label.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-- name: get a unique and valid label
- set_fact:
- label: "ansible_{{ 1001 | random | to_uuid | truncate(20, true, '_') }}"
-
-- name: configure device with a label and a comment
- iosxr_config:
- src: basic/config.j2
- comment: "this is sensible commit message"
- label: "{{ label }}"
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-- name: Try to commit with old label, fail with a msg that label is alreay used
- iosxr_config:
- src: basic/config.j2
- label: "{{ label }}"
- register: result
- ignore_errors: true
-
-- assert:
- that:
- - "result.changed == false"
- - "'already used' in result.msg"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-- name: Try to commit with invalid chars($) in label
- iosxr_config:
- src: basic/config.j2
- label: 'ansible_iosxr_config_$'
- register: result
- ignore_errors: true
-
-- assert:
- that:
- - "result.changed == false"
- - "'only contain alphabets' in result.msg"
-
-- debug: msg="END cli/commit_label.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/misplaced_sublevel.yaml b/test/integration/targets/iosxr_config/tests/cli/misplaced_sublevel.yaml
deleted file mode 100644
index 6faa1e4d82..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/misplaced_sublevel.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
----
-- debug: msg="START cli/misplaced_sublevel.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- src: basic/init_prefix_set.j2
- ignore_errors: yes
-
-- name: Change prefix-set and new command after prefix-set
- iosxr_config:
- src: basic/change_prefix_set.j2
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Play same config again to verify no diff in prefix-set also works
- iosxr_config:
- src: basic/change_prefix_set.j2
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- debug: msg="END cli/misplaced_sublevel.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/replace_config.yaml b/test/integration/targets/iosxr_config/tests/cli/replace_config.yaml
deleted file mode 100644
index 719ba2ade3..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/replace_config.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
----
-- debug: msg="START cli/replace_config.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - no interface GigabitEthernet0/0/0/3
-
-- name: replace config (add preconfigured interface)
- iosxr_config: &addreplace
- src: "{{ role_path }}/fixtures/config_add_interface.txt"
- replace: config
- register: result
-
-- assert:
- that:
- - '"load harddisk:/ansible_config.txt" in result.commands'
-
-- name: replace config (add preconfigured interface)(idempotence)
- iosxr_config: *addreplace
- register: result
-
-- assert: &false
- that:
- - 'result.changed == false'
-
-- name: replace config (del preconfigured interface)
- iosxr_config: &delreplace
- src: "{{ role_path }}/fixtures/config_del_interface.txt"
- replace: config
- register: result
-
-- assert:
- that:
- - '"load harddisk:/ansible_config.txt" in result.commands'
-
-- name: replace config (del preconfigured interface)(idempotence)
- iosxr_config: *delreplace
- register: result
-
-- assert: *false
-
-- debug: msg="END cli/replace_config.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/route_policy.yaml b/test/integration/targets/iosxr_config/tests/cli/route_policy.yaml
deleted file mode 100644
index ab6c40d00b..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/route_policy.yaml
+++ /dev/null
@@ -1,53 +0,0 @@
----
-- debug: msg="START cli/route_policy.yaml on connection={{ ansible_connection }}"
-
-- name: Cleanup
- iosxr_config:
- src: basic/route_policy_clean.j2
-
-- name: config setup route-policy/prefix-set/as-path-set/community-set
- iosxr_config:
- src: basic/route_policy.j2
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Configure same route-policy/prefix-set ... verify change=0
- iosxr_config:
- src: basic/route_policy.j2
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: Do a change in multi-sublevel route-policy/prefix-set/community-set
- iosxr_config:
- src: basic/route_policy_change.j2
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: Configure same route-policy/prefix-set ... verify change=0
- iosxr_config:
- src: basic/route_policy_change.j2
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: Cleanup
- iosxr_config:
- src: basic/route_policy_clean.j2
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- debug: msg="END cli/route_policy.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/src_basic.yaml b/test/integration/targets/iosxr_config/tests/cli/src_basic.yaml
deleted file mode 100644
index 7dae193d66..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/src_basic.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
----
-- debug: msg="START cli/src_basic.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-- name: configure device with config
- iosxr_config:
- src: basic/config.j2
- 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
- iosxr_config:
- src: basic/config.j2
- 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/iosxr_config/tests/cli/src_invalid.yaml b/test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml
deleted file mode 100644
index 5f7b6f2dd1..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/src_invalid.yaml
+++ /dev/null
@@ -1,18 +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
- iosxr_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 cli/src_invalid.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml b/test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml
deleted file mode 100644
index dc3b269992..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/src_match_none.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
----
-- debug: msg="START cli/src_match_none.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - no description
- - no shutdown
- parents:
- - interface Loopback999
- match: none
-
-- name: configure device with config
- iosxr_config:
- src: basic/config.j2
- match: none
- 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
- iosxr_config:
- src: basic/config.j2
- 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/iosxr_config/tests/cli/sublevel.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel.yaml
deleted file mode 100644
index 6d27a23149..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel.yaml
+++ /dev/null
@@ -1,37 +0,0 @@
----
-- debug: msg="START cli/sublevel.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands: ['no ipv4 access-list test']
- match: none
- ignore_errors: yes
-
-- name: configure sub level command
- iosxr_config:
- commands: ['10 permit ipv4 any any log']
- parents: ['ipv4 access-list test']
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ipv4 access-list test' in result.commands"
- - "'10 permit ipv4 any any log' in result.commands"
-
-- name: configure sub level command idempotent check
- iosxr_config:
- commands: ['10 permit ipv4 any any log']
- parents: ['ipv4 access-list test']
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- commands: ['no ipv4 access-list test']
- match: none
-
-- debug: msg="END cli/sublevel.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml
deleted file mode 100644
index ddd429617b..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel_block.yaml
+++ /dev/null
@@ -1,54 +0,0 @@
----
-- debug: msg="START cli/sublevel_block.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- parents: ['ipv4 access-list test']
- before: ['no ipv4 access-list test']
- match: none
-
-- name: configure sub level command using block resplace
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- parents: ['ipv4 access-list test']
- replace: block
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ipv4 access-list test' in result.commands"
- - "'10 permit ipv4 host 192.0.2.1 any log' in result.commands"
- - "'20 permit ipv4 host 192.0.2.2 any log' in result.commands"
- - "'30 permit ipv4 host 192.0.2.3 any log' in result.commands"
- - "'40 permit ipv4 host 192.0.2.4 any log' in result.commands"
-
-- name: check sub level command using block replace
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- parents: ['ipv4 access-list test']
- replace: block
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- commands: ['no ipv4 access-list test']
- match: none
-
-- debug: msg="END cli/sublevel_block.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml
deleted file mode 100644
index 9868b933a4..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel_exact.yaml
+++ /dev/null
@@ -1,58 +0,0 @@
----
-- debug: msg="START cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- - 50 permit ipv4 host 192.0.2.5 any log
- parents: ['ipv4 access-list test']
- before: ['no ipv4 access-list test']
- match: none
-
-- name: configure sub level command using exact match
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- parents: ['ipv4 access-list test']
- match: exact
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ipv4 access-list test' in result.commands"
- - "'10 permit ipv4 host 192.0.2.1 any log' in result.commands"
- - "'20 permit ipv4 host 192.0.2.2 any log' in result.commands"
- - "'30 permit ipv4 host 192.0.2.3 any log' in result.commands"
- - "'40 permit ipv4 host 192.0.2.4 any log' in result.commands"
- - "'50 permit ipv4 host 192.0.2.5 any log' not in result.commands"
-
-- name: check sub level command using exact match
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- - 50 permit ipv4 host 192.0.2.5 any log
- parents: ['ipv4 access-list test']
- match: exact
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- commands: ['no ipv4 access-list test']
- match: none
-
-- debug: msg="END cli/sublevel_exact.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml
deleted file mode 100644
index 2c3c865189..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel_strict.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
----
-- debug: msg="START cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.3 any log
- - 30 permit ipv4 host 192.0.2.2 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- - 50 permit ipv4 host 192.0.2.5 any log
- parents: ['ipv4 access-list test']
- before: ['no ipv4 access-list test']
- match: none
-
-- name: configure sub level command using strict match
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- parents: ['ipv4 access-list test']
- before: ['no ipv4 access-list test']
- match: strict
- replace: block
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'ipv4 access-list test' in result.commands"
- - "'10 permit ipv4 host 192.0.2.1 any log' in result.commands"
- - "'20 permit ipv4 host 192.0.2.2 any log' in result.commands"
- - "'30 permit ipv4 host 192.0.2.3 any log' in result.commands"
- - "'40 permit ipv4 host 192.0.2.4 any log' in result.commands"
- - "'50 permit ipv4 host 192.0.2.5 any log' not in result.commands"
-
-- name: check sub level command using strict match
- iosxr_config:
- commands:
- - 10 permit ipv4 host 192.0.2.1 any log
- - 20 permit ipv4 host 192.0.2.2 any log
- - 30 permit ipv4 host 192.0.2.3 any log
- - 40 permit ipv4 host 192.0.2.4 any log
- parents: ['ipv4 access-list test']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- commands: ['no ipv4 access-list test']
- match: none
-
-- debug: msg="END cli/sublevel_strict.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/sublevel_strict_mul_parents.yaml b/test/integration/targets/iosxr_config/tests/cli/sublevel_strict_mul_parents.yaml
deleted file mode 100644
index b06c0570d5..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/sublevel_strict_mul_parents.yaml
+++ /dev/null
@@ -1,67 +0,0 @@
----
-- debug: msg="START cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- lines:
- - class-map match-any c1
- - match precedence 7
- - policy-map p1
- - class c1
- - set precedence 2
- before: ['no policy-map p1', 'no class-map match-any c1']
- match: none
-
-- name: configure sub level command using strict match
- iosxr_config:
- lines:
- - set precedence 5
- - police rate percent 10
- parents: ['policy-map p1', 'class c1']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'set precedence 5' in result.commands"
- - "'police rate percent 10' in result.commands"
-
-- name: change sub level command order and config with strict match
- iosxr_config:
- lines:
- - police rate percent 10
- - set precedence 5
- parents: ['policy-map p1', 'class c1']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'set precedence 5' in result.commands"
- - "'police rate percent 10' in result.commands"
-
-- name: Config sub level command with strict match (Idempotency)
- iosxr_config:
- lines:
-#IOSxr does not change order of class action if reconfigured
-#so we have to use old order for Idempotency
- - set precedence 5
- - police rate percent 10
- parents: ['policy-map p1', 'class c1']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- lines:
- - no policy-map p1
- - no class-map match-any c1
- match: none
-
-- debug: msg="END cli/sublevel_strict_mul_parents.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel.yaml
deleted file mode 100644
index 01f9665fc9..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
----
-- debug: msg="START cli/toplevel.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands: ['hostname {{ inventory_hostname_short }}']
- match: none
-
-- name: configure top level command
- iosxr_config:
- commands: ['hostname foo']
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.commands"
-
-- name: configure top level command idempotent check
- iosxr_config:
- commands: ['hostname foo']
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- commands: ['hostname {{ inventory_hostname_short }}']
- match: none
-
-- debug: msg="END cli/toplevel.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml
deleted file mode 100644
index 7fcb78a7e3..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel_after.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-- debug: msg="START cli/toplevel_after.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - "no cdp"
- - "hostname {{ inventory_hostname_short }}"
- match: none
-
-- name: configure top level command with before
- iosxr_config:
- commands: ['hostname foo']
- after: ['cdp']
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.commands"
- - "'cdp' in result.commands"
-
-- name: configure top level command with before idempotent check
- iosxr_config:
- commands: ['hostname foo']
- after: ['no cdp']
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- commands:
- - "no cdp"
- - "hostname {{ inventory_hostname_short }}"
- match: none
-
-- debug: msg="END cli/toplevel_after.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml
deleted file mode 100644
index 4c264269cf..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel_before.yaml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-- debug: msg="START cli/toplevel_before.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands:
- - "no cdp"
- - "hostname {{ inventory_hostname_short }}"
- match: none
-
-- name: configure top level command with before
- iosxr_config:
- commands: ['hostname foo']
- before: ['cdp']
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.commands"
- - "'cdp' in result.commands"
-
-- name: configure top level command with before idempotent check
- iosxr_config:
- commands: ['hostname foo']
- before: ['cdp']
- register: result
-
-- assert:
- that:
- - "result.changed == false"
-
-- name: teardown
- iosxr_config:
- commands:
- - "no cdp"
- - "hostname {{ inventory_hostname_short }}"
- match: none
-
-- debug: msg="END cli/toplevel_before.yaml on connection={{ ansible_connection }}"
diff --git a/test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml b/test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml
deleted file mode 100644
index 084a38cc24..0000000000
--- a/test/integration/targets/iosxr_config/tests/cli/toplevel_nonidempotent.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-- debug: msg="START cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"
-
-- name: setup
- iosxr_config:
- commands: ['hostname {{ inventory_hostname_short }}']
- match: none
-
-- name: configure top level command
- iosxr_config:
- commands: ['banner motd "hello world"', 'hostname foo']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
- - "'hostname foo' in result.commands"
- - "'banner motd \"hello world\"' in result.commands"
-
-- name: configure top level command idempotent check
- iosxr_config:
- commands: ['banner motd "hello world"', 'hostname foo']
- match: strict
- register: result
-
-- assert:
- that:
- - "result.changed == true"
-
-- name: teardown
- iosxr_config:
- commands: ['hostname {{ inventory_hostname_short }}']
- match: none
-
-- debug: msg="END cli/toplevel_nonidempotent.yaml on connection={{ ansible_connection }}"