mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix integration tests to support remote hosts.
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
---
|
||||
- name: Setup test fixture
|
||||
shell: cat {{ role_path }}/fixtures/ansible-xml-beers.xml | sed 's/^[ ]*//g' > /tmp/ansible-xml-beers.xml
|
||||
copy:
|
||||
src: fixtures/ansible-xml-beers.xml
|
||||
dest: /tmp/ansible-xml-beers.xml.orig
|
||||
|
||||
- name: Remove spaces from test fixture
|
||||
shell: sed 's/^[ ]*//g' < /tmp/ansible-xml-beers.xml.orig > /tmp/ansible-xml-beers.xml
|
||||
|
||||
- name: Pretty print without modification
|
||||
xml:
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
copy:
|
||||
src: /tmp/ansible-xml-namespaced-beers.xml
|
||||
dest: /tmp/ansible-xml-namespaced-beers-1.xml
|
||||
remote_src: yes
|
||||
|
||||
- name: Set child elements again
|
||||
xml:
|
||||
@@ -36,11 +37,13 @@
|
||||
copy:
|
||||
src: /tmp/ansible-xml-namespaced-beers.xml
|
||||
dest: /tmp/ansible-xml-namespaced-beers-2.xml
|
||||
remote_src: yes
|
||||
|
||||
- name: Compare to expected result
|
||||
copy:
|
||||
src: /tmp/ansible-xml-namespaced-beers-1.xml
|
||||
dest: /tmp/ansible-xml-namespaced-beers-2.xml
|
||||
remote_src: yes
|
||||
check_mode: yes
|
||||
diff: yes
|
||||
register: comparison
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
---
|
||||
- name: Copy expected results to remote
|
||||
copy:
|
||||
src: "results/{{ item }}"
|
||||
dest: "/tmp/{{ item }}"
|
||||
with_items:
|
||||
- test-pretty-print.xml
|
||||
- test-pretty-print-only.xml
|
||||
|
||||
# NOTE: Jinja2 templating eats trailing newlines
|
||||
- name: Read from xmlstring (not using pretty_print)
|
||||
xml:
|
||||
@@ -6,11 +14,10 @@
|
||||
xpath: .
|
||||
register: xmlresponse
|
||||
|
||||
|
||||
- name: Compare to expected result
|
||||
copy:
|
||||
content: "{{ xmlresponse.xmlstring }}\n"
|
||||
dest: '{{ role_path }}/results/test-pretty-print-only.xml'
|
||||
dest: '/tmp/test-pretty-print-only.xml'
|
||||
check_mode: yes
|
||||
diff: yes
|
||||
register: comparison
|
||||
@@ -33,7 +40,7 @@
|
||||
- name: Compare to expected result
|
||||
copy:
|
||||
content: '{{ xmlresponse.xmlstring }}'
|
||||
dest: '{{ role_path }}/results/test-pretty-print-only.xml'
|
||||
dest: '/tmp/test-pretty-print-only.xml'
|
||||
check_mode: yes
|
||||
diff: yes
|
||||
register: comparison
|
||||
@@ -60,7 +67,7 @@
|
||||
- name: Compare to expected result
|
||||
copy:
|
||||
content: '{{ xmlresponse_modification.xmlstring }}'
|
||||
dest: '{{ role_path }}/results/test-pretty-print.xml'
|
||||
dest: '/tmp/test-pretty-print.xml'
|
||||
check_mode: yes
|
||||
diff: yes
|
||||
register: comparison
|
||||
|
||||
Reference in New Issue
Block a user