Merge server diagnostics & ext events tests for v2 & 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 below servers functional tests. - test_server_diagnostics - test_server_external_events 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: I6a078e8dcbdd0160c6efb6dbac327ebc1f90fe1a
This commit is contained in:
committed by
Ghanshyam Mann
parent
168cea8031
commit
2cf7b6ff95
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"cpu0_time": 17300000000,
|
||||
"memory": 524288,
|
||||
"vda_errors": -1,
|
||||
"vda_read": 262144,
|
||||
"vda_read_req": 112,
|
||||
"vda_write": 5778432,
|
||||
"vda_write_req": 488,
|
||||
"vnet1_rx": 2070139,
|
||||
"vnet1_rx_drop": 0,
|
||||
"vnet1_rx_errors": 0,
|
||||
"vnet1_rx_packets": 26701,
|
||||
"vnet1_tx": 140208,
|
||||
"vnet1_tx_drop": 0,
|
||||
"vnet1_tx_errors": 0,
|
||||
"vnet1_tx_packets": 662
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"events": [
|
||||
{ "name": "test-event",
|
||||
"tag": "foo",
|
||||
"status": "completed",
|
||||
"server_uuid": "3df201cf-2451-44f2-8d25-a4ca826fc1f3"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"events": [
|
||||
{
|
||||
"code": 200,
|
||||
"name": "network-changed",
|
||||
"server_uuid": "b376b585-848e-4fc3-a000-56635d645194",
|
||||
"status": "completed",
|
||||
"tag": "foo"
|
||||
}
|
||||
]
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"cpu0_time": 17300000000,
|
||||
"memory": 524288,
|
||||
"vda_errors": -1,
|
||||
"vda_read": 262144,
|
||||
"vda_read_req": 112,
|
||||
"vda_write": 5778432,
|
||||
"vda_write_req": 488,
|
||||
"vnet1_rx": 2070139,
|
||||
"vnet1_rx_drop": 0,
|
||||
"vnet1_rx_errors": 0,
|
||||
"vnet1_rx_packets": 26701,
|
||||
"vnet1_tx": 140208,
|
||||
"vnet1_tx_drop": 0,
|
||||
"vnet1_tx_errors": 0,
|
||||
"vnet1_tx_packets": 662
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"events": [
|
||||
{
|
||||
"name": "%(name)s",
|
||||
"tag": "%(tag)s",
|
||||
"status": "%(status)s",
|
||||
"server_uuid": "%(uuid)s"
|
||||
}
|
||||
]
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"events": [
|
||||
{
|
||||
"code": 200,
|
||||
"name": "%(name)s",
|
||||
"server_uuid": "%(uuid)s",
|
||||
"status": "%(status)s",
|
||||
"tag": "%(tag)s"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1078,18 +1078,6 @@ class SimpleTenantUsageSampleJsonTest(ServersSampleBase):
|
||||
response, 200)
|
||||
|
||||
|
||||
class ServerDiagnosticsSamplesJsonTest(ServersSampleBase):
|
||||
extension_name = ("nova.api.openstack.compute.contrib.server_diagnostics."
|
||||
"Server_diagnostics")
|
||||
|
||||
def test_server_diagnostics_get(self):
|
||||
uuid = self._post_server()
|
||||
response = self._do_get('servers/%s/diagnostics' % uuid)
|
||||
subs = self._get_regexes()
|
||||
self._verify_response('server-diagnostics-get-resp', subs,
|
||||
response, 200)
|
||||
|
||||
|
||||
class AvailabilityZoneJsonTest(ServersSampleBase):
|
||||
extension_name = ("nova.api.openstack.compute.contrib.availability_zone."
|
||||
"Availability_zone")
|
||||
@@ -2432,26 +2420,6 @@ class PreserveEphemeralOnRebuildJsonTest(ServersSampleBase):
|
||||
self.assertEqual(response.status_code, 202)
|
||||
|
||||
|
||||
class ServerExternalEventsJsonTest(ServersSampleBase):
|
||||
ADMIN_API = True
|
||||
extension_name = ('nova.api.openstack.compute.contrib.'
|
||||
'server_external_events.Server_external_events')
|
||||
|
||||
def test_create_event(self):
|
||||
instance_uuid = self._post_server()
|
||||
subs = {
|
||||
'uuid': instance_uuid,
|
||||
'name': 'network-changed',
|
||||
'status': 'completed',
|
||||
'tag': 'foo',
|
||||
}
|
||||
response = self._do_post('os-server-external-events',
|
||||
'event-create-req',
|
||||
subs)
|
||||
subs.update(self._get_regexes())
|
||||
self._verify_response('event-create-resp', subs, response, 200)
|
||||
|
||||
|
||||
class ServerGroupsSampleJsonTest(ServersSampleBase):
|
||||
extension_name = ("nova.api.openstack.compute.contrib"
|
||||
".server_groups.Server_groups")
|
||||
|
||||
@@ -13,11 +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 ServerDiagnosticsSamplesJsonTest(test_servers.ServersSampleBase):
|
||||
extension_name = "os-server-diagnostics"
|
||||
extra_extensions_to_load = ["os-access-ips"]
|
||||
_api_version = 'v2'
|
||||
|
||||
def _get_flags(self):
|
||||
f = super(ServerDiagnosticsSamplesJsonTest, self)._get_flags()
|
||||
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
|
||||
f['osapi_compute_extension'].append(
|
||||
'nova.api.openstack.compute.contrib.server_diagnostics.'
|
||||
'Server_diagnostics')
|
||||
return f
|
||||
|
||||
def test_server_diagnostics_get(self):
|
||||
uuid = self._post_server()
|
||||
|
||||
@@ -12,12 +12,28 @@
|
||||
# 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 ServerExternalEventsSamplesJsonTest(test_servers.ServersSampleBase):
|
||||
ADMIN_API = True
|
||||
extension_name = "os-server-external-events"
|
||||
extra_extensions_to_load = ["os-access-ips"]
|
||||
_api_version = 'v2'
|
||||
|
||||
def _get_flags(self):
|
||||
f = super(ServerExternalEventsSamplesJsonTest, self)._get_flags()
|
||||
f['osapi_compute_extension'] = CONF.osapi_compute_extension[:]
|
||||
f['osapi_compute_extension'].append(
|
||||
'nova.api.openstack.compute.contrib.server_external_events.'
|
||||
'Server_external_events')
|
||||
return f
|
||||
|
||||
def setUp(self):
|
||||
"""setUp Method for AdminActions api samples extension
|
||||
|
||||
Reference in New Issue
Block a user