mirror of https://github.com/ansible/ansible.git
xml module: Better change detection, improved tests (#28460)
This PR includes: - Improvements to change-detection by comparing 2 objectified XML trees - Implement better integration tests by comparing 2 files using copypull/27817/head
parent
3302248616
commit
2634ef955a
@ -1,15 +1,29 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add child element
|
- name: Add child element
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
add_children:
|
add_children:
|
||||||
- beer: "Окское"
|
- beer: Окское
|
||||||
|
register: add_children_elements_unicode
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-add-children-elements-unicode.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-add-children-elements-unicode.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- add_children_elements_unicode.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-add-children-elements-unicode.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,15 +1,29 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add child element
|
- name: Add child element
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
add_children:
|
add_children:
|
||||||
- beer: "Old Rasputin"
|
- beer: Old Rasputin
|
||||||
|
register: add_children_elements
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-add-children-elements.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-add-children-elements.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- add_children_elements.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-add-children-elements.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,14 +1,28 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add child element
|
- name: Add child element
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
add_children: "{{ bad_beers }}"
|
add_children: '{{ bad_beers }}'
|
||||||
|
register: add_children_from_groupvars
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-add-children-from-groupvars.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-add-children-from-groupvars.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- add_children_from_groupvars.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-add-children-from-groupvars.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,17 +1,31 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add child element
|
- name: Add child element
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
add_children:
|
add_children:
|
||||||
- beer:
|
- beer:
|
||||||
name: Окское
|
name: Окское
|
||||||
type: экстра
|
type: экстра
|
||||||
|
register: add_children_with_attributes_unicode
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-add-children-with-attributes-unicode.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-add-children-with-attributes-unicode.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- add_children_with_attributes_unicode.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-add-children-with-attributes-unicode.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,22 +1,35 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add child element
|
- name: Add child element
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
add_children:
|
add_children:
|
||||||
- beer:
|
- beer:
|
||||||
name: Ansible Brew
|
name: Ansible Brew
|
||||||
type: light
|
type: light
|
||||||
|
register: add_children_with_attributes
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-add-children-with-attributes.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
# NOTE: This test may fail if lxml does not support predictable element attribute order
|
# NOTE: This test may fail if lxml does not support predictable element attribute order
|
||||||
# So we filter the failure out for these platforms (e.g. CentOS 6)
|
# So we filter the failure out for these platforms (e.g. CentOS 6)
|
||||||
# The module still works fine, we simply are not comparing as smart as we should.
|
# The module still works fine, we simply are not comparing as smart as we should.
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-add-children-with-attributes.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
register: diff
|
that:
|
||||||
failed_when: diff.rc != 0 and lxml_predictable_attribute_order
|
- add_children_with_attributes.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
when: lxml_predictable_attribute_order
|
||||||
|
#command: diff -u {{ role_path }}/results/test-add-children-with-attributes.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,16 +1,30 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add child element with xml format
|
- name: Add child element with xml format
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
input_type: xml
|
input_type: xml
|
||||||
add_children:
|
add_children:
|
||||||
- "<beer>Old Rasputin</beer>"
|
- '<beer>Old Rasputin</beer>'
|
||||||
|
register: children_elements
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-add-children-elements.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes·
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-add-children-elements.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- children_elements.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-add-children-elements.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers-unicode.xml'
|
src: fixtures/ansible-xml-beers-unicode.xml
|
||||||
dest: /tmp/ansible-xml-beers-unicode.xml
|
dest: /tmp/ansible-xml-beers-unicode.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Count child element
|
- name: Count child element
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers-unicode.xml
|
path: /tmp/ansible-xml-beers-unicode.xml
|
||||||
xpath: /business/beers/beer
|
xpath: /business/beers/beer
|
||||||
count: true
|
count: yes
|
||||||
register: beers
|
register: beers
|
||||||
failed_when: beers.count != 2
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- beers.changed == false
|
||||||
|
- beers.count == 2
|
||||||
|
@ -1,13 +1,19 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add child element
|
- name: Add child element
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers/beer
|
xpath: /business/beers/beer
|
||||||
count: true
|
count: yes
|
||||||
register: beers
|
register: beers
|
||||||
failed_when: beers.count != 3
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- beers.changed == false
|
||||||
|
- beers.count == 3
|
||||||
|
@ -1,21 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers-unicode.xml'
|
src: fixtures/ansible-xml-beers-unicode.xml
|
||||||
dest: /tmp/ansible-xml-beers-unicode.xml
|
dest: /tmp/ansible-xml-beers-unicode.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Get element attributes
|
- name: Get element attributes
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers-unicode.xml
|
path: /tmp/ansible-xml-beers-unicode.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
content: 'attribute'
|
content: attribute
|
||||||
register: get_element_attribute
|
register: get_element_attribute
|
||||||
failed_when: get_element_attribute.matches[0]['rating'] is not defined or get_element_attribute.matches[0]['rating']['subjective'] != 'да'
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- get_element_attribute.changed == false
|
||||||
|
- get_element_attribute.matches[0]['rating'] is defined and get_element_attribute.matches[0]['rating']['subjective'] == 'да'
|
||||||
|
|
||||||
- name: Get element text
|
- name: Get element text
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers-unicode.xml
|
path: /tmp/ansible-xml-beers-unicode.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
content: 'text'
|
content: text
|
||||||
register: get_element_text
|
register: get_element_text
|
||||||
failed_when: get_element_text.matches[0]['rating'] != 'десять'
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- get_element_text.changed == false
|
||||||
|
- get_element_text.matches[0]['rating'] == 'десять'
|
||||||
|
@ -1,21 +1,32 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Get element attributes
|
- name: Get element attributes
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
content: 'attribute'
|
content: attribute
|
||||||
register: get_element_attribute
|
register: get_element_attribute
|
||||||
failed_when: get_element_attribute.matches[0]['rating'] is not defined or get_element_attribute.matches[0]['rating']['subjective'] != 'true'
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- get_element_attribute.changed == false
|
||||||
|
- get_element_attribute.matches[0]['rating'] is defined and get_element_attribute.matches[0]['rating']['subjective'] == 'true'
|
||||||
|
|
||||||
- name: Get element text
|
- name: Get element text
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
content: 'text'
|
content: text
|
||||||
register: get_element_text
|
register: get_element_text
|
||||||
failed_when: get_element_text.matches[0]['rating'] != '10'
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- get_element_text.changed == false
|
||||||
|
- get_element_text.matches[0]['rating'] == '10'
|
||||||
|
@ -1,15 +1,22 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Specify both children to add and a value
|
- name: Specify both children to add and a value
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
add_children:
|
add_children:
|
||||||
- child01
|
- child01
|
||||||
- child02
|
- child02
|
||||||
value: conflict!
|
value: conflict!
|
||||||
register: module_output
|
register: module_output
|
||||||
failed_when: "module_output.failed == 'false'"
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- module_output.changed == false
|
||||||
|
- module_output.failed == true
|
||||||
|
@ -1,16 +1,30 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Pretty print
|
- name: Pretty print
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
pretty_print: True
|
pretty_print: yes
|
||||||
add_children:
|
add_children:
|
||||||
- beer: "Old Rasputin"
|
- beer: Old Rasputin
|
||||||
|
register: pretty_print
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-pretty-print.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-pretty-print.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- pretty_print.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-pretty-print.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,14 +1,28 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Remove '/business/rating/@subjective'
|
- name: Remove '/business/rating/@subjective'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating/@subjective
|
xpath: /business/rating/@subjective
|
||||||
ensure: absent
|
state: absent
|
||||||
|
register: remove_attribute
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-remove-attribute.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-remove-attribute.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- remove_attribute.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-remove-attribute.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,14 +1,28 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Remove '/business/rating'
|
- name: Remove '/business/rating'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
ensure: absent
|
state: absent
|
||||||
|
register: remove_element
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-remove-element.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-remove-element.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- remove_element.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-remove-element.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,16 +1,29 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Set '/business/rating/@subjective' to 'нет'
|
- name: Set '/business/rating/@subjective' to 'нет'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
attribute: subjective
|
attribute: subjective
|
||||||
value: "нет"
|
value: нет
|
||||||
|
register: set_attribute_value_unicode
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-set-attribute-value-unicode.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-set-attribute-value-unicode.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
changed_when: False
|
that:
|
||||||
|
- set_attribute_value_unicode.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-attribute-value-unicode.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,16 +1,29 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Set '/business/rating/@subjective' to 'false'
|
- name: Set '/business/rating/@subjective' to 'false'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
attribute: subjective
|
attribute: subjective
|
||||||
value: "false"
|
value: 'false'
|
||||||
|
register: set_attribute_value
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-set-attribute-value.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-set-attribute-value.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
changed_when: False
|
that:
|
||||||
|
- set_attribute_value.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-attribute-value.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,27 +1,46 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
command: cp {{ role_path }}/fixtures/ansible-xml-beers.xml /tmp/ansible-xml-beers.xml
|
copy:
|
||||||
|
src: fixtures/ansible-xml-beers.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Set child elements
|
- name: Set child elements
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
set_children:
|
set_children: &children
|
||||||
- beer: "Окское"
|
- beer: Окское
|
||||||
- beer: "Невское"
|
- beer: Невское
|
||||||
|
register: set_children_elements_unicode
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-set-children-elements-unicode.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-set-children-elements-unicode.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- set_children_elements_unicode.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-children-elements-unicode.xml /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
- name: Set child elements
|
|
||||||
xml:
|
|
||||||
path: /tmp/ansible-xml-beers.xml
|
|
||||||
xpath: /business/beers
|
|
||||||
set_children:
|
|
||||||
- beer: "Окское"
|
|
||||||
- beer: "Невское"
|
|
||||||
register: set_children_again
|
|
||||||
|
|
||||||
- fail:
|
- name: Compare to expected result
|
||||||
msg: "Setting children is not idempotent!"
|
copy:
|
||||||
when: set_children_again.changed
|
src: results/test-set-children-elements-unicode.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- set_children_again.changed == false
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-children-elements-unicode.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,27 +1,53 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
command: cp {{ role_path }}/fixtures/ansible-xml-beers.xml /tmp/ansible-xml-beers.xml
|
copy:
|
||||||
|
src: fixtures/ansible-xml-beers.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Set child elements
|
- name: Set child elements
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
set_children:
|
set_children: &children
|
||||||
- beer: "90 Minute IPA"
|
- beer: 90 Minute IPA
|
||||||
- beer: "Harvest Pumpkin Ale"
|
- beer: Harvest Pumpkin Ale
|
||||||
|
register: set_children_elements
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-set-children-elements.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-set-children-elements.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- set_children_elements.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-children-elements.xml /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
- name: Set child elements
|
|
||||||
|
- name: Set child elements (again)
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
set_children:
|
set_children: *children
|
||||||
- beer: "90 Minute IPA"
|
|
||||||
- beer: "Harvest Pumpkin Ale"
|
|
||||||
register: set_children_again
|
register: set_children_again
|
||||||
|
|
||||||
- fail:
|
- name: Compare to expected result
|
||||||
msg: "Setting children is not idempotent!"
|
copy:
|
||||||
when: set_children_again.changed
|
src: results/test-set-children-elements.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- set_children_again.changed == false
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-children-elements.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,14 +1,28 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
- name: Set /business/website/address to empty string.
|
|
||||||
|
- name: Set '/business/website/address' to empty string.
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/website/address
|
xpath: /business/website/address
|
||||||
value: ''
|
value: ''
|
||||||
|
register: set_element_value_empty
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: results/test-set-element-value-empty.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-set-element-value-empty.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- set_element_value_empty.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-element-value-empty.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,37 +1,43 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add 2nd '/business/rating' with value 'пять'
|
- name: Add 2nd '/business/rating' with value 'пять'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business
|
xpath: /business
|
||||||
add_children:
|
add_children:
|
||||||
- rating: "пять"
|
- rating: пять
|
||||||
|
|
||||||
- name: Set '/business/rating' to 'пять'
|
- name: Set '/business/rating' to 'пять'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
value: "пять"
|
value: пять
|
||||||
register: set_element_first_run
|
register: set_element_first_run
|
||||||
|
|
||||||
- name: Set '/business/rating' to 'false'... again
|
- name: Set '/business/rating' to 'false'... again
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
value: "пять"
|
value: пять
|
||||||
register: set_element_second_run
|
register: set_element_second_run
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Compare to expected result
|
||||||
command: diff -u {{ role_path }}/results/test-set-element-value-unicode.xml /tmp/ansible-xml-beers.xml
|
copy:
|
||||||
changed_when: no
|
src: results/test-set-element-value-unicode.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test registered 'changed' on run 1 and unchanged on run 2
|
- name: Test expected result
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- set_element_first_run.changed
|
- set_element_first_run.changed == true
|
||||||
- not set_element_second_run.changed
|
- set_element_second_run.changed == false
|
||||||
...
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-element-value-unicode.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -1,37 +1,43 @@
|
|||||||
---
|
---
|
||||||
- name: Setup test fixture
|
- name: Setup test fixture
|
||||||
copy:
|
copy:
|
||||||
src: '{{ role_path }}/fixtures/ansible-xml-beers.xml'
|
src: fixtures/ansible-xml-beers.xml
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
- name: Add 2nd '/business/rating' with value '5'
|
- name: Add 2nd '/business/rating' with value '5'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business
|
xpath: /business
|
||||||
add_children:
|
add_children:
|
||||||
- rating: "5"
|
- rating: '5'
|
||||||
|
|
||||||
- name: Set '/business/rating' to '5'
|
- name: Set '/business/rating' to '5'
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
value: "5"
|
value: '5'
|
||||||
register: set_element_first_run
|
register: set_element_first_run
|
||||||
|
|
||||||
- name: Set '/business/rating' to 'false'... again
|
- name: Set '/business/rating' to '5'... again
|
||||||
xml:
|
xml:
|
||||||
path: /tmp/ansible-xml-beers.xml
|
path: /tmp/ansible-xml-beers.xml
|
||||||
xpath: /business/rating
|
xpath: /business/rating
|
||||||
value: "5"
|
value: '5'
|
||||||
register: set_element_second_run
|
register: set_element_second_run
|
||||||
|
|
||||||
- name: Test expected result
|
- name: Compare to expected result
|
||||||
command: diff -u {{ role_path }}/results/test-set-element-value.xml /tmp/ansible-xml-beers.xml
|
copy:
|
||||||
changed_when: no
|
src: results/test-set-element-value.xml
|
||||||
|
dest: /tmp/ansible-xml-beers.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
- name: Test registered 'changed' on run 1 and unchanged on run 2
|
- name: Test expected result
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- set_element_first_run.changed
|
- set_element_first_run.changed == true
|
||||||
- not set_element_second_run.changed
|
- set_element_second_run.changed == false
|
||||||
...
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-set-element-value.xml /tmp/ansible-xml-beers.xml
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
- name: Setup test fixture
|
||||||
|
copy:
|
||||||
|
src: fixtures/ansible-xml-namespaced-beers.xml
|
||||||
|
dest: /tmp/ansible-xml-namespaced-beers-xml.xml
|
||||||
|
|
||||||
|
- name: Set child elements
|
||||||
|
xml:
|
||||||
|
path: /tmp/ansible-xml-namespaced-beers-xml.xml
|
||||||
|
xpath: /bus:business/ber:beers
|
||||||
|
namespaces:
|
||||||
|
bus: http://test.business
|
||||||
|
ber: http://test.beers
|
||||||
|
set_children:
|
||||||
|
- beer: 90 Minute IPA
|
||||||
|
- beer: Harvest Pumpkin Ale
|
||||||
|
|
||||||
|
- name: Copy state after first set_children
|
||||||
|
copy:
|
||||||
|
src: /tmp/ansible-xml-namespaced-beers.xml
|
||||||
|
dest: /tmp/ansible-xml-namespaced-beers-1.xml
|
||||||
|
|
||||||
|
- name: Set child elements again
|
||||||
|
xml:
|
||||||
|
path: /tmp/ansible-xml-namespaced-beers-xml.xml
|
||||||
|
xpath: /bus:business/ber:beers
|
||||||
|
namespaces:
|
||||||
|
bus: http://test.business
|
||||||
|
ber: http://test.beers
|
||||||
|
set_children:
|
||||||
|
- beer: 90 Minute IPA
|
||||||
|
- beer: Harvest Pumpkin Ale
|
||||||
|
register: set_children_again
|
||||||
|
|
||||||
|
- name: Copy state after second set_children
|
||||||
|
copy:
|
||||||
|
src: /tmp/ansible-xml-namespaced-beers.xml
|
||||||
|
dest: /tmp/ansible-xml-namespaced-beers-2.xml
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
src: /tmp/ansible-xml-namespaced-beers-1.xml
|
||||||
|
dest: /tmp/ansible-xml-namespaced-beers-2.xml
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
#command: diff /tmp/ansible-xml-namespaced-beers-1.xml /tmp/ansible-xml-namespaced-beers-2.xml
|
||||||
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- set_children_again.changed == false # idempotency
|
||||||
|
- set_namespaced_attribute_value.changed == true
|
||||||
|
- comparison.changed == false # identical
|
@ -1,31 +1,74 @@
|
|||||||
---
|
---
|
||||||
- name: Read from xmlstring
|
# NOTE: Jinja2 templating eats trailing newlines
|
||||||
|
- name: Read from xmlstring (not using pretty_print)
|
||||||
|
xml:
|
||||||
|
xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
|
||||||
|
xpath: .
|
||||||
|
register: xmlresponse
|
||||||
|
|
||||||
|
|
||||||
|
- name: Compare to expected result
|
||||||
|
copy:
|
||||||
|
content: "{{ xmlresponse.xmlstring }}\n"
|
||||||
|
dest: '{{ role_path }}/results/test-pretty-print-only.xml'
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
|
- name: Test expected result
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- xmlresponse.changed == false
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-pretty-print-only.xml /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE: Jinja2 templating eats trailing newlines
|
||||||
|
- name: Read from xmlstring (using pretty_print)
|
||||||
xml:
|
xml:
|
||||||
xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
|
xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
|
||||||
pretty_print: True
|
pretty_print: yes
|
||||||
register: xmlresponse
|
register: xmlresponse
|
||||||
|
|
||||||
- name: Write result to file
|
- name: Compare to expected result
|
||||||
copy:
|
copy:
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
content: '{{ xmlresponse.xmlstring }}'
|
||||||
content: "{{ xmlresponse.xmlstring }}"
|
dest: '{{ role_path }}/results/test-pretty-print-only.xml'
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
|
# FIXME: This change is related to the newline added by pretty_print
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-pretty-print-only.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- xmlresponse.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-pretty-print-only.xml /tmp/ansible-xml-beers.xml
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE: Jinja2 templating eats trailing newlines
|
||||||
- name: Read from xmlstring
|
- name: Read from xmlstring
|
||||||
xml:
|
xml:
|
||||||
xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
|
xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
|
||||||
xpath: /business/beers
|
xpath: /business/beers
|
||||||
pretty_print: True
|
pretty_print: yes
|
||||||
add_children:
|
add_children:
|
||||||
- beer: "Old Rasputin"
|
- beer: Old Rasputin
|
||||||
register: xmlresponse_modification
|
register: xmlresponse_modification
|
||||||
|
|
||||||
- name: Write result to file
|
- name: Compare to expected result
|
||||||
copy:
|
copy:
|
||||||
dest: /tmp/ansible-xml-beers.xml
|
content: '{{ xmlresponse_modification.xmlstring }}'
|
||||||
content: "{{ xmlresponse_modification.xmlstring }}"
|
dest: '{{ role_path }}/results/test-pretty-print.xml'
|
||||||
|
check_mode: yes
|
||||||
|
diff: yes
|
||||||
|
register: comparison
|
||||||
|
|
||||||
|
# FIXME: This change is related to the newline added by pretty_print
|
||||||
- name: Test expected result
|
- name: Test expected result
|
||||||
command: diff -u {{ role_path }}/results/test-pretty-print.xml /tmp/ansible-xml-beers.xml
|
assert:
|
||||||
|
that:
|
||||||
|
- xmlresponse_modification.changed == true
|
||||||
|
- comparison.changed == false # identical
|
||||||
|
#command: diff -u {{ role_path }}/results/test-pretty-print.xml /tmp/ansible-xml-beers.xml
|
||||||
|
Loading…
Reference in New Issue