diff options
author | Danny Luwel <info@pc-explore.be> | 2023-12-06 18:02:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-06 18:02:51 +0100 |
commit | 9b002d2e63ec0d39c7c3025dfd4be7489c82016b (patch) | |
tree | 5e601736b41bbb3e7c67c4aff5e8b21f150bea66 /test/integration/targets/lineinfile | |
parent | 🧪 Replace GitHub SVN integration test with local TLS (#82334) (diff) | |
download | ansible-9b002d2e63ec0d39c7c3025dfd4be7489c82016b.tar.xz ansible-9b002d2e63ec0d39c7c3025dfd4be7489c82016b.zip |
check if there attributes to set (#78707)
Fixes: #76727
Diffstat (limited to 'test/integration/targets/lineinfile')
-rw-r--r-- | test/integration/targets/lineinfile/tasks/main.yml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/integration/targets/lineinfile/tasks/main.yml b/test/integration/targets/lineinfile/tasks/main.yml index b7c7f626be..ae34c75759 100644 --- a/test/integration/targets/lineinfile/tasks/main.yml +++ b/test/integration/targets/lineinfile/tasks/main.yml @@ -1418,3 +1418,30 @@ - testend1 is changed - testend2 is changed - testend_file.stat.checksum == 'ef36116966836ce04f6b249fd1837706acae4e19' + +- name: Integration test for issue 76727 + block: + - name: Create a symbolic link for the test file + file: + src: "{{ remote_tmp_dir }}/test.txt" + dest: "{{ remote_tmp_dir }}/test-76727.txt" + state: link + + - name: Insert a line and back it up + lineinfile: + dest: "{{ remote_tmp_dir }}/test-76727.txt" + state: present + line: "#Line for issue 76727" + backup: yes + register: result1 + + - name: Stat the backup file + stat: + path: "{{ result1.backup }}" + register: result2 + + - name: Assert that the line was inserted and backup is created + assert: + that: + - result1 is changed + - result2.stat.exists |