summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/integrated/api_samples/os-tenant-networks/networks-list-res.xml.tpl13
-rw-r--r--nova/tests/integrated/api_samples/os-tenant-networks/networks-post-req.xml.tpl7
-rw-r--r--nova/tests/integrated/api_samples/os-tenant-networks/networks-post-res.xml.tpl5
-rw-r--r--nova/tests/integrated/test_api_samples.py11
4 files changed, 36 insertions, 0 deletions
diff --git a/nova/tests/integrated/api_samples/os-tenant-networks/networks-list-res.xml.tpl b/nova/tests/integrated/api_samples/os-tenant-networks/networks-list-res.xml.tpl
new file mode 100644
index 000000000..0562ebae7
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-tenant-networks/networks-list-res.xml.tpl
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<networks>
+ <network>
+ <cidr>10.0.0.0/29</cidr>
+ <id>%(id)s</id>
+ <label>test_0</label>
+ </network>
+ <network>
+ <cidr>10.0.0.8/29</cidr>
+ <id>%(id)s</id>
+ <label>test_1</label>
+ </network>
+</networks>
diff --git a/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-req.xml.tpl b/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-req.xml.tpl
new file mode 100644
index 000000000..0493de387
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-req.xml.tpl
@@ -0,0 +1,7 @@
+<network>
+ <label>public</label>
+ <cidr>172.0.0.0/24</cidr>
+ <vlan_start>1</vlan_start>
+ <num_networks>1</num_networks>
+ <network_size>255</network_size>
+</network>
diff --git a/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-res.xml.tpl b/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-res.xml.tpl
new file mode 100644
index 000000000..9c6c2f28b
--- /dev/null
+++ b/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-res.xml.tpl
@@ -0,0 +1,5 @@
+<network>
+ <cidr>172.0.0.0/24</cidr>
+ <id>%(id)s</id>
+ <label>public</label>
+</network>
diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py
index b929949d3..a7e66cefd 100644
--- a/nova/tests/integrated/test_api_samples.py
+++ b/nova/tests/integrated/test_api_samples.py
@@ -2665,6 +2665,17 @@ class OsNetworksJsonTests(ApiSampleTestBase):
self.assertEqual(response.status, 202)
+class OsNetworksXmlTests(OsNetworksJsonTests):
+ ctype = 'xml'
+
+ def test_delete_network(self):
+ response = self._do_post('os-tenant-networks', "networks-post-req", {})
+ net = etree.fromstring(response.read())
+ network_id = net.find('id').text
+ response = self._do_delete('os-tenant-networks/%s' % network_id)
+ self.assertEqual(response.status, 202)
+
+
class NetworksJsonTests(ApiSampleTestBase):
extension_name = ("nova.api.openstack.compute.contrib"
".os_networks.Os_networks")