diff options
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 |