Merge multinic functional tests between v2 and v2.1

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 multinic functional tests.

In V2.1 os-access-ip is separate plugin where in v2 it was mixed in server
plugin itself. So os-access-ip extension is enabled to run
merged functional tests for both v2 and v2.1.

Change-Id: I92c2d128ccb5728de77991544a58c1b6c6ca47fc
This commit is contained in:
ghanshyam 2015-04-13 14:58:41 +09:00
parent 168cea8031
commit 710108e069
6 changed files with 15 additions and 54 deletions

View File

@ -1,5 +0,0 @@
{
"addFixedIp": {
"networkId": 1
}
}

View File

@ -1,5 +0,0 @@
{
"removeFixedIp":{
"address": "10.0.0.2"
}
}

View File

@ -1,5 +0,0 @@
{
"addFixedIp": {
"networkId": %(networkId)s
}
}

View File

@ -1,5 +0,0 @@
{
"removeFixedIp":{
"address": "%(ip)s"
}
}

View File

@ -1764,40 +1764,6 @@ class BlockDeviceMappingV2BootJsonTest(ServersSampleBase):
return self._post_server()
class MultinicSampleJsonTest(ServersSampleBase):
ADMIN_API = True
extension_name = "nova.api.openstack.compute.contrib.multinic.Multinic"
def _disable_instance_dns_manager(self):
# NOTE(markmc): it looks like multinic and instance_dns_manager are
# incompatible. See:
# https://bugs.launchpad.net/nova/+bug/1213251
self.flags(
instance_dns_manager='nova.network.noop_dns_driver.NoopDNSDriver')
def setUp(self):
self._disable_instance_dns_manager()
super(MultinicSampleJsonTest, self).setUp()
self.uuid = self._post_server()
def _add_fixed_ip(self):
subs = {"networkId": 1}
response = self._do_post('servers/%s/action' % (self.uuid),
'multinic-add-fixed-ip-req', subs)
self.assertEqual(response.status_code, 202)
def test_add_fixed_ip(self):
self._add_fixed_ip()
def test_remove_fixed_ip(self):
self._add_fixed_ip()
subs = {"ip": "10.0.0.4"}
response = self._do_post('servers/%s/action' % (self.uuid),
'multinic-remove-fixed-ip-req', subs)
self.assertEqual(response.status_code, 202)
class FpingSampleJsonTests(ServersSampleBase):
extension_name = ("nova.api.openstack.compute.contrib.fping.Fping")

View File

@ -13,12 +13,27 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from nova.tests.functional.v3 import test_servers
CONF = cfg.CONF
CONF.import_opt('osapi_compute_extension',
'nova.api.openstack.compute.extensions')
class MultinicSampleJsonTest(test_servers.ServersSampleBase):
ADMIN_API = True
extension_name = "os-multinic"
extra_extensions_to_load = ["os-access-ips"]
_api_version = 'v2'
def _get_flags(self):
f = super(MultinicSampleJsonTest, self)._get_flags()
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
f['osapi_compute_extension'].append(
'nova.api.openstack.compute.contrib.multinic.Multinic')
return f
def _disable_instance_dns_manager(self):
# NOTE(markmc): it looks like multinic and instance_dns_manager are