diff --git a/doc/api_samples/os-tenant-networks/networks-list-res.xml b/doc/api_samples/os-tenant-networks/networks-list-res.xml new file mode 100644 index 0000000000..6aaeec85bb --- /dev/null +++ b/doc/api_samples/os-tenant-networks/networks-list-res.xml @@ -0,0 +1,13 @@ + + + + 10.0.0.0/29 + cf3fb0f1-9967-4dac-8284-2d103e904099 + + + + 10.0.0.8/29 + 434385bc-a7ac-4778-b295-56f8134fddbc + + + \ No newline at end of file diff --git a/doc/api_samples/os-tenant-networks/networks-post-req.xml b/doc/api_samples/os-tenant-networks/networks-post-req.xml new file mode 100644 index 0000000000..f4c06aa9d8 --- /dev/null +++ b/doc/api_samples/os-tenant-networks/networks-post-req.xml @@ -0,0 +1,7 @@ + + + 172.0.0.0/24 + 1 + 1 + 255 + \ No newline at end of file diff --git a/doc/api_samples/os-tenant-networks/networks-post-res.xml b/doc/api_samples/os-tenant-networks/networks-post-res.xml new file mode 100644 index 0000000000..7bbc6a4b68 --- /dev/null +++ b/doc/api_samples/os-tenant-networks/networks-post-res.xml @@ -0,0 +1,6 @@ + + + 172.0.0.0/24 + 9ac30188-57d8-4349-94d1-dbad63b20e4d + + \ No newline at end of file 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 0000000000..0562ebae7c --- /dev/null +++ b/nova/tests/integrated/api_samples/os-tenant-networks/networks-list-res.xml.tpl @@ -0,0 +1,13 @@ + + + + 10.0.0.0/29 + %(id)s + + + + 10.0.0.8/29 + %(id)s + + + 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 0000000000..0493de3872 --- /dev/null +++ b/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-req.xml.tpl @@ -0,0 +1,7 @@ + + + 172.0.0.0/24 + 1 + 1 + 255 + 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 0000000000..9c6c2f28b2 --- /dev/null +++ b/nova/tests/integrated/api_samples/os-tenant-networks/networks-post-res.xml.tpl @@ -0,0 +1,5 @@ + + 172.0.0.0/24 + %(id)s + + diff --git a/nova/tests/integrated/test_api_samples.py b/nova/tests/integrated/test_api_samples.py index b929949d31..a7e66cefdb 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")