From 288fe1179a827e0457f36d3b465d5e12bd48162d Mon Sep 17 00:00:00 2001 From: jaypei Date: Wed, 29 Apr 2015 19:39:39 +0800 Subject: [PATCH] Add lineinfile integration tests for quoted string Reference #10864 --- .../roles/test_lineinfile/tasks/main.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/integration/roles/test_lineinfile/tasks/main.yml b/test/integration/roles/test_lineinfile/tasks/main.yml index d809bf1983..0c018ccaa5 100644 --- a/test/integration/roles/test_lineinfile/tasks/main.yml +++ b/test/integration/roles/test_lineinfile/tasks/main.yml @@ -355,4 +355,22 @@ that: - "result.stat.checksum == '73b271c2cc1cef5663713bc0f00444b4bf9f4543'" +- name: insert a line into the quoted file with many double quotation strings + lineinfile: dest={{output_dir}}/test_quoting.txt line="\"quote\" and \"unquote\"" + register: result + +- name: assert that the quoted file was changed + assert: + that: + - result.changed + +- name: stat the quote test file + stat: path={{output_dir}}/test_quoting.txt + register: result + +- name: assert test checksum matches after backref line was replaced + assert: + that: + - "result.stat.checksum == 'b10ab2a3c3b6492680c8d0b1d6f35aa6b8f9e731'" + ###################################################################