Merge "Merge SchedulerHints functional tests of v2 and v2.1"
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"server": {
|
||||
"name": "new-server-test",
|
||||
"imageRef": "70a599e0-31e7-49b7-b260-868f441e862b",
|
||||
"flavorRef": "1"
|
||||
},
|
||||
"os:scheduler_hints": {
|
||||
"hypervisor": "xen",
|
||||
"near": "2b7c42eb-7736-4a0f-afab-f23969a35ada"
|
||||
}
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"server": {
|
||||
"adminPass": "yjzytFHb7XHc",
|
||||
"id": "f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v2/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/openstack/servers/f8f4f3ce-f6e0-4e05-8f79-bf984fdfce45",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@@ -4,13 +4,13 @@
|
||||
"id": "4c8b1df3-46f7-4555-98d8-cdb869aaf9ad",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/4c8b1df3-46f7-4555-98d8-cdb869aaf9ad",
|
||||
"href": "http://openstack.example.com/v2/openstack/servers/4c8b1df3-46f7-4555-98d8-cdb869aaf9ad",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/4c8b1df3-46f7-4555-98d8-cdb869aaf9ad",
|
||||
"href": "http://openstack.example.com/openstack/servers/4c8b1df3-46f7-4555-98d8-cdb869aaf9ad",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"server": {
|
||||
"name": "new-server-test",
|
||||
"imageRef": "%(image_id)s",
|
||||
"flavorRef": "1"
|
||||
},
|
||||
"os:scheduler_hints": {
|
||||
"hypervisor": "xen",
|
||||
"near": "%(image_near)s"
|
||||
}
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"server": {
|
||||
"adminPass": "%(password)s",
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "%(host)s/v2/openstack/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "%(host)s/openstack/servers/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
@@ -207,21 +207,6 @@ class LimitsSampleJsonTest(ApiSampleTestBaseV2):
|
||||
self._verify_response('limit-get-resp', subs, response, 200)
|
||||
|
||||
|
||||
class SchedulerHintsJsonTest(ApiSampleTestBaseV2):
|
||||
extension_name = ("nova.api.openstack.compute.contrib.scheduler_hints."
|
||||
"Scheduler_hints")
|
||||
|
||||
def test_scheduler_hints_post(self):
|
||||
# Get api sample of scheduler hint post request.
|
||||
hints = {'image_id': fake.get_valid_image_id(),
|
||||
'image_near': str(uuid_lib.uuid4())
|
||||
}
|
||||
response = self._do_post('servers', 'scheduler-hints-post-req',
|
||||
hints)
|
||||
subs = self._get_regexes()
|
||||
self._verify_response('scheduler-hints-post-resp', subs, response, 202)
|
||||
|
||||
|
||||
class KeyPairsSampleJsonTest(ApiSampleTestBaseV2):
|
||||
extension_name = "nova.api.openstack.compute.contrib.keypairs.Keypairs"
|
||||
|
||||
|
@@ -4,11 +4,11 @@
|
||||
"id": "%(id)s",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://openstack.example.com/v3/servers/%(uuid)s",
|
||||
"href": "http://openstack.example.com/v2/openstack/servers/%(uuid)s",
|
||||
"rel": "self"
|
||||
},
|
||||
{
|
||||
"href": "http://openstack.example.com/servers/%(uuid)s",
|
||||
"href": "http://openstack.example.com/openstack/servers/%(uuid)s",
|
||||
"rel": "bookmark"
|
||||
}
|
||||
]
|
||||
|
@@ -15,13 +15,32 @@
|
||||
|
||||
import uuid
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from nova.tests.functional.v3 import api_sample_base
|
||||
from nova.tests.unit.image import fake
|
||||
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt('osapi_compute_extension',
|
||||
'nova.api.openstack.compute.extensions')
|
||||
|
||||
|
||||
class SchedulerHintsJsonTest(api_sample_base.ApiSampleTestBaseV3):
|
||||
extension_name = "os-scheduler-hints"
|
||||
|
||||
# TODO(madhuri): 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(SchedulerHintsJsonTest, self)._get_flags()
|
||||
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
|
||||
f['osapi_compute_extension'].append(
|
||||
"nova.api.openstack.compute.contrib.scheduler_hints."
|
||||
"Scheduler_hints")
|
||||
return f
|
||||
|
||||
def test_scheduler_hints_post(self):
|
||||
# Get api sample of scheduler hint post request.
|
||||
subs = self._get_regexes()
|
||||
|
Reference in New Issue
Block a user