From d98aa4fadcac2f7eadcbd7c57e3865a1157cf0ef Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Wed, 25 Mar 2015 15:42:35 +0900 Subject: [PATCH] Merge V2 and V2.1 floating ips functional tests Currently v2 and v2.1 have separate functional tests and their corresponding sample files. As v2 and v2.1 are supposed to be identical, there is overhead to maintain two set of functional tests and sample files. We can have one set of tests which can run for both v2 and v2.1. This commit merges all floating ip functional tests. Below APIs tests are megred- -floating_ip_dns -floating-ips-bulk -floating-ips -floating-ip-pools Change-Id: Ibde0b152949559dec90ea0e7ee6668ab05b4927f --- ...ing-ip-dns-create-or-update-entry-req.json | 6 - ...ng-ip-dns-create-or-update-entry-resp.json | 9 - .../floating-ip-dns-create-or-update-req.json | 7 - ...floating-ip-dns-create-or-update-resp.json | 8 - .../floating-ip-dns-entry-get-resp.json | 9 - .../floating-ip-dns-entry-list-resp.json | 11 - .../floating-ip-dns-list-resp.json | 10 - .../floatingippools-list-resp.json | 10 - .../floating-ips-bulk-create-req.json | 8 - .../floating-ips-bulk-create-resp.json | 7 - .../floating-ips-bulk-delete-req.json | 3 - .../floating-ips-bulk-delete-resp.json | 3 - .../floating-ips-bulk-list-by-host-resp.json | 12 - .../floating-ips-bulk-list-resp.json | 28 -- .../floating-ips-create-req.json | 3 - .../floating-ips-create-resp.json | 9 - .../floating-ips-get-resp.json | 9 - .../floating-ips-list-empty-resp.json | 3 - .../floating-ips-list-resp.json | 18 -- ...ip-dns-create-or-update-entry-req.json.tpl | 7 - ...p-dns-create-or-update-entry-resp.json.tpl | 9 - ...ating-ip-dns-create-or-update-req.json.tpl | 8 - ...ting-ip-dns-create-or-update-resp.json.tpl | 8 - .../floating-ip-dns-entry-get-resp.json.tpl | 9 - .../floating-ip-dns-entry-list-resp.json.tpl | 11 - .../floating-ip-dns-list-resp.json.tpl | 10 - .../floatingippools-list-resp.json.tpl | 10 - .../floating-ips-bulk-create-req.json.tpl | 8 - .../floating-ips-bulk-create-resp.json.tpl | 7 - .../floating-ips-bulk-delete-req.json.tpl | 3 - .../floating-ips-bulk-delete-resp.json.tpl | 3 - ...oating-ips-bulk-list-by-host-resp.json.tpl | 12 - .../floating-ips-bulk-list-resp.json.tpl | 28 -- .../floating-ips-create-nopool-req.json.tpl | 0 .../floating-ips-create-req.json.tpl | 3 - .../floating-ips-create-resp.json.tpl | 9 - .../floating-ips-get-resp.json.tpl | 9 - .../floating-ips-list-empty-resp.json.tpl | 3 - .../floating-ips-list-resp.json.tpl | 19 -- nova/tests/functional/test_api_samples.py | 258 ------------------ .../functional/v3/test_floating_ip_dns.py | 17 ++ .../functional/v3/test_floating_ip_pools.py | 17 ++ nova/tests/functional/v3/test_floating_ips.py | 15 + .../functional/v3/test_floating_ips_bulk.py | 13 + 44 files changed, 62 insertions(+), 607 deletions(-) delete mode 100644 doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json delete mode 100644 doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json delete mode 100644 doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json delete mode 100644 doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json delete mode 100644 doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json delete mode 100644 doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json delete mode 100644 doc/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json delete mode 100644 doc/api_samples/os-floating-ip-pools/floatingippools-list-resp.json delete mode 100644 doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json delete mode 100644 doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json delete mode 100644 doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json delete mode 100644 doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json delete mode 100644 doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json delete mode 100644 doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json delete mode 100644 doc/api_samples/os-floating-ips/floating-ips-create-req.json delete mode 100644 doc/api_samples/os-floating-ips/floating-ips-create-resp.json delete mode 100644 doc/api_samples/os-floating-ips/floating-ips-get-resp.json delete mode 100644 doc/api_samples/os-floating-ips/floating-ips-list-empty-resp.json delete mode 100644 doc/api_samples/os-floating-ips/floating-ips-list-resp.json delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ip-pools/floatingippools-list-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-nopool-req.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-req.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips/floating-ips-get-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-empty-resp.json.tpl delete mode 100644 nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-resp.json.tpl diff --git a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json b/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json deleted file mode 100644 index 77b8fdb6be..0000000000 --- a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "dns_entry": { - "ip": "192.168.53.11", - "dns_type": "A" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json b/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json deleted file mode 100644 index 70c9038864..0000000000 --- a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dns_entry": { - "domain": "domain1.example.org", - "id": null, - "ip": "192.168.1.1", - "name": "instance1", - "type": "A" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json b/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json deleted file mode 100644 index 2d517ff2c0..0000000000 --- a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "domain_entry": { - "domain": "domain1.example.org", - "scope": "public", - "project": "project1" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json b/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json deleted file mode 100644 index db43e92d34..0000000000 --- a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "domain_entry": { - "availability_zone": null, - "domain": "domain1.example.org", - "project": "project1", - "scope": "public" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json b/doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json deleted file mode 100644 index 84ee3930a3..0000000000 --- a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dns_entry": { - "domain": "domain1.example.org", - "id": null, - "ip": "192.168.1.1", - "name": "instance1", - "type": null - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json b/doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json deleted file mode 100644 index 3263de43ab..0000000000 --- a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dns_entries": [ - { - "domain": "domain1.example.org", - "id": null, - "ip": "192.168.1.1", - "name": "instance1", - "type": null - } - ] -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json b/doc/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json deleted file mode 100644 index 8882c23a3d..0000000000 --- a/doc/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "domain_entries": [ - { - "availability_zone": null, - "domain": "domain1.example.org", - "project": "project1", - "scope": "public" - } - ] -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ip-pools/floatingippools-list-resp.json b/doc/api_samples/os-floating-ip-pools/floatingippools-list-resp.json deleted file mode 100644 index 7b64829875..0000000000 --- a/doc/api_samples/os-floating-ip-pools/floatingippools-list-resp.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "floating_ip_pools": [ - { - "name": "pool1" - }, - { - "name": "pool2" - } - ] -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json b/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json deleted file mode 100644 index d174bad5ab..0000000000 --- a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "floating_ips_bulk_create" : - { - "ip_range": "192.168.1.0/24", - "pool": "nova", - "interface": "eth0" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json b/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json deleted file mode 100644 index ef1cbfb17f..0000000000 --- a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "floating_ips_bulk_create": { - "interface": "eth0", - "ip_range": "192.168.1.0/24", - "pool": "nova" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json b/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json deleted file mode 100644 index df59c1a735..0000000000 --- a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ip_range": "192.168.1.0/24" -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json b/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json deleted file mode 100644 index 166984b24a..0000000000 --- a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "floating_ips_bulk_delete": "192.168.1.0/24" -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json b/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json deleted file mode 100644 index 8a63467629..0000000000 --- a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "floating_ip_info": [ - { - "address": "10.10.10.3", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - } - ] -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json b/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json deleted file mode 100644 index 60a5e4c57e..0000000000 --- a/doc/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "floating_ip_info": [ - { - "address": "10.10.10.1", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - }, - { - "address": "10.10.10.2", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - }, - { - "address": "10.10.10.3", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - } - ] -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips/floating-ips-create-req.json b/doc/api_samples/os-floating-ips/floating-ips-create-req.json deleted file mode 100644 index 511b009bed..0000000000 --- a/doc/api_samples/os-floating-ips/floating-ips-create-req.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "pool": "nova" -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips/floating-ips-create-resp.json b/doc/api_samples/os-floating-ips/floating-ips-create-resp.json deleted file mode 100644 index fe161a7dd1..0000000000 --- a/doc/api_samples/os-floating-ips/floating-ips-create-resp.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "floating_ip": { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips/floating-ips-get-resp.json b/doc/api_samples/os-floating-ips/floating-ips-get-resp.json deleted file mode 100644 index fe161a7dd1..0000000000 --- a/doc/api_samples/os-floating-ips/floating-ips-get-resp.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "floating_ip": { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - } -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips/floating-ips-list-empty-resp.json b/doc/api_samples/os-floating-ips/floating-ips-list-empty-resp.json deleted file mode 100644 index 121dbd084e..0000000000 --- a/doc/api_samples/os-floating-ips/floating-ips-list-empty-resp.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "floating_ips": [] -} \ No newline at end of file diff --git a/doc/api_samples/os-floating-ips/floating-ips-list-resp.json b/doc/api_samples/os-floating-ips/floating-ips-list-resp.json deleted file mode 100644 index 4d58e0676a..0000000000 --- a/doc/api_samples/os-floating-ips/floating-ips-list-resp.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "floating_ips": [ - { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - }, - { - "fixed_ip": null, - "id": 2, - "instance_id": null, - "ip": "10.10.10.2", - "pool": "nova" - } - ] -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json.tpl deleted file mode 100644 index 7dc33ddb10..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-req.json.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dns_entry" : - { - "ip": "%(ip)s", - "dns_type": "%(dns_type)s" - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json.tpl deleted file mode 100644 index 3ec0743ba7..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-entry-resp.json.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dns_entry": { - "domain": "%(domain)s", - "id": null, - "ip": "%(ip)s", - "name": "%(name)s", - "type": "%(dns_type)s" - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json.tpl deleted file mode 100644 index db73be14a8..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-req.json.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{ - "domain_entry" : - { - "domain": "%(domain)s", - "scope": "%(scope)s", - "project": "%(project)s" - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json.tpl deleted file mode 100644 index a14d395d23..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-create-or-update-resp.json.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{ - "domain_entry": { - "availability_zone": null, - "domain": "%(domain)s", - "project": "%(project)s", - "scope": "%(scope)s" - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json.tpl deleted file mode 100644 index 8edd0603f7..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-get-resp.json.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dns_entry": { - "domain": "%(domain)s", - "id": null, - "ip": "%(ip)s", - "name": "%(name)s", - "type": null - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json.tpl deleted file mode 100644 index 831cda7b55..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-entry-list-resp.json.tpl +++ /dev/null @@ -1,11 +0,0 @@ -{ - "dns_entries": [ - { - "domain": "%(domain)s", - "id": null, - "ip": "%(ip)s", - "name": "%(name)s", - "type": null - } - ] -} diff --git a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json.tpl deleted file mode 100644 index a6055cfecc..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-dns/floating-ip-dns-list-resp.json.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{ - "domain_entries": [ - { - "availability_zone": null, - "domain": "%(domain)s", - "project": "%(project)s", - "scope": "%(scope)s" - } - ] -} diff --git a/nova/tests/functional/api_samples/os-floating-ip-pools/floatingippools-list-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ip-pools/floatingippools-list-resp.json.tpl deleted file mode 100644 index 607109d70d..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ip-pools/floatingippools-list-resp.json.tpl +++ /dev/null @@ -1,10 +0,0 @@ -{ - "floating_ip_pools": [ - { - "name": "%(pool1)s" - }, - { - "name": "%(pool2)s" - } - ] -} diff --git a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json.tpl b/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json.tpl deleted file mode 100644 index 426f07e989..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-req.json.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{ - "floating_ips_bulk_create" : - { - "ip_range": "%(ip_range)s", - "pool": "%(pool)s", - "interface": "%(interface)s" - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json.tpl deleted file mode 100644 index ef1cbfb17f..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-create-resp.json.tpl +++ /dev/null @@ -1,7 +0,0 @@ -{ - "floating_ips_bulk_create": { - "interface": "eth0", - "ip_range": "192.168.1.0/24", - "pool": "nova" - } -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json.tpl b/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json.tpl deleted file mode 100644 index d630d669cd..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-req.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ip_range": "%(ip_range)s" -} diff --git a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json.tpl deleted file mode 100644 index 166984b24a..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-delete-resp.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "floating_ips_bulk_delete": "192.168.1.0/24" -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json.tpl deleted file mode 100644 index 8a63467629..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-by-host-resp.json.tpl +++ /dev/null @@ -1,12 +0,0 @@ -{ - "floating_ip_info": [ - { - "address": "10.10.10.3", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - } - ] -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json.tpl deleted file mode 100644 index 60a5e4c57e..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips-bulk/floating-ips-bulk-list-resp.json.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{ - "floating_ip_info": [ - { - "address": "10.10.10.1", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - }, - { - "address": "10.10.10.2", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - }, - { - "address": "10.10.10.3", - "instance_uuid": null, - "fixed_ip": null, - "interface": "eth0", - "pool": "nova", - "project_id": null - } - ] -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-nopool-req.json.tpl b/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-nopool-req.json.tpl deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-req.json.tpl b/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-req.json.tpl deleted file mode 100644 index 24129f4958..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-req.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "pool": "%(pool)s" -} \ No newline at end of file diff --git a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-resp.json.tpl deleted file mode 100644 index 10ee8d9bd4..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-create-resp.json.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{ - "floating_ip": { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-get-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips/floating-ips-get-resp.json.tpl deleted file mode 100644 index 10ee8d9bd4..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-get-resp.json.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{ - "floating_ip": { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - } -} diff --git a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-empty-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-empty-resp.json.tpl deleted file mode 100644 index 12f118da50..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-empty-resp.json.tpl +++ /dev/null @@ -1,3 +0,0 @@ -{ - "floating_ips": [] -} diff --git a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-resp.json.tpl b/nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-resp.json.tpl deleted file mode 100644 index 06f57451c9..0000000000 --- a/nova/tests/functional/api_samples/os-floating-ips/floating-ips-list-resp.json.tpl +++ /dev/null @@ -1,19 +0,0 @@ -{ - "floating_ips": [ - { - "fixed_ip": null, - "id": 1, - "instance_id": null, - "ip": "10.10.10.1", - "pool": "nova" - }, - { - "fixed_ip": null, - "id": 2, - "instance_id": null, - "ip": "10.10.10.2", - "pool": "nova" - } - ] -} - diff --git a/nova/tests/functional/test_api_samples.py b/nova/tests/functional/test_api_samples.py index 25092988f9..64a1631398 100644 --- a/nova/tests/functional/test_api_samples.py +++ b/nova/tests/functional/test_api_samples.py @@ -793,166 +793,6 @@ class ExtendedServerAttributesJsonTest(ServersSampleBase): self._verify_response('servers-detail-resp', subs, response, 200) -class FloatingIpsJsonTest(ApiSampleTestBaseV2): - extension_name = "nova.api.openstack.compute.contrib." \ - "floating_ips.Floating_ips" - - def setUp(self): - super(FloatingIpsJsonTest, self).setUp() - pool = CONF.default_floating_pool - interface = CONF.public_interface - - self.ip_pool = [ - { - 'address': "10.10.10.1", - 'pool': pool, - 'interface': interface - }, - { - 'address': "10.10.10.2", - 'pool': pool, - 'interface': interface - }, - { - 'address': "10.10.10.3", - 'pool': pool, - 'interface': interface - }, - ] - self.compute.db.floating_ip_bulk_create( - context.get_admin_context(), self.ip_pool) - - def tearDown(self): - self.compute.db.floating_ip_bulk_destroy( - context.get_admin_context(), self.ip_pool) - super(FloatingIpsJsonTest, self).tearDown() - - def test_floating_ips_list_empty(self): - response = self._do_get('os-floating-ips') - - subs = self._get_regexes() - self._verify_response('floating-ips-list-empty-resp', - subs, response, 200) - - def test_floating_ips_list(self): - self._do_post('os-floating-ips', - 'floating-ips-create-nopool-req', - {}) - self._do_post('os-floating-ips', - 'floating-ips-create-nopool-req', - {}) - - response = self._do_get('os-floating-ips') - subs = self._get_regexes() - self._verify_response('floating-ips-list-resp', - subs, response, 200) - - def test_floating_ips_create_nopool(self): - response = self._do_post('os-floating-ips', - 'floating-ips-create-nopool-req', - {}) - subs = self._get_regexes() - self._verify_response('floating-ips-create-resp', - subs, response, 200) - - def test_floating_ips_create(self): - response = self._do_post('os-floating-ips', - 'floating-ips-create-req', - {"pool": CONF.default_floating_pool}) - subs = self._get_regexes() - self._verify_response('floating-ips-create-resp', subs, response, 200) - - def test_floating_ips_get(self): - self.test_floating_ips_create() - # NOTE(sdague): the first floating ip will always have 1 as an id, - # but it would be better if we could get this from the create - response = self._do_get('os-floating-ips/%d' % 1) - subs = self._get_regexes() - self._verify_response('floating-ips-get-resp', subs, response, 200) - - def test_floating_ips_delete(self): - self.test_floating_ips_create() - response = self._do_delete('os-floating-ips/%d' % 1) - self.assertEqual(response.status_code, 202) - self.assertEqual(response.content, "") - - -class ExtendedFloatingIpsJsonTest(FloatingIpsJsonTest): - extends_name = ("nova.api.openstack.compute.contrib." - "floating_ips.Floating_ips") - extension_name = ("nova.api.openstack.compute.contrib." - "extended_floating_ips.Extended_floating_ips") - - -class FloatingIpsBulkJsonTest(ApiSampleTestBaseV2): - ADMIN_API = True - extension_name = "nova.api.openstack.compute.contrib." \ - "floating_ips_bulk.Floating_ips_bulk" - - def setUp(self): - super(FloatingIpsBulkJsonTest, self).setUp() - pool = CONF.default_floating_pool - interface = CONF.public_interface - - self.ip_pool = [ - { - 'address': "10.10.10.1", - 'pool': pool, - 'interface': interface, - 'host': None - }, - { - 'address': "10.10.10.2", - 'pool': pool, - 'interface': interface, - 'host': None - }, - { - 'address': "10.10.10.3", - 'pool': pool, - 'interface': interface, - 'host': "testHost" - }, - ] - self.compute.db.floating_ip_bulk_create( - context.get_admin_context(), self.ip_pool) - - def tearDown(self): - self.compute.db.floating_ip_bulk_destroy( - context.get_admin_context(), self.ip_pool) - super(FloatingIpsBulkJsonTest, self).tearDown() - - def test_floating_ips_bulk_list(self): - response = self._do_get('os-floating-ips-bulk') - subs = self._get_regexes() - self._verify_response('floating-ips-bulk-list-resp', - subs, response, 200) - - def test_floating_ips_bulk_list_by_host(self): - response = self._do_get('os-floating-ips-bulk/testHost') - subs = self._get_regexes() - self._verify_response('floating-ips-bulk-list-by-host-resp', - subs, response, 200) - - def test_floating_ips_bulk_create(self): - response = self._do_post('os-floating-ips-bulk', - 'floating-ips-bulk-create-req', - {"ip_range": "192.168.1.0/24", - "pool": CONF.default_floating_pool, - "interface": CONF.public_interface}) - subs = self._get_regexes() - self._verify_response('floating-ips-bulk-create-resp', subs, - response, 200) - - def test_floating_ips_bulk_delete(self): - response = self._do_put('os-floating-ips-bulk/delete', - 'floating-ips-bulk-delete-req', - {"ip_range": "192.168.1.0/24"}) - subs = self._get_regexes() - self._verify_response('floating-ips-bulk-delete-resp', subs, - response, 200) - - class KeyPairsSampleJsonTest(ApiSampleTestBaseV2): extension_name = "nova.api.openstack.compute.contrib.keypairs.Keypairs" @@ -2677,26 +2517,6 @@ class BlockDeviceMappingV2BootJsonTest(ServersSampleBase): return self._post_server() -class FloatingIPPoolsSampleJsonTests(ApiSampleTestBaseV2): - extension_name = ("nova.api.openstack.compute.contrib.floating_ip_pools." - "Floating_ip_pools") - - def test_list_floatingippools(self): - pool_list = ["pool1", "pool2"] - - def fake_get_floating_ip_pools(self, context): - return pool_list - - self.stubs.Set(network_api.API, "get_floating_ip_pools", - fake_get_floating_ip_pools) - response = self._do_get('os-floating-ip-pools') - subs = { - 'pool1': pool_list[0], - 'pool2': pool_list[1] - } - self._verify_response('floatingippools-list-resp', subs, response, 200) - - class MultinicSampleJsonTest(ServersSampleBase): ADMIN_API = True extension_name = "nova.api.openstack.compute.contrib.multinic.Multinic" @@ -2938,84 +2758,6 @@ class EvacuateFindHostSampleJsonTest(ServersSampleBase): host=None) -class FloatingIpDNSJsonTest(ApiSampleTestBaseV2): - ADMIN_API = True - extension_name = ("nova.api.openstack.compute.contrib.floating_ip_dns." - "Floating_ip_dns") - - domain = 'domain1.example.org' - name = 'instance1' - scope = 'public' - project = 'project1' - dns_type = 'A' - ip = '192.168.1.1' - - def _create_or_update(self): - subs = {'domain': self.domain, - 'project': self.project, - 'scope': self.scope} - response = self._do_put('os-floating-ip-dns/%s' % self.domain, - 'floating-ip-dns-create-or-update-req', subs) - self._verify_response('floating-ip-dns-create-or-update-resp', subs, - response, 200) - - def _create_or_update_entry(self): - subs = {'ip': self.ip, 'dns_type': self.dns_type} - response = self._do_put('os-floating-ip-dns/%s/entries/%s' - % (self.domain, self.name), - 'floating-ip-dns-create-or-update-entry-req', - subs) - subs.update({'name': self.name, 'domain': self.domain}) - self._verify_response('floating-ip-dns-create-or-update-entry-resp', - subs, response, 200) - - def test_floating_ip_dns_list(self): - self._create_or_update() - response = self._do_get('os-floating-ip-dns') - subs = {'domain': self.domain, - 'project': self.project, - 'scope': self.scope} - self._verify_response('floating-ip-dns-list-resp', subs, - response, 200) - - def test_floating_ip_dns_create_or_update(self): - self._create_or_update() - - def test_floating_ip_dns_delete(self): - self._create_or_update() - response = self._do_delete('os-floating-ip-dns/%s' % self.domain) - self.assertEqual(response.status_code, 202) - - def test_floating_ip_dns_create_or_update_entry(self): - self._create_or_update_entry() - - def test_floating_ip_dns_entry_get(self): - self._create_or_update_entry() - response = self._do_get('os-floating-ip-dns/%s/entries/%s' - % (self.domain, self.name)) - subs = {'domain': self.domain, - 'ip': self.ip, - 'name': self.name} - self._verify_response('floating-ip-dns-entry-get-resp', subs, - response, 200) - - def test_floating_ip_dns_entry_delete(self): - self._create_or_update_entry() - response = self._do_delete('os-floating-ip-dns/%s/entries/%s' - % (self.domain, self.name)) - self.assertEqual(response.status_code, 202) - - def test_floating_ip_dns_entry_list(self): - self._create_or_update_entry() - response = self._do_get('os-floating-ip-dns/%s/entries/%s' - % (self.domain, self.ip)) - subs = {'domain': self.domain, - 'ip': self.ip, - 'name': self.name} - self._verify_response('floating-ip-dns-entry-list-resp', subs, - response, 200) - - class InstanceActionsSampleJsonTest(ApiSampleTestBaseV2): ADMIN_API = True extension_name = ('nova.api.openstack.compute.contrib.instance_actions.' diff --git a/nova/tests/functional/v3/test_floating_ip_dns.py b/nova/tests/functional/v3/test_floating_ip_dns.py index 4b62a03741..0b62331f58 100644 --- a/nova/tests/functional/v3/test_floating_ip_dns.py +++ b/nova/tests/functional/v3/test_floating_ip_dns.py @@ -12,8 +12,14 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg + from nova.tests.functional.v3 import api_sample_base +CONF = cfg.CONF +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') + class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV3): ADMIN_API = True @@ -25,6 +31,17 @@ class FloatingIpDNSTest(api_sample_base.ApiSampleTestBaseV3): project = 'project1' dns_type = 'A' ip = '192.168.1.1' + # TODO(gmann): Overriding '_api_version' till all functional tests + # are merged between v2 and v2.1. After that base class variable + # itself can be changed to 'v2' + _api_version = 'v2' + + def _get_flags(self): + f = super(FloatingIpDNSTest, self)._get_flags() + f['osapi_compute_extension'] = CONF.osapi_compute_extension[:] + f['osapi_compute_extension'].append('nova.api.openstack.compute.' + 'contrib.floating_ip_dns.Floating_ip_dns') + return f def _create_or_update(self): subs = {'project': self.project, diff --git a/nova/tests/functional/v3/test_floating_ip_pools.py b/nova/tests/functional/v3/test_floating_ip_pools.py index 268091bcad..b5ed49b989 100644 --- a/nova/tests/functional/v3/test_floating_ip_pools.py +++ b/nova/tests/functional/v3/test_floating_ip_pools.py @@ -12,12 +12,29 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg + from nova.network import api as network_api from nova.tests.functional.v3 import api_sample_base +CONF = cfg.CONF +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') + class FloatingIPPoolsSampleTests(api_sample_base.ApiSampleTestBaseV3): extension_name = "os-floating-ip-pools" + # TODO(gmann): Overriding '_api_version' till all functional tests + # are merged between v2 and v2.1. After that base class variable + # itself can be changed to 'v2' + _api_version = 'v2' + + def _get_flags(self): + f = super(FloatingIPPoolsSampleTests, self)._get_flags() + f['osapi_compute_extension'] = CONF.osapi_compute_extension[:] + f['osapi_compute_extension'].append('nova.api.openstack.compute.' + 'contrib.floating_ip_pools.Floating_ip_pools') + return f def test_list_floatingippools(self): pool_list = ["pool1", "pool2"] diff --git a/nova/tests/functional/v3/test_floating_ips.py b/nova/tests/functional/v3/test_floating_ips.py index 6b59438f34..68aa7f3aab 100644 --- a/nova/tests/functional/v3/test_floating_ips.py +++ b/nova/tests/functional/v3/test_floating_ips.py @@ -21,10 +21,25 @@ from nova.tests.functional.v3 import api_sample_base CONF = cfg.CONF CONF.import_opt('default_floating_pool', 'nova.network.floating_ips') CONF.import_opt('public_interface', 'nova.network.linux_net') +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') class FloatingIpsTest(api_sample_base.ApiSampleTestBaseV3): extension_name = "os-floating-ips" + # TODO(gmann): Overriding '_api_version' till all functional tests + # are merged between v2 and v2.1. After that base class variable + # itself can be changed to 'v2' + _api_version = 'v2' + + def _get_flags(self): + f = super(FloatingIpsTest, self)._get_flags() + f['osapi_compute_extension'] = CONF.osapi_compute_extension[:] + f['osapi_compute_extension'].append('nova.api.openstack.compute.' + 'contrib.floating_ips.Floating_ips') + f['osapi_compute_extension'].append('nova.api.openstack.compute.' + 'contrib.extended_floating_ips.Extended_floating_ips') + return f def setUp(self): super(FloatingIpsTest, self).setUp() diff --git a/nova/tests/functional/v3/test_floating_ips_bulk.py b/nova/tests/functional/v3/test_floating_ips_bulk.py index a559f663bc..c5b43d12f2 100644 --- a/nova/tests/functional/v3/test_floating_ips_bulk.py +++ b/nova/tests/functional/v3/test_floating_ips_bulk.py @@ -21,11 +21,24 @@ from nova.tests.functional.v3 import api_sample_base CONF = cfg.CONF CONF.import_opt('default_floating_pool', 'nova.network.floating_ips') CONF.import_opt('public_interface', 'nova.network.linux_net') +CONF.import_opt('osapi_compute_extension', + 'nova.api.openstack.compute.extensions') class FloatingIpsBulkTest(api_sample_base.ApiSampleTestBaseV3): ADMIN_API = True extension_name = "os-floating-ips-bulk" + # TODO(gmann): Overriding '_api_version' till all functional tests + # are merged between v2 and v2.1. After that base class variable + # itself can be changed to 'v2' + _api_version = 'v2' + + def _get_flags(self): + f = super(FloatingIpsBulkTest, self)._get_flags() + f['osapi_compute_extension'] = CONF.osapi_compute_extension[:] + f['osapi_compute_extension'].append('nova.api.openstack.compute.' + 'contrib.floating_ips_bulk.Floating_ips_bulk') + return f def setUp(self): super(FloatingIpsBulkTest, self).setUp()