summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorMajesticMagikarpKing <69774548+yctomwang@users.noreply.github.com>2024-07-07 21:26:14 +0200
committerGitHub <noreply@github.com>2024-07-07 21:26:14 +0200
commitedce79871333d2d3d4812a5c74e974a58eeaffb3 (patch)
tree8cfd203409fe01bb8ad2fe82d889585912039d25 /test/integration
parentvalidate-modules: reject option/alias names equal up to casing belonging to d... (diff)
downloadansible-edce79871333d2d3d4812a5c74e974a58eeaffb3.tar.xz
ansible-edce79871333d2d3d4812a5c74e974a58eeaffb3.zip
Fix Creating user directory using tilde always reports "changed" (#83113)
Fixes: #82490
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/targets/user/tasks/test_create_user.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/integration/targets/user/tasks/test_create_user.yml b/test/integration/targets/user/tasks/test_create_user.yml
index 644dbebbc5..44707dc7fb 100644
--- a/test/integration/targets/user/tasks/test_create_user.yml
+++ b/test/integration/targets/user/tasks/test_create_user.yml
@@ -77,3 +77,28 @@
that:
- "'RealName: ansibulluser' in user_test2.stdout_lines "
- "'PrimaryGroupID: 20' in user_test2.stdout_lines "
+
+#https://github.com/ansible/ansible/issues/82490
+- name: Create a new user with custom shell to test ~ expansion
+ user:
+ name: randomuserthomas
+ shell: ~/custom_shell
+ register: user_create_result
+
+- name: Create a new user with custom shell to test ~ expansion second time should show ok not changed
+ user:
+ name: randomuserthomas
+ shell: ~/custom_shell
+ register: user_creation_result
+
+- name: Assert that the user with a tilde in the shell path is created
+ assert:
+ that:
+ - user_creation_result is not changed
+ - user_create_result is changed
+
+- name: remove the randomuserthomas user to clean up
+ user:
+ name: randomuserthomas
+ state: absent
+ force: true \ No newline at end of file