summaryrefslogtreecommitdiff
path: root/test/integration/targets/vyos_config
diff options
context:
space:
mode:
authorDeepak Agrawal <deepacks@gmail.com>2018-02-20 18:29:34 +0530
committerGitHub <noreply@github.com>2018-02-20 18:29:34 +0530
commit0bbea9a57973ddfadbe1e5f456fa57c23404ff9c (patch)
tree5267fd53f3a8f0247c9e02100823ac57df089a7a /test/integration/targets/vyos_config
parent000387ac238dc8d9cdbbfc565702903c2c3736c6 (diff)
downloadansible-0bbea9a57973ddfadbe1e5f456fa57c23404ff9c.tar.gz
vyos_config IndexError in sanitize_config (#36375)
* Bug in del(list) logic. Say you have a list of 4 elements a[0-3] and you have to remove index 1 and 3, if you remove index 1 first then list is cut short a[0-2] and does not have index 3 Fix: Remove indexes in reverse sorted order e.g. 3 and 1 in above example so that order of indexes remain preserved even after deleting fix is to remove indexes in reverse sorted order * Add test cases for failed case
Diffstat (limited to 'test/integration/targets/vyos_config')
-rw-r--r--test/integration/targets/vyos_config/tests/cli/check_config.yaml13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/integration/targets/vyos_config/tests/cli/check_config.yaml b/test/integration/targets/vyos_config/tests/cli/check_config.yaml
index 7612b1fe72..65076b3c54 100644
--- a/test/integration/targets/vyos_config/tests/cli/check_config.yaml
+++ b/test/integration/targets/vyos_config/tests/cli/check_config.yaml
@@ -47,4 +47,17 @@
that:
- "result.changed == false"
+- name: check multiple line config filter is working
+ vyos_config:
+ lines:
+ - set system login user esa level admin
+ - set system login user esa authentication encrypted-password '!abc!'
+ - set system login user vyos level admin
+ - set system login user vyos authentication encrypted-password 'abc'
+ register: result
+
+- assert:
+ that:
+ - "{{ result.filtered|length }} == 2"
+
- debug: msg="END cli/config_check.yaml on connection={{ ansible_connection }}"