summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorstronkbyte <262002943+stronkbyte@users.noreply.github.com>2026-05-25 13:44:54 +0200
committerGitHub <noreply@github.com>2026-05-25 07:44:54 -0400
commit29e47bb4b43d1888c79f54de2fbee90224e9652b (patch)
tree6650bbdbc7805928d5274e2c6df59b1fc2ece34f /tests
parente8acd05dd327bd4eb2419de1b931960feddec427 (diff)
downloadvyos.vyos-29e47bb4b43d1888c79f54de2fbee90224e9652b.tar.gz
vyos.vyos-29e47bb4b43d1888c79f54de2fbee90224e9652b.zip
T6818: Add argument to vyos_config for controlling password filtering (#466)
This commit adds the argument `allow_password_change` in order to control whether any configuration lines which would make changes to user passwords should be filtered out or not. Co-authored-by: Daniil Baturin <daniil@baturin.org> Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/targets/vyos_config/tests/cli/check_config.yaml34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/integration/targets/vyos_config/tests/cli/check_config.yaml b/tests/integration/targets/vyos_config/tests/cli/check_config.yaml
index 8e2e8372..83a62197 100644
--- a/tests/integration/targets/vyos_config/tests/cli/check_config.yaml
+++ b/tests/integration/targets/vyos_config/tests/cli/check_config.yaml
@@ -49,9 +49,43 @@
- set system login user esa authentication encrypted-password '!abc!'
- set system login user vyos full-name 'VyOS admin'
- set system login user vyos authentication encrypted-password 'abc'
+ - set system login user john full-name 'John'
+ - set system login user john authentication plaintext-password 'xyz'
- assert:
that:
- result.filtered|length == 2
+- name: check multiple line config filter is working
+ register: result
+ vyos.vyos.vyos_config:
+ allow_password_change: none
+ lines:
+ - set system login user esa full-name 'ESA admin'
+ - set system login user esa authentication encrypted-password '!abc!'
+ - set system login user vyos full-name 'VyOS admin'
+ - set system login user vyos authentication encrypted-password 'abc'
+ - set system login user john full-name 'John'
+ - set system login user john authentication plaintext-password 'xyz'
+
+- assert:
+ that:
+ - result.filtered|length == 3
+
+- name: check multiple line config filter is working
+ register: result
+ vyos.vyos.vyos_config:
+ allow_password_change: all
+ lines:
+ - set system login user esa full-name 'ESA admin'
+ - set system login user esa authentication encrypted-password '!abc!'
+ - set system login user vyos full-name 'VyOS admin'
+ - set system login user vyos authentication encrypted-password 'abc'
+ - set system login user john full-name 'John'
+ - set system login user john authentication plaintext-password 'xyz'
+
+- assert:
+ that:
+ - result.filtered|length == 0
+
- debug: msg="END cli/config_check.yaml on connection={{ ansible_connection }}"