summaryrefslogtreecommitdiff
path: root/test/integration/targets/xml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/xml')
-rw-r--r--test/integration/targets/xml/aliases3
-rw-r--r--test/integration/targets/xml/fixtures/ansible-xml-beers-unicode.xml13
-rw-r--r--test/integration/targets/xml/fixtures/ansible-xml-beers.xml14
-rw-r--r--test/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml14
-rw-r--r--test/integration/targets/xml/results/test-add-children-elements-unicode.xml14
-rw-r--r--test/integration/targets/xml/results/test-add-children-elements.xml14
-rw-r--r--test/integration/targets/xml/results/test-add-children-from-groupvars.xml14
-rw-r--r--test/integration/targets/xml/results/test-add-children-insertafter.xml17
-rw-r--r--test/integration/targets/xml/results/test-add-children-insertbefore.xml17
-rw-r--r--test/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml14
-rw-r--r--test/integration/targets/xml/results/test-add-children-with-attributes.xml14
-rw-r--r--test/integration/targets/xml/results/test-add-element-implicitly.yml32
-rw-r--r--test/integration/targets/xml/results/test-add-namespaced-children-elements.xml14
-rw-r--r--test/integration/targets/xml/results/test-pretty-print-only.xml14
-rw-r--r--test/integration/targets/xml/results/test-pretty-print.xml15
-rw-r--r--test/integration/targets/xml/results/test-remove-attribute.xml14
-rw-r--r--test/integration/targets/xml/results/test-remove-element.xml13
-rw-r--r--test/integration/targets/xml/results/test-remove-namespaced-attribute.xml14
-rw-r--r--test/integration/targets/xml/results/test-remove-namespaced-element.xml13
-rw-r--r--test/integration/targets/xml/results/test-set-attribute-value-unicode.xml14
-rw-r--r--test/integration/targets/xml/results/test-set-attribute-value.xml14
-rw-r--r--test/integration/targets/xml/results/test-set-children-elements-level.xml11
-rw-r--r--test/integration/targets/xml/results/test-set-children-elements-unicode.xml11
-rw-r--r--test/integration/targets/xml/results/test-set-children-elements.xml11
-rw-r--r--test/integration/targets/xml/results/test-set-element-value-empty.xml14
-rw-r--r--test/integration/targets/xml/results/test-set-element-value-unicode.xml14
-rw-r--r--test/integration/targets/xml/results/test-set-element-value.xml14
-rw-r--r--test/integration/targets/xml/results/test-set-namespaced-attribute-value.xml14
-rw-r--r--test/integration/targets/xml/results/test-set-namespaced-element-value.xml14
-rw-r--r--test/integration/targets/xml/tasks/main.yml67
-rw-r--r--test/integration/targets/xml/tasks/test-add-children-elements-unicode.yml29
-rw-r--r--test/integration/targets/xml/tasks/test-add-children-elements.yml29
-rw-r--r--test/integration/targets/xml/tasks/test-add-children-from-groupvars.yml28
-rw-r--r--test/integration/targets/xml/tasks/test-add-children-insertafter.yml32
-rw-r--r--test/integration/targets/xml/tasks/test-add-children-insertbefore.yml32
-rw-r--r--test/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.yml31
-rw-r--r--test/integration/targets/xml/tasks/test-add-children-with-attributes.yml35
-rw-r--r--test/integration/targets/xml/tasks/test-add-element-implicitly.yml237
-rw-r--r--test/integration/targets/xml/tasks/test-add-namespaced-children-elements.yml32
-rw-r--r--test/integration/targets/xml/tasks/test-children-elements-xml.yml30
-rw-r--r--test/integration/targets/xml/tasks/test-count-unicode.yml19
-rw-r--r--test/integration/targets/xml/tasks/test-count.yml19
-rw-r--r--test/integration/targets/xml/tasks/test-get-element-content-unicode.yml32
-rw-r--r--test/integration/targets/xml/tasks/test-get-element-content.yml52
-rw-r--r--test/integration/targets/xml/tasks/test-mutually-exclusive-attributes.yml22
-rw-r--r--test/integration/targets/xml/tasks/test-pretty-print-only.yml29
-rw-r--r--test/integration/targets/xml/tasks/test-pretty-print.yml30
-rw-r--r--test/integration/targets/xml/tasks/test-remove-attribute.yml28
-rw-r--r--test/integration/targets/xml/tasks/test-remove-element.yml28
-rw-r--r--test/integration/targets/xml/tasks/test-remove-namespaced-attribute.yml33
-rw-r--r--test/integration/targets/xml/tasks/test-remove-namespaced-element.yml33
-rw-r--r--test/integration/targets/xml/tasks/test-set-attribute-value-unicode.yml29
-rw-r--r--test/integration/targets/xml/tasks/test-set-attribute-value.yml29
-rw-r--r--test/integration/targets/xml/tasks/test-set-children-elements-level.yml74
-rw-r--r--test/integration/targets/xml/tasks/test-set-children-elements-unicode.yml46
-rw-r--r--test/integration/targets/xml/tasks/test-set-children-elements.yml53
-rw-r--r--test/integration/targets/xml/tasks/test-set-element-value-empty.yml28
-rw-r--r--test/integration/targets/xml/tasks/test-set-element-value-unicode.yml43
-rw-r--r--test/integration/targets/xml/tasks/test-set-element-value.yml43
-rw-r--r--test/integration/targets/xml/tasks/test-set-namespaced-attribute-value.yml34
-rw-r--r--test/integration/targets/xml/tasks/test-set-namespaced-children-elements.yml57
-rw-r--r--test/integration/targets/xml/tasks/test-set-namespaced-element-value.yml46
-rw-r--r--test/integration/targets/xml/tasks/test-xmlstring.yml81
-rw-r--r--test/integration/targets/xml/vars/main.yml6
64 files changed, 0 insertions, 1884 deletions
diff --git a/test/integration/targets/xml/aliases b/test/integration/targets/xml/aliases
deleted file mode 100644
index 0725da563f..0000000000
--- a/test/integration/targets/xml/aliases
+++ /dev/null
@@ -1,3 +0,0 @@
-destructive
-shippable/posix/group3
-skip/aix
diff --git a/test/integration/targets/xml/fixtures/ansible-xml-beers-unicode.xml b/test/integration/targets/xml/fixtures/ansible-xml-beers-unicode.xml
deleted file mode 100644
index d0e3e39af4..0000000000
--- a/test/integration/targets/xml/fixtures/ansible-xml-beers-unicode.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Толстый бар</name>
- <beers>
- <beer>Окское</beer>
- <beer>Невское</beer>
- </beers>
- <rating subjective="да">десять</rating>
- <website>
- <mobilefriendly/>
- <address>http://tolstyybar.com</address>
- </website>
-</business>
diff --git a/test/integration/targets/xml/fixtures/ansible-xml-beers.xml b/test/integration/targets/xml/fixtures/ansible-xml-beers.xml
deleted file mode 100644
index 5afc797414..0000000000
--- a/test/integration/targets/xml/fixtures/ansible-xml-beers.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml b/test/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml
deleted file mode 100644
index 61747d4bbb..0000000000
--- a/test/integration/targets/xml/fixtures/ansible-xml-namespaced-beers.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business xmlns="http://test.business" xmlns:attr="http://test.attribute" type="bar">
- <name>Tasty Beverage Co.</name>
- <beers xmlns="http://test.beers">
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating xmlns="http://test.rating" attr:subjective="true">10</rating>
- <website xmlns="http://test.website">
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-add-children-elements-unicode.xml b/test/integration/targets/xml/results/test-add-children-elements-unicode.xml
deleted file mode 100644
index 525330c217..0000000000
--- a/test/integration/targets/xml/results/test-add-children-elements-unicode.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer>Окское</beer></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-add-children-elements.xml b/test/integration/targets/xml/results/test-add-children-elements.xml
deleted file mode 100644
index f9ff25176a..0000000000
--- a/test/integration/targets/xml/results/test-add-children-elements.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer>Old Rasputin</beer></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-add-children-from-groupvars.xml b/test/integration/targets/xml/results/test-add-children-from-groupvars.xml
deleted file mode 100644
index 565ba402b6..0000000000
--- a/test/integration/targets/xml/results/test-add-children-from-groupvars.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer>Natty Lite</beer><beer>Miller Lite</beer><beer>Coors Lite</beer></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-add-children-insertafter.xml b/test/integration/targets/xml/results/test-add-children-insertafter.xml
deleted file mode 100644
index 8da9633636..0000000000
--- a/test/integration/targets/xml/results/test-add-children-insertafter.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Old Rasputin</beer>
- <beer>Old Motor Oil</beer>
- <beer>Old Curmudgeon</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business>
diff --git a/test/integration/targets/xml/results/test-add-children-insertbefore.xml b/test/integration/targets/xml/results/test-add-children-insertbefore.xml
deleted file mode 100644
index c409e54bfa..0000000000
--- a/test/integration/targets/xml/results/test-add-children-insertbefore.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>Old Rasputin</beer>
- <beer>Old Motor Oil</beer>
- <beer>Old Curmudgeon</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business>
diff --git a/test/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml b/test/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml
deleted file mode 100644
index 374652244f..0000000000
--- a/test/integration/targets/xml/results/test-add-children-with-attributes-unicode.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer name="Окское" type="экстра"/></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-add-children-with-attributes.xml b/test/integration/targets/xml/results/test-add-children-with-attributes.xml
deleted file mode 100644
index 5a3907f6f2..0000000000
--- a/test/integration/targets/xml/results/test-add-children-with-attributes.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer name="Ansible Brew" type="light"/></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-add-element-implicitly.yml b/test/integration/targets/xml/results/test-add-element-implicitly.yml
deleted file mode 100644
index fa1ddfca2f..0000000000
--- a/test/integration/targets/xml/results/test-add-element-implicitly.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer color="red">George Killian's Irish Red</beer>
- <beer origin="CZ" color="blonde">Pilsner Urquell</beer>
- </beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- <validxhtml validateon=""/>
- </website>
- <phonenumber>555-555-1234</phonenumber>
- <owner dob="1976-04-12">
- <name>
- <last>Smith</last>
- <first>John</first>
- <middle>Q</middle>
- </name>
- </owner>
- <website_bis>
- <validxhtml validateon=""/>
- </website_bis>
- <testnormalelement>xml tag with no special characters</testnormalelement>
- <test-with-dash>xml tag with dashes</test-with-dash>
- <test-with-dash.and.dot>xml tag with dashes and dots</test-with-dash.and.dot>
- <test-with.dash_and.dot_and-underscores>xml tag with dashes, dots and underscores</test-with.dash_and.dot_and-underscores>
-</business>
diff --git a/test/integration/targets/xml/results/test-add-namespaced-children-elements.xml b/test/integration/targets/xml/results/test-add-namespaced-children-elements.xml
deleted file mode 100644
index 3d27e8aa3c..0000000000
--- a/test/integration/targets/xml/results/test-add-namespaced-children-elements.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business xmlns="http://test.business" xmlns:attr="http://test.attribute" type="bar">
- <name>Tasty Beverage Co.</name>
- <beers xmlns="http://test.beers">
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer>Old Rasputin</beer></beers>
- <rating xmlns="http://test.rating" attr:subjective="true">10</rating>
- <website xmlns="http://test.website">
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-pretty-print-only.xml b/test/integration/targets/xml/results/test-pretty-print-only.xml
deleted file mode 100644
index f47909ac69..0000000000
--- a/test/integration/targets/xml/results/test-pretty-print-only.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business>
diff --git a/test/integration/targets/xml/results/test-pretty-print.xml b/test/integration/targets/xml/results/test-pretty-print.xml
deleted file mode 100644
index b5c38262fd..0000000000
--- a/test/integration/targets/xml/results/test-pretty-print.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- <beer>Old Rasputin</beer>
- </beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business>
diff --git a/test/integration/targets/xml/results/test-remove-attribute.xml b/test/integration/targets/xml/results/test-remove-attribute.xml
deleted file mode 100644
index 8a621cf144..0000000000
--- a/test/integration/targets/xml/results/test-remove-attribute.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating>10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-remove-element.xml b/test/integration/targets/xml/results/test-remove-element.xml
deleted file mode 100644
index 454d905cd4..0000000000
--- a/test/integration/targets/xml/results/test-remove-element.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-remove-namespaced-attribute.xml b/test/integration/targets/xml/results/test-remove-namespaced-attribute.xml
deleted file mode 100644
index 732a0ed224..0000000000
--- a/test/integration/targets/xml/results/test-remove-namespaced-attribute.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business xmlns="http://test.business" xmlns:attr="http://test.attribute" type="bar">
- <name>Tasty Beverage Co.</name>
- <beers xmlns="http://test.beers">
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating xmlns="http://test.rating">10</rating>
- <website xmlns="http://test.website">
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-remove-namespaced-element.xml b/test/integration/targets/xml/results/test-remove-namespaced-element.xml
deleted file mode 100644
index 16df98e201..0000000000
--- a/test/integration/targets/xml/results/test-remove-namespaced-element.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business xmlns="http://test.business" xmlns:attr="http://test.attribute" type="bar">
- <name>Tasty Beverage Co.</name>
- <beers xmlns="http://test.beers">
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <website xmlns="http://test.website">
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-attribute-value-unicode.xml b/test/integration/targets/xml/results/test-set-attribute-value-unicode.xml
deleted file mode 100644
index de3bc3f600..0000000000
--- a/test/integration/targets/xml/results/test-set-attribute-value-unicode.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="нет">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-attribute-value.xml b/test/integration/targets/xml/results/test-set-attribute-value.xml
deleted file mode 100644
index 143fe7bf4e..0000000000
--- a/test/integration/targets/xml/results/test-set-attribute-value.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="false">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-children-elements-level.xml b/test/integration/targets/xml/results/test-set-children-elements-level.xml
deleted file mode 100644
index 0ef2b7e6e6..0000000000
--- a/test/integration/targets/xml/results/test-set-children-elements-level.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer alcohol="0.5" name="90 Minute IPA"><Water liter="0.2" quantity="200g"/><Starch quantity="10g"/><Hops quantity="50g"/><Yeast quantity="20g"/></beer><beer alcohol="0.3" name="Harvest Pumpkin Ale"><Water liter="0.2" quantity="200g"/><Hops quantity="25g"/><Yeast quantity="20g"/></beer></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-children-elements-unicode.xml b/test/integration/targets/xml/results/test-set-children-elements-unicode.xml
deleted file mode 100644
index f19d53566a..0000000000
--- a/test/integration/targets/xml/results/test-set-children-elements-unicode.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Окское</beer><beer>Невское</beer></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-children-elements.xml b/test/integration/targets/xml/results/test-set-children-elements.xml
deleted file mode 100644
index be313a5a8d..0000000000
--- a/test/integration/targets/xml/results/test-set-children-elements.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>90 Minute IPA</beer><beer>Harvest Pumpkin Ale</beer></beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-element-value-empty.xml b/test/integration/targets/xml/results/test-set-element-value-empty.xml
deleted file mode 100644
index 785beb645d..0000000000
--- a/test/integration/targets/xml/results/test-set-element-value-empty.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="true">10</rating>
- <website>
- <mobilefriendly/>
- <address></address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-element-value-unicode.xml b/test/integration/targets/xml/results/test-set-element-value-unicode.xml
deleted file mode 100644
index 734fe6dbf1..0000000000
--- a/test/integration/targets/xml/results/test-set-element-value-unicode.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="true">пять</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-<rating>пять</rating></business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-element-value.xml b/test/integration/targets/xml/results/test-set-element-value.xml
deleted file mode 100644
index fc97ec3bed..0000000000
--- a/test/integration/targets/xml/results/test-set-element-value.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business type="bar">
- <name>Tasty Beverage Co.</name>
- <beers>
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating subjective="true">5</rating>
- <website>
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-<rating>5</rating></business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-namespaced-attribute-value.xml b/test/integration/targets/xml/results/test-set-namespaced-attribute-value.xml
deleted file mode 100644
index 44abda43f0..0000000000
--- a/test/integration/targets/xml/results/test-set-namespaced-attribute-value.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business xmlns="http://test.business" xmlns:attr="http://test.attribute" type="bar">
- <name>Tasty Beverage Co.</name>
- <beers xmlns="http://test.beers">
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating xmlns="http://test.rating" attr:subjective="false">10</rating>
- <website xmlns="http://test.website">
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/results/test-set-namespaced-element-value.xml b/test/integration/targets/xml/results/test-set-namespaced-element-value.xml
deleted file mode 100644
index 0cc8a79e39..0000000000
--- a/test/integration/targets/xml/results/test-set-namespaced-element-value.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<business xmlns="http://test.business" xmlns:attr="http://test.attribute" type="bar">
- <name>Tasty Beverage Co.</name>
- <beers xmlns="http://test.beers">
- <beer>Rochefort 10</beer>
- <beer>St. Bernardus Abbot 12</beer>
- <beer>Schlitz</beer>
- </beers>
- <rating xmlns="http://test.rating" attr:subjective="true">11</rating>
- <website xmlns="http://test.website">
- <mobilefriendly/>
- <address>http://tastybeverageco.com</address>
- </website>
-</business> \ No newline at end of file
diff --git a/test/integration/targets/xml/tasks/main.yml b/test/integration/targets/xml/tasks/main.yml
deleted file mode 100644
index 9b8f2c3678..0000000000
--- a/test/integration/targets/xml/tasks/main.yml
+++ /dev/null
@@ -1,67 +0,0 @@
-- name: Gather facts
- setup:
-
-- name: Install lxml (FreeBSD)
- package:
- name: '{{ "py27-lxml" if ansible_python.version.major == 2 else "py36-lxml" }}'
- state: present
- when: ansible_os_family == "FreeBSD"
-
-# Needed for MacOSX !
-- name: Install lxml
- pip:
- name: lxml
- state: present
-# when: ansible_os_family == "Darwin"
-
-- name: Get lxml version
- command: "{{ ansible_python_interpreter }} -c 'from lxml import etree; print(\".\".join(str(v) for v in etree.LXML_VERSION))'"
- register: lxml_version
-
-- name: Set lxml capabilities as variables
- set_fact:
- # NOTE: Some tests require predictable element attribute order,
- # which is only guaranteed starting from lxml v3.0alpha1
- lxml_predictable_attribute_order: '{{ lxml_version.stdout is version("3", ">=") }}'
-
- # NOTE: The xml module requires at least lxml v2.3.0
- lxml_xpath_attribute_result_attrname: '{{ lxml_version.stdout is version("2.3.0", ">=") }}'
-
-- name: Only run the tests when lxml v2.3.0+
- when: lxml_xpath_attribute_result_attrname
- block:
-
- - include_tasks: test-add-children-elements.yml
- - include_tasks: test-add-children-from-groupvars.yml
- - include_tasks: test-add-children-insertafter.yml
- - include_tasks: test-add-children-insertbefore.yml
- - include_tasks: test-add-children-with-attributes.yml
- - include_tasks: test-add-element-implicitly.yml
- - include_tasks: test-count.yml
- - include_tasks: test-mutually-exclusive-attributes.yml
- - include_tasks: test-remove-attribute.yml
- - include_tasks: test-remove-element.yml
- - include_tasks: test-set-attribute-value.yml
- - include_tasks: test-set-children-elements.yml
- - include_tasks: test-set-children-elements-level.yml
- - include_tasks: test-set-element-value.yml
- - include_tasks: test-set-element-value-empty.yml
- - include_tasks: test-pretty-print.yml
- - include_tasks: test-pretty-print-only.yml
- - include_tasks: test-add-namespaced-children-elements.yml
- - include_tasks: test-remove-namespaced-attribute.yml
- - include_tasks: test-set-namespaced-attribute-value.yml
- - include_tasks: test-set-namespaced-element-value.yml
- - include_tasks: test-set-namespaced-children-elements.yml
- - include_tasks: test-get-element-content.yml
- - include_tasks: test-xmlstring.yml
- - include_tasks: test-children-elements-xml.yml
-
- # Unicode tests
- - include_tasks: test-add-children-elements-unicode.yml
- - include_tasks: test-add-children-with-attributes-unicode.yml
- - include_tasks: test-set-attribute-value-unicode.yml
- - include_tasks: test-count-unicode.yml
- - include_tasks: test-get-element-content.yml
- - include_tasks: test-set-children-elements-unicode.yml
- - include_tasks: test-set-element-value-unicode.yml
diff --git a/test/integration/targets/xml/tasks/test-add-children-elements-unicode.yml b/test/integration/targets/xml/tasks/test-add-children-elements-unicode.yml
deleted file mode 100644
index 8ad91501c3..0000000000
--- a/test/integration/targets/xml/tasks/test-add-children-elements-unicode.yml
+++ /dev/null
@@ -1,29 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- add_children:
- - 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-add-children-elements.yml b/test/integration/targets/xml/tasks/test-add-children-elements.yml
deleted file mode 100644
index 8d9b06866d..0000000000
--- a/test/integration/targets/xml/tasks/test-add-children-elements.yml
+++ /dev/null
@@ -1,29 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- add_children:
- - 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-add-children-from-groupvars.yml b/test/integration/targets/xml/tasks/test-add-children-from-groupvars.yml
deleted file mode 100644
index e062de8d14..0000000000
--- a/test/integration/targets/xml/tasks/test-add-children-from-groupvars.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/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
- 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
diff --git a/test/integration/targets/xml/tasks/test-add-children-insertafter.yml b/test/integration/targets/xml/tasks/test-add-children-insertafter.yml
deleted file mode 100644
index 2d42e2d54e..0000000000
--- a/test/integration/targets/xml/tasks/test-add-children-insertafter.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: '/business/beers/beer[text()="St. Bernardus Abbot 12"]'
- insertafter: yes
- add_children:
- - beer: Old Rasputin
- - beer: Old Motor Oil
- - beer: Old Curmudgeon
- pretty_print: yes
- register: add_children_insertafter
-
- - name: Compare to expected result
- copy:
- src: results/test-add-children-insertafter.xml
- dest: /tmp/ansible-xml-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - add_children_insertafter.changed == true
- - comparison.changed == false # identical
diff --git a/test/integration/targets/xml/tasks/test-add-children-insertbefore.yml b/test/integration/targets/xml/tasks/test-add-children-insertbefore.yml
deleted file mode 100644
index 8550f12cf7..0000000000
--- a/test/integration/targets/xml/tasks/test-add-children-insertbefore.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: '/business/beers/beer[text()="St. Bernardus Abbot 12"]'
- insertbefore: yes
- add_children:
- - beer: Old Rasputin
- - beer: Old Motor Oil
- - beer: Old Curmudgeon
- pretty_print: yes
- register: add_children_insertbefore
-
- - name: Compare to expected result
- copy:
- src: results/test-add-children-insertbefore.xml
- dest: /tmp/ansible-xml-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - add_children_insertbefore.changed == true
- - comparison.changed == false # identical
diff --git a/test/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.yml b/test/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.yml
deleted file mode 100644
index d4a2329f69..0000000000
--- a/test/integration/targets/xml/tasks/test-add-children-with-attributes-unicode.yml
+++ /dev/null
@@ -1,31 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- add_children:
- - beer:
- name: Окское
- 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-add-children-with-attributes.yml b/test/integration/targets/xml/tasks/test-add-children-with-attributes.yml
deleted file mode 100644
index 91e92637fc..0000000000
--- a/test/integration/targets/xml/tasks/test-add-children-with-attributes.yml
+++ /dev/null
@@ -1,35 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- add_children:
- - beer:
- name: Ansible Brew
- 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
- # 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.
- - name: Test expected result
- assert:
- that:
- - 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
diff --git a/test/integration/targets/xml/tasks/test-add-element-implicitly.yml b/test/integration/targets/xml/tasks/test-add-element-implicitly.yml
deleted file mode 100644
index db674ba4fc..0000000000
--- a/test/integration/targets/xml/tasks/test-add-element-implicitly.yml
+++ /dev/null
@@ -1,237 +0,0 @@
----
-- name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers-implicit.xml
-
-
-- name: Add a phonenumber element to the business element. Implicit mkdir -p behavior where applicable
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/phonenumber
- value: 555-555-1234
-
-- name: Add a owner element to the business element, testing implicit mkdir -p behavior 1/2
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/owner/name/last
- value: Smith
-
-- name: Add a owner element to the business element, testing implicit mkdir -p behavior 2/2
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/owner/name/first
- value: John
-
-- name: Add a validxhtml element to the website element. Note that ensure is present by default and while value defaults to null for elements, if one doesn't specify it we don't know what to do.
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/website/validxhtml
-
-- name: Add an empty validateon attribute to the validxhtml element. This actually makes the previous example redundant because of the implicit parent-node creation behavior.
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/website/validxhtml/@validateon
-
-- name: Add an empty validateon attribute to the validxhtml element. Actually verifies the implicit parent-node creation behavior.
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/website_bis/validxhtml/@validateon
-
-- name: Add an attribute with a value
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/owner/@dob='1976-04-12'
-
-- name: Add an element with a value, alternate syntax
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/beers/beer/text()="George Killian's Irish Red" # note the quote within an XPath string thing
-
-- name: Add an element without special characters
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/testnormalelement
- value: xml tag with no special characters
- pretty_print: yes
-
-- name: Add an element with dash
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/test-with-dash
- value: xml tag with dashes
- pretty_print: yes
-
-- name: Add an element with dot
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/test-with-dash.and.dot
- value: xml tag with dashes and dots
- pretty_print: yes
-
-- name: Add an element with underscore
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/test-with.dash_and.dot_and-underscores
- value: xml tag with dashes, dots and underscores
- pretty_print: yes
-
-- name: Add an attribute on a conditional element
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/beers/beer[text()="George Killian's Irish Red"]/@color='red'
-
-- name: Add two attributes on a conditional element
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/beers/beer[text()="Pilsner Urquell" and @origin='CZ']/@color='blonde'
-
-- name: Add a owner element to the business element, testing implicit mkdir -p behavior 3/2 -- complex lookup
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/owner/name[first/text()='John']/middle
- value: Q
-
-- name: Pretty Print this!
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- pretty_print: yes
-
-- name: Compare to expected result
- copy:
- src: results/test-add-element-implicitly.yml
- dest: /tmp/ansible-xml-beers-implicit.xml
- check_mode: yes
- diff: yes
- register: comparison
-
-- name: Test expected result
- assert:
- that:
- - comparison.changed == false # identical
- #command: diff -u {{ role_path }}/results/test-add-element-implicitly.yml /tmp/ansible-xml-beers-implicit.xml
-
-
-# Now we repeat the same, just to ensure proper use of namespaces
-- name: Add a phonenumber element to the business element. Implicit mkdir -p behavior where applicable
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:phonenumber
- value: 555-555-1234
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add a owner element to the business element, testing implicit mkdir -p behavior 1/2
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:owner/a:name/a:last
- value: Smith
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add a owner element to the business element, testing implicit mkdir -p behavior 2/2
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:owner/a:name/a:first
- value: John
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add a validxhtml element to the website element. Note that ensure is present by default and while value defaults to null for elements, if one doesn't specify it we don't know what to do.
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:website/a:validxhtml
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an empty validateon attribute to the validxhtml element. This actually makes the previous example redundant because of the implicit parent-node creation behavior.
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:website/a:validxhtml/@a:validateon
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an empty validateon attribute to the validxhtml element. Actually verifies the implicit parent-node creation behavior.
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:website_bis/a:validxhtml/@a:validateon
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an attribute with a value
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:owner/@a:dob='1976-04-12'
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an element with a value, alternate syntax
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:beers/a:beer/text()="George Killian's Irish Red" # note the quote within an XPath string thing
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an attribute on a conditional element
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:beers/a:beer[text()="George Killian's Irish Red"]/@a:color='red'
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add two attributes on a conditional element
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:beers/a:beer[text()="Pilsner Urquell" and @a:origin='CZ']/@a:color='blonde'
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add a owner element to the business element, testing implicit mkdir -p behavior 3/2 -- complex lookup
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/a:owner/a:name[a:first/text()='John']/a:middle
- value: Q
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an element without special characters
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/testnormalelement
- value: xml tag with no special characters
- pretty_print: yes
- namespaces:
- a: http://example.com/some/namespace
-
-
-- name: Add an element with dash
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/test-with-dash
- value: xml tag with dashes
- pretty_print: yes
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an element with dot
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/test-with-dash.and.dot
- value: xml tag with dashes and dots
- pretty_print: yes
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Add an element with underscore
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- xpath: /business/test-with.dash_and.dot_and-underscores
- value: xml tag with dashes, dots and underscores
- pretty_print: yes
- namespaces:
- a: http://example.com/some/namespace
-
-- name: Pretty Print this!
- xml:
- file: /tmp/ansible-xml-beers-implicit.xml
- pretty_print: yes
diff --git a/test/integration/targets/xml/tasks/test-add-namespaced-children-elements.yml b/test/integration/targets/xml/tasks/test-add-namespaced-children-elements.yml
deleted file mode 100644
index 25eca47f5b..0000000000
--- a/test/integration/targets/xml/tasks/test-add-namespaced-children-elements.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-namespaced-beers.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
-
-
- - name: Add namespaced child element
- xml:
- path: /tmp/ansible-xml-namespaced-beers.xml
- xpath: /bus:business/ber:beers
- namespaces:
- bus: http://test.business
- ber: http://test.beers
- add_children:
- - beer: Old Rasputin
- register: add_namespaced_children_elements
-
- - name: Compare to expected result
- copy:
- src: results/test-add-namespaced-children-elements.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - add_namespaced_children_elements.changed == true
- - comparison.changed == false # identical
- #command: diff -u {{ role_path }}/results/test-add-namespaced-children-elements.xml /tmp/ansible-xml-namespaced-beers.xml
diff --git a/test/integration/targets/xml/tasks/test-children-elements-xml.yml b/test/integration/targets/xml/tasks/test-children-elements-xml.yml
deleted file mode 100644
index f4a3c3d582..0000000000
--- a/test/integration/targets/xml/tasks/test-children-elements-xml.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element with xml format
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- input_type: xml
- add_children:
- - '<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
- 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
diff --git a/test/integration/targets/xml/tasks/test-count-unicode.yml b/test/integration/targets/xml/tasks/test-count-unicode.yml
deleted file mode 100644
index 47a806bf98..0000000000
--- a/test/integration/targets/xml/tasks/test-count-unicode.yml
+++ /dev/null
@@ -1,19 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers-unicode.xml
- dest: /tmp/ansible-xml-beers-unicode.xml
-
-
- - name: Count child element
- xml:
- path: /tmp/ansible-xml-beers-unicode.xml
- xpath: /business/beers/beer
- count: yes
- register: beers
-
- - name: Test expected result
- assert:
- that:
- - beers.changed == false
- - beers.count == 2
diff --git a/test/integration/targets/xml/tasks/test-count.yml b/test/integration/targets/xml/tasks/test-count.yml
deleted file mode 100644
index cbc97e323c..0000000000
--- a/test/integration/targets/xml/tasks/test-count.yml
+++ /dev/null
@@ -1,19 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add child element
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers/beer
- count: yes
- register: beers
-
- - name: Test expected result
- assert:
- that:
- - beers.changed == false
- - beers.count == 3
diff --git a/test/integration/targets/xml/tasks/test-get-element-content-unicode.yml b/test/integration/targets/xml/tasks/test-get-element-content-unicode.yml
deleted file mode 100644
index 73ae96674f..0000000000
--- a/test/integration/targets/xml/tasks/test-get-element-content-unicode.yml
+++ /dev/null
@@ -1,32 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers-unicode.xml
- dest: /tmp/ansible-xml-beers-unicode.xml
-
-
- - name: Get element attributes
- xml:
- path: /tmp/ansible-xml-beers-unicode.xml
- xpath: /business/rating
- content: attribute
- register: get_element_attribute
-
- - 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
- xml:
- path: /tmp/ansible-xml-beers-unicode.xml
- xpath: /business/rating
- content: text
- register: get_element_text
-
- - name: Test expected result
- assert:
- that:
- - get_element_text.changed == false
- - get_element_text.matches[0]['rating'] == 'десять'
diff --git a/test/integration/targets/xml/tasks/test-get-element-content.yml b/test/integration/targets/xml/tasks/test-get-element-content.yml
deleted file mode 100644
index 58ca7767e7..0000000000
--- a/test/integration/targets/xml/tasks/test-get-element-content.yml
+++ /dev/null
@@ -1,52 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Get element attributes
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- content: attribute
- register: get_element_attribute
-
- - name: Test expected result
- assert:
- that:
- - get_element_attribute.changed == false
- - get_element_attribute.matches[0]['rating'] is defined
- - get_element_attribute.matches[0]['rating']['subjective'] == 'true'
-
- # TODO: Remove this in Ansible v2.12 when this incorrect use of attribute is deprecated
- - name: Get element attributes
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- content: attribute
- attribute: subjective
- register: get_element_attribute_wrong
-
- - name: Test expected result
- assert:
- that:
- - get_element_attribute_wrong.changed == false
- - get_element_attribute_wrong.matches[0]['rating'] is defined
- - get_element_attribute_wrong.matches[0]['rating']['subjective'] == 'true'
- - get_element_attribute_wrong.deprecations is defined
- - get_element_attribute_wrong.deprecations[0].msg == "Parameter 'attribute=subjective' is ignored when using 'content=attribute' only 'xpath' is used. Please remove entry."
- - get_element_attribute_wrong.deprecations[0].version == '2.12'
-
- - name: Get element text
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- content: text
- register: get_element_text
-
- - name: Test expected result
- assert:
- that:
- - get_element_text.changed == false
- - get_element_text.matches[0]['rating'] == '10'
diff --git a/test/integration/targets/xml/tasks/test-mutually-exclusive-attributes.yml b/test/integration/targets/xml/tasks/test-mutually-exclusive-attributes.yml
deleted file mode 100644
index 3f24b0ac84..0000000000
--- a/test/integration/targets/xml/tasks/test-mutually-exclusive-attributes.yml
+++ /dev/null
@@ -1,22 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Specify both children to add and a value
- xml:
- path: /tmp/ansible-xml-beers.xml
- add_children:
- - child01
- - child02
- value: conflict!
- register: module_output
- ignore_errors: yes
-
- - name: Test expected result
- assert:
- that:
- - module_output.changed == false
- - module_output.failed == true
diff --git a/test/integration/targets/xml/tasks/test-pretty-print-only.yml b/test/integration/targets/xml/tasks/test-pretty-print-only.yml
deleted file mode 100644
index 7c0f7d5fd6..0000000000
--- a/test/integration/targets/xml/tasks/test-pretty-print-only.yml
+++ /dev/null
@@ -1,29 +0,0 @@
----
- - name: Setup test fixture
- 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:
- path: /tmp/ansible-xml-beers.xml
- pretty_print: yes
- register: pretty_print_only
-
- - name: Compare to expected result
- copy:
- src: results/test-pretty-print-only.xml
- dest: /tmp/ansible-xml-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - pretty_print_only.changed == true
- - comparison.changed == false # identical
- #command: diff -u {{ role_path }}/results/test-pretty-print-only.xml /tmp/ansible-xml-beers.xml
diff --git a/test/integration/targets/xml/tasks/test-pretty-print.yml b/test/integration/targets/xml/tasks/test-pretty-print.yml
deleted file mode 100644
index 88b618b25d..0000000000
--- a/test/integration/targets/xml/tasks/test-pretty-print.yml
+++ /dev/null
@@ -1,30 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Pretty print
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- pretty_print: yes
- add_children:
- - 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-remove-attribute.yml b/test/integration/targets/xml/tasks/test-remove-attribute.yml
deleted file mode 100644
index 9aa395e666..0000000000
--- a/test/integration/targets/xml/tasks/test-remove-attribute.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Remove '/business/rating/@subjective'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating/@subjective
- 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-remove-element.yml b/test/integration/targets/xml/tasks/test-remove-element.yml
deleted file mode 100644
index f2e20ea220..0000000000
--- a/test/integration/targets/xml/tasks/test-remove-element.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Remove '/business/rating'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-remove-namespaced-attribute.yml b/test/integration/targets/xml/tasks/test-remove-namespaced-attribute.yml
deleted file mode 100644
index 36682b2202..0000000000
--- a/test/integration/targets/xml/tasks/test-remove-namespaced-attribute.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-namespaced-beers.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
-
-
- - name: Remove namespaced '/bus:business/rat:rating/@attr:subjective'
- xml:
- path: /tmp/ansible-xml-namespaced-beers.xml
- xpath: /bus:business/rat:rating/@attr:subjective
- namespaces:
- bus: http://test.business
- ber: http://test.beers
- rat: http://test.rating
- attr: http://test.attribute
- state: absent
- register: remove_namespaced_attribute
-
- - name: Compare to expected result
- copy:
- src: results/test-remove-namespaced-attribute.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - remove_element.changed == true
- - comparison.changed == false # identical
- #command: diff -u {{ role_path }}/results/test-remove-namespaced-attribute.xml /tmp/ansible-xml-namespaced-beers.xml
diff --git a/test/integration/targets/xml/tasks/test-remove-namespaced-element.yml b/test/integration/targets/xml/tasks/test-remove-namespaced-element.yml
deleted file mode 100644
index be78af6803..0000000000
--- a/test/integration/targets/xml/tasks/test-remove-namespaced-element.yml
+++ /dev/null
@@ -1,33 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-namespaced-beers.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
-
-
- - name: Remove namespaced '/bus:business/rat:rating'
- xml:
- path: /tmp/ansible-xml-namespaced-beers.xml
- xpath: /bus:business/rat:rating
- namespaces:
- bus: http://test.business
- ber: http://test.beers
- rat: http://test.rating
- attr: http://test.attribute
- state: absent
- register: remove_namespaced_element
-
- - name: Compare to expected result
- copy:
- src: results/test-remove-element.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - remove_namespaced_element.changed == true
- - comparison.changed == false # identical
- #command: diff -u {{ role_path }}/results/test-remove-element.xml /tmp/ansible-xml-namespaced-beers.xml
diff --git a/test/integration/targets/xml/tasks/test-set-attribute-value-unicode.yml b/test/integration/targets/xml/tasks/test-set-attribute-value-unicode.yml
deleted file mode 100644
index dabf72a1b7..0000000000
--- a/test/integration/targets/xml/tasks/test-set-attribute-value-unicode.yml
+++ /dev/null
@@ -1,29 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Set '/business/rating/@subjective' to 'нет'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- attribute: subjective
- 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
- assert:
- 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
diff --git a/test/integration/targets/xml/tasks/test-set-attribute-value.yml b/test/integration/targets/xml/tasks/test-set-attribute-value.yml
deleted file mode 100644
index 2aa39fe22f..0000000000
--- a/test/integration/targets/xml/tasks/test-set-attribute-value.yml
+++ /dev/null
@@ -1,29 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Set '/business/rating/@subjective' to 'false'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- attribute: subjective
- 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
- assert:
- 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
diff --git a/test/integration/targets/xml/tasks/test-set-children-elements-level.yml b/test/integration/targets/xml/tasks/test-set-children-elements-level.yml
deleted file mode 100644
index 3e2c0adb6f..0000000000
--- a/test/integration/targets/xml/tasks/test-set-children-elements-level.yml
+++ /dev/null
@@ -1,74 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Set child elements
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- set_children: &children
- - beer:
- alcohol: "0.5"
- name: 90 Minute IPA
- _:
- - Water:
- liter: "0.2"
- quantity: 200g
- - Starch:
- quantity: 10g
- - Hops:
- quantity: 50g
- - Yeast:
- quantity: 20g
- - beer:
- alcohol: "0.3"
- name: Harvest Pumpkin Ale
- _:
- - Water:
- liter: "0.2"
- quantity: 200g
- - Hops:
- quantity: 25g
- - Yeast:
- quantity: 20g
- register: set_children_elements_level
-
- - name: Compare to expected result
- copy:
- src: results/test-set-children-elements-level.xml
- dest: /tmp/ansible-xml-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - set_children_elements_level.changed == true
- - comparison.changed == false # identical
- #command: diff -u {{ role_path }}/results/test-set-children-elements-level.xml /tmp/ansible-xml-beers.xml
-
-
- - name: Set child elements (again)
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- set_children: *children
- register: set_children_again
-
- - name: Compare to expected result
- copy:
- src: results/test-set-children-elements-level.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
diff --git a/test/integration/targets/xml/tasks/test-set-children-elements-unicode.yml b/test/integration/targets/xml/tasks/test-set-children-elements-unicode.yml
deleted file mode 100644
index 240b894ac7..0000000000
--- a/test/integration/targets/xml/tasks/test-set-children-elements-unicode.yml
+++ /dev/null
@@ -1,46 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Set child elements
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- set_children: &children
- - 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
- 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: 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-set-children-elements.yml b/test/integration/targets/xml/tasks/test-set-children-elements.yml
deleted file mode 100644
index 7b0f3247ad..0000000000
--- a/test/integration/targets/xml/tasks/test-set-children-elements.yml
+++ /dev/null
@@ -1,53 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Set child elements
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- set_children: &children
- - beer: 90 Minute IPA
- - 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
- 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 (again)
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/beers
- set_children: *children
- register: set_children_again
-
- - 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-set-element-value-empty.yml b/test/integration/targets/xml/tasks/test-set-element-value-empty.yml
deleted file mode 100644
index 5814803cb7..0000000000
--- a/test/integration/targets/xml/tasks/test-set-element-value-empty.yml
+++ /dev/null
@@ -1,28 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Set '/business/website/address' to empty string.
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/website/address
- 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
- 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
diff --git a/test/integration/targets/xml/tasks/test-set-element-value-unicode.yml b/test/integration/targets/xml/tasks/test-set-element-value-unicode.yml
deleted file mode 100644
index c3a40b7d93..0000000000
--- a/test/integration/targets/xml/tasks/test-set-element-value-unicode.yml
+++ /dev/null
@@ -1,43 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add 2nd '/business/rating' with value 'пять'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business
- add_children:
- - rating: пять
-
- - name: Set '/business/rating' to 'пять'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- value: пять
- register: set_element_first_run
-
- - name: Set '/business/rating' to 'false'... again
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- value: пять
- register: set_element_second_run
-
- - name: Compare to expected result
- copy:
- src: results/test-set-element-value-unicode.xml
- dest: /tmp/ansible-xml-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - set_element_first_run.changed == true
- - 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
diff --git a/test/integration/targets/xml/tasks/test-set-element-value.yml b/test/integration/targets/xml/tasks/test-set-element-value.yml
deleted file mode 100644
index dbd070f139..0000000000
--- a/test/integration/targets/xml/tasks/test-set-element-value.yml
+++ /dev/null
@@ -1,43 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-beers.xml
- dest: /tmp/ansible-xml-beers.xml
-
-
- - name: Add 2nd '/business/rating' with value '5'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business
- add_children:
- - rating: '5'
-
- - name: Set '/business/rating' to '5'
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- value: '5'
- register: set_element_first_run
-
- - name: Set '/business/rating' to '5'... again
- xml:
- path: /tmp/ansible-xml-beers.xml
- xpath: /business/rating
- value: '5'
- register: set_element_second_run
-
- - name: Compare to expected result
- copy:
- src: results/test-set-element-value.xml
- dest: /tmp/ansible-xml-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - set_element_first_run.changed == true
- - 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
diff --git a/test/integration/targets/xml/tasks/test-set-namespaced-attribute-value.yml b/test/integration/targets/xml/tasks/test-set-namespaced-attribute-value.yml
deleted file mode 100644
index e0086efe3a..0000000000
--- a/test/integration/targets/xml/tasks/test-set-namespaced-attribute-value.yml
+++ /dev/null
@@ -1,34 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-namespaced-beers.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
-
-
- - name: Set namespaced '/bus:business/rat:rating/@attr:subjective' to 'false'
- xml:
- path: /tmp/ansible-xml-namespaced-beers.xml
- xpath: /bus:business/rat:rating
- namespaces:
- bus: http://test.business
- ber: http://test.beers
- rat: http://test.rating
- attr: http://test.attribute
- attribute: attr:subjective
- value: 'false'
- register: set_namespaced_attribute_value
-
- - name: Compare to expected result
- copy:
- src: results/test-set-namespaced-attribute-value.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
-
- - name: Test expected result
- assert:
- that:
- - set_namespaced_attribute_value.changed == true
- - comparison.changed == false # identical
- #command: diff -u {{ role_path }}/results/test-set-namespaced-attribute-value.xml /tmp/ansible-xml-namespaced-beers.xml
diff --git a/test/integration/targets/xml/tasks/test-set-namespaced-children-elements.yml b/test/integration/targets/xml/tasks/test-set-namespaced-children-elements.yml
deleted file mode 100644
index 8e66e70eeb..0000000000
--- a/test/integration/targets/xml/tasks/test-set-namespaced-children-elements.yml
+++ /dev/null
@@ -1,57 +0,0 @@
----
- - 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
- remote_src: yes
-
- - 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
- 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
- #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
diff --git a/test/integration/targets/xml/tasks/test-set-namespaced-element-value.yml b/test/integration/targets/xml/tasks/test-set-namespaced-element-value.yml
deleted file mode 100644
index f77d7537e9..0000000000
--- a/test/integration/targets/xml/tasks/test-set-namespaced-element-value.yml
+++ /dev/null
@@ -1,46 +0,0 @@
----
- - name: Setup test fixture
- copy:
- src: fixtures/ansible-xml-namespaced-beers.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
-
-
- - name: Set namespaced '/bus:business/rat:rating' to '11'
- xml:
- path: /tmp/ansible-xml-namespaced-beers.xml
- namespaces:
- bus: http://test.business
- ber: http://test.beers
- rat: http://test.rating
- attr: http://test.attribute
- xpath: /bus:business/rat:rating
- value: '11'
- register: set_element_first_run
-
- - name: Set namespaced '/bus:business/rat:rating' to '11' again
- xml:
- path: /tmp/ansible-xml-namespaced-beers.xml
- namespaces:
- bus: http://test.business
- ber: http://test.beers
- rat: http://test.rating
- attr: http://test.attribute
- xpath: /bus:business/rat:rating
- value: '11'
- register: set_element_second_run
-
- - name: Compare to expected result
- copy:
- src: results/test-set-namespaced-element-value.xml
- dest: /tmp/ansible-xml-namespaced-beers.xml
- check_mode: yes
- diff: yes
- register: comparison
- #command: diff -u {{ role_path }}/results/test-set-namespaced-element-value.xml /tmp/ansible-xml-namespaced-beers.xml
-
- - name: Test expected result
- assert:
- that:
- - set_element_first_run.changed == true
- - set_element_second_run.changed == false
- - comparison.changed == false # identical
diff --git a/test/integration/targets/xml/tasks/test-xmlstring.yml b/test/integration/targets/xml/tasks/test-xmlstring.yml
deleted file mode 100644
index 4620d984fa..0000000000
--- a/test/integration/targets/xml/tasks/test-xmlstring.yml
+++ /dev/null
@@ -1,81 +0,0 @@
----
- - 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:
- xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
- xpath: .
- register: xmlresponse
-
- - name: Compare to expected result
- copy:
- content: "{{ xmlresponse.xmlstring }}\n"
- dest: '/tmp/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:
- xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
- pretty_print: yes
- register: xmlresponse
-
- - name: Compare to expected result
- copy:
- content: '{{ xmlresponse.xmlstring }}'
- dest: '/tmp/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
- 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
- xml:
- xmlstring: "{{ lookup('file', '{{ role_path }}/fixtures/ansible-xml-beers.xml') }}"
- xpath: /business/beers
- pretty_print: yes
- add_children:
- - beer: Old Rasputin
- register: xmlresponse_modification
-
- - name: Compare to expected result
- copy:
- content: '{{ xmlresponse_modification.xmlstring }}'
- dest: '/tmp/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
- 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
diff --git a/test/integration/targets/xml/vars/main.yml b/test/integration/targets/xml/vars/main.yml
deleted file mode 100644
index 7c5675bd93..0000000000
--- a/test/integration/targets/xml/vars/main.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- mode: yaml -*
----
-bad_beers:
-- beer: "Natty Lite"
-- beer: "Miller Lite"
-- beer: "Coors Lite"