diff options
author | Matt Clay <matt@mystile.com> | 2022-07-19 23:59:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 23:59:36 +0200 |
commit | 27d39be5807a2c36f7074e6a580bdaefa7abdde0 (patch) | |
tree | 826578b029e39bfe7d06d9c113911309e09ccae4 /test/integration/targets/become/tasks | |
parent | Drop custom repo from libuser install @ Alpine CI (#78305) (diff) | |
download | ansible-27d39be5807a2c36f7074e6a580bdaefa7abdde0.tar.xz ansible-27d39be5807a2c36f7074e6a580bdaefa7abdde0.zip |
Fix become integration test. (#78313)
* Don't set become_flags in become integration test.
Setting the flags in the test overrides the default value in the become plugins, which was not intentional.
* Remove hack for broken implicit tilde support.
It was only broken because the tests were overriding the default become flags for sudo.
* Simplify assertions.
Diffstat (limited to 'test/integration/targets/become/tasks')
-rw-r--r-- | test/integration/targets/become/tasks/become.yml | 10 | ||||
-rw-r--r-- | test/integration/targets/become/tasks/main.yml | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/test/integration/targets/become/tasks/become.yml b/test/integration/targets/become/tasks/become.yml index e581e1bb0a..d31634fc74 100644 --- a/test/integration/targets/become/tasks/become.yml +++ b/test/integration/targets/become/tasks/become.yml @@ -2,7 +2,7 @@ raw: whoami register: whoami -- name: implicit tilde expansion reflects become user (broken={{ become_test_config.implicit_tilde_broken | default(False) }}) ({{ become_test }}) +- name: implicit tilde expansion reflects become user ({{ become_test }}) stat: path: "~" register: stat_home_implicit @@ -32,13 +32,13 @@ - name: verify results from previous tasks ({{ become_test }}) assert: that: - - "whoami.stdout|trim == '{{ ansible_become_user }}'" + - "whoami.stdout|trim == ansible_become_user" - "stat_home_implicit.stat.exists == True" - - "stat_home_implicit.stat.path|basename == '{{ ansible_become_user }}' or (become_test_config.implicit_tilde_broken | default(False))" + - "stat_home_implicit.stat.path|basename == ansible_become_user" - "stat_home_explicit.stat.exists == True" - - "stat_home_explicit.stat.path|basename == '{{ ansible_become_user }}'" + - "stat_home_explicit.stat.path|basename == ansible_become_user" - "put_file.uid == test_user.uid" - "put_file.gid == test_user.group" @@ -46,4 +46,4 @@ - "fetch_file.remote_checksum == put_file.checksum" - "stat_file.stat.exists == True" - - "stat_file.stat.path|dirname|basename == '{{ ansible_become_user }}'" + - "stat_file.stat.path|dirname|basename == ansible_become_user" diff --git a/test/integration/targets/become/tasks/main.yml b/test/integration/targets/become/tasks/main.yml index 286624c57b..4a2ce64b2c 100644 --- a/test/integration/targets/become/tasks/main.yml +++ b/test/integration/targets/become/tasks/main.yml @@ -9,7 +9,6 @@ vars: ansible_become: yes ansible_become_user: "{{ become_test_config.user }}" - ansible_become_flags: "{{ become_test_config.flags | default(None) }}" ansible_become_method: "{{ become_test_config.method }}" ansible_become_password: "{{ become_test_config.password | default(None) }}" loop: "{{ |