Merge lock/pause server 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 servers actions lock/unlock, pause/unpause server 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: I7e6c9d414959019eb6d29b2e87e1d8104c801903
This commit is contained in:
parent
2a5b1db132
commit
4aa5ca5424
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"lock": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"pause": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"unlock": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"unlock": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"unpause": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"lock": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"pause": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"unlock": null
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"unpause": null
|
|
||||||
}
|
|
@ -875,19 +875,6 @@ class AdminActionsSamplesJsonTest(ServersSampleBase):
|
|||||||
super(AdminActionsSamplesJsonTest, self).setUp()
|
super(AdminActionsSamplesJsonTest, self).setUp()
|
||||||
self.uuid = self._post_server()
|
self.uuid = self._post_server()
|
||||||
|
|
||||||
def test_post_pause(self):
|
|
||||||
# Get api samples to pause server request.
|
|
||||||
response = self._do_post('servers/%s/action' % self.uuid,
|
|
||||||
'admin-actions-pause', {})
|
|
||||||
self.assertEqual(response.status_code, 202)
|
|
||||||
|
|
||||||
def test_post_unpause(self):
|
|
||||||
# Get api samples to unpause server request.
|
|
||||||
self.test_post_pause()
|
|
||||||
response = self._do_post('servers/%s/action' % self.uuid,
|
|
||||||
'admin-actions-unpause', {})
|
|
||||||
self.assertEqual(response.status_code, 202)
|
|
||||||
|
|
||||||
@mock.patch('nova.conductor.manager.ComputeTaskManager._cold_migrate')
|
@mock.patch('nova.conductor.manager.ComputeTaskManager._cold_migrate')
|
||||||
def test_post_migrate(self, mock_cold_migrate):
|
def test_post_migrate(self, mock_cold_migrate):
|
||||||
# Get api samples to migrate server request.
|
# Get api samples to migrate server request.
|
||||||
@ -907,19 +894,6 @@ class AdminActionsSamplesJsonTest(ServersSampleBase):
|
|||||||
'admin-actions-inject-network-info', {})
|
'admin-actions-inject-network-info', {})
|
||||||
self.assertEqual(response.status_code, 202)
|
self.assertEqual(response.status_code, 202)
|
||||||
|
|
||||||
def test_post_lock_server(self):
|
|
||||||
# Get api samples to lock server request.
|
|
||||||
response = self._do_post('servers/%s/action' % self.uuid,
|
|
||||||
'admin-actions-lock-server', {})
|
|
||||||
self.assertEqual(response.status_code, 202)
|
|
||||||
|
|
||||||
def test_post_unlock_server(self):
|
|
||||||
# Get api samples to unlock server request.
|
|
||||||
self.test_post_lock_server()
|
|
||||||
response = self._do_post('servers/%s/action' % self.uuid,
|
|
||||||
'admin-actions-unlock-server', {})
|
|
||||||
self.assertEqual(response.status_code, 202)
|
|
||||||
|
|
||||||
def test_post_live_migrate_server(self):
|
def test_post_live_migrate_server(self):
|
||||||
# Get api samples to server live migrate request.
|
# Get api samples to server live migrate request.
|
||||||
def fake_live_migrate(_self, context, instance, scheduler_hint,
|
def fake_live_migrate(_self, context, instance, scheduler_hint,
|
||||||
|
@ -13,11 +13,26 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
from nova.tests.functional.v3 import test_servers
|
from nova.tests.functional.v3 import test_servers
|
||||||
|
|
||||||
|
CONF = cfg.CONF
|
||||||
|
CONF.import_opt('osapi_compute_extension',
|
||||||
|
'nova.api.openstack.compute.extensions')
|
||||||
|
|
||||||
|
|
||||||
class LockServerSamplesJsonTest(test_servers.ServersSampleBase):
|
class LockServerSamplesJsonTest(test_servers.ServersSampleBase):
|
||||||
extension_name = "os-lock-server"
|
extension_name = "os-lock-server"
|
||||||
|
extra_extensions_to_load = ["os-access-ips"]
|
||||||
|
_api_version = 'v2'
|
||||||
|
|
||||||
|
def _get_flags(self):
|
||||||
|
f = super(LockServerSamplesJsonTest, self)._get_flags()
|
||||||
|
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
|
||||||
|
f['osapi_compute_extension'].append(
|
||||||
|
'nova.api.openstack.compute.contrib.admin_actions.Admin_actions')
|
||||||
|
return f
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""setUp Method for LockServer api samples extension
|
"""setUp Method for LockServer api samples extension
|
||||||
|
@ -13,11 +13,26 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
from nova.tests.functional.v3 import test_servers
|
from nova.tests.functional.v3 import test_servers
|
||||||
|
|
||||||
|
CONF = cfg.CONF
|
||||||
|
CONF.import_opt('osapi_compute_extension',
|
||||||
|
'nova.api.openstack.compute.extensions')
|
||||||
|
|
||||||
|
|
||||||
class PauseServerSamplesJsonTest(test_servers.ServersSampleBase):
|
class PauseServerSamplesJsonTest(test_servers.ServersSampleBase):
|
||||||
extension_name = "os-pause-server"
|
extension_name = "os-pause-server"
|
||||||
|
extra_extensions_to_load = ["os-access-ips"]
|
||||||
|
_api_version = 'v2'
|
||||||
|
|
||||||
|
def _get_flags(self):
|
||||||
|
f = super(PauseServerSamplesJsonTest, self)._get_flags()
|
||||||
|
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
|
||||||
|
f['osapi_compute_extension'].append(
|
||||||
|
'nova.api.openstack.compute.contrib.admin_actions.Admin_actions')
|
||||||
|
return f
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""setUp Method for PauseServer api samples extension
|
"""setUp Method for PauseServer api samples extension
|
||||||
|
Loading…
Reference in New Issue
Block a user