functional: Enable real policy fixture by default

Enable the policy fixture by default, which should yield more realistic
functional tests. We need to update some tests to use admin APIs where
policy dictates they are necessary. Note that we're currently testing
the legacy policy - not the updated, scoped policy - since the legacy
policy is the default one currently.

Note that we also need to modify the 'SingleCellSimple' fixture in this
change to use the same project ID as the 'OSAPIFixture'.

Change-Id: Ia3dea78f16cb3c7081714c4db36e20d5ee76ed7d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2020-08-11 10:40:01 +01:00
parent f72c9e59fb
commit 8750c4e173
114 changed files with 206 additions and 230 deletions

View File

@ -55,9 +55,6 @@
"config_drive": "",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "b8b357f7100d4391828f2177c922ef93",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-STS:power_state": 4,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "rescued",

View File

@ -56,9 +56,6 @@
"config_drive": "",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "b8b357f7100d4391828f2177c922ef93",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",

View File

@ -1,3 +1,3 @@
{
"unrescue": null
}
}

View File

@ -2,16 +2,6 @@
"server": {
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "compute",
"OS-EXT-SRV-ATTR:hostname": "new-server-test",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:reservation_id": "r-d0bls59j",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"OS-EXT-STS:power_state": 4,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "rescued",
@ -42,7 +32,6 @@
"vcpus": 1
},
"hostId": "2091634baaccdc4c5a1d57069c833e402921df696b7f970791b12ec6",
"host_status": "UP",
"id": "69bebe1c-3bdb-4feb-9b79-afa3d4782d95",
"image": {
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
@ -84,4 +73,4 @@
"updated": "2020-02-07T17:39:49Z",
"user_id": "fake"
}
}
}

View File

@ -2,16 +2,6 @@
"server": {
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "compute",
"OS-EXT-SRV-ATTR:hostname": "new-server-test",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:reservation_id": "r-g20x6pwt",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
@ -42,7 +32,6 @@
"vcpus": 1
},
"hostId": "2091634baaccdc4c5a1d57069c833e402921df696b7f970791b12ec6",
"host_status": "UP",
"id": "5a0ffa96-ae59-4f82-b7a6-e0c9007cd576",
"image": {
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
@ -85,4 +74,4 @@
"updated": "2020-02-07T17:39:56Z",
"user_id": "fake"
}
}
}

View File

@ -59,16 +59,6 @@
"config_drive": "",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "b8b357f7100d4391828f2177c922ef93",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-SRV-ATTR:reservation_id": "r-00000001",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:hostname": "fake-hostname",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
@ -79,7 +69,6 @@
{
"name": "default"
}
],
"host_status": "UP"
]
}
}

View File

@ -60,16 +60,6 @@
"config_drive": "",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "c3f14e9812ad496baf92ccfb3c61e15f",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-SRV-ATTR:reservation_id": "r-00000001",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:hostname": "fake-hostname",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
@ -80,8 +70,7 @@
{
"name": "default"
}
],
"host_status": "UP"
]
}
]
}

View File

@ -51,6 +51,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-11-14T06:29:02Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -76,6 +76,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-03T04:01:33Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -50,6 +50,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2012-12-02T02:11:58Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -77,7 +77,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-03T04:01:32Z",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -87,6 +87,6 @@
"host_status": "UP",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-16T02:55:08Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -88,7 +88,7 @@
"host_status": "UP",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-16T02:55:05Z",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -53,6 +53,6 @@
"OS-DCF:diskConfig": "AUTO",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-11-14T06:29:02Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -88,6 +88,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2015-12-07T17:24:15Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -52,6 +52,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2015-12-07T19:19:36Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -89,7 +89,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2015-12-07T19:54:49Z",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -51,7 +51,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-11-14T06:29:02Z",
"user_id": "fake",
"user_id": "admin",
"locked": false,
"description" : "description of foobar",
"tags": ["tag1", "tag2"]

View File

@ -85,6 +85,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-03T04:01:33Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -86,7 +86,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-03T04:01:32Z",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -54,6 +54,6 @@
"tags": [],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-11-14T06:29:02Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -91,6 +91,6 @@
"tags": [],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2017-02-14T19:24:00Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -53,6 +53,6 @@
"tags": [],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2012-12-02T02:11:58Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -92,7 +92,7 @@
"tags": [],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2017-02-14T19:24:43Z",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -89,6 +89,6 @@
"tags": ["tag1", "tag2"],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2017-02-14T19:24:00Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -90,7 +90,7 @@
"tags": ["tag1", "tag2"],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2017-02-14T19:24:43Z",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -54,7 +54,7 @@
"OS-DCF:diskConfig": "AUTO",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-11-14T06:29:02Z",
"user_id": "fake",
"user_id": "admin",
"tags": []
}
}

View File

@ -54,7 +54,7 @@
"OS-DCF:diskConfig": "AUTO",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-11-14T06:29:02Z",
"user_id": "fake",
"user_id": "admin",
"tags": [],
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi"
}

View File

@ -62,7 +62,7 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "2017-10-10T16:06:03Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -86,6 +86,6 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "2017-02-14T19:24:00Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -59,6 +59,6 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "2012-12-02T02:11:58Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -87,7 +87,7 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "2017-10-10T15:49:09Z",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -87,7 +87,7 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "2018-10-10T15:49:09Z",
"user_id": "fake"
"user_id": "admin"
}
]
}

View File

@ -23,8 +23,8 @@
]
},
"status": "UNKNOWN",
"tenant_id": "project",
"user_id": "fake",
"tenant_id": "6f70656e737461636b20342065766572",
"user_id": "admin",
"links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/servers/33748c23-38dd-4f70-b774-522fc69e7b67",
@ -36,4 +36,4 @@
}
]
}
}
}

View File

@ -60,6 +60,6 @@
"trusted_image_certificates": null,
"updated": "2019-02-28T03:16:20Z",
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -26,8 +26,8 @@
"f3d86fe6-4246-4be8-b87c-eb894626c741"
],
"status": "UNKNOWN",
"tenant_id": "project",
"user_id": "fake",
"tenant_id": "6f70656e737461636b20342065766572",
"user_id": "admin",
"links": [
{
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/servers/2669556b-b4a3-41f1-a0c1-f9c7ff75e53c",

View File

@ -84,6 +84,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "2019-02-28T03:16:19Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -6,6 +6,6 @@
"policy": "affinity",
"project_id": "6f70656e737461636b20342065766572",
"rules": {},
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -57,6 +57,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "2019-02-28T03:16:19Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -59,6 +59,6 @@
"trusted_image_certificates": null,
"updated": "2019-04-23T17:10:24Z",
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -83,6 +83,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "2019-04-23T15:19:11Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -56,6 +56,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "2019-04-23T17:37:48Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -83,7 +83,7 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "2019-04-23T15:19:15Z",
"user_id": "fake"
"user_id": "admin"
}
]
}

View File

@ -84,6 +84,6 @@
"trusted_image_certificates": null,
"updated": "2019-04-23T17:10:24Z",
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -83,6 +83,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "2012-12-02T02:11:58Z",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -85,7 +85,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-03T04:01:33Z",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
}

View File

@ -86,7 +86,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "2013-09-03T04:01:32Z",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
],

View File

@ -65,13 +65,13 @@ from nova import service
from nova.tests.functional.api import client
from nova.tests.unit import fake_requests
_TRUE_VALUES = ('True', 'true', '1', 'yes')
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
DB_SCHEMA = collections.defaultdict(str)
SESSION_CONFIGURED = False
LOG = logging.getLogger(__name__)
PROJECT_ID = '6f70656e737461636b20342065766572'
class ServiceFixture(fixtures.Fixture):
@ -153,7 +153,7 @@ class StandardLogging(fixtures.Fixture):
root.setLevel(std_logging.DEBUG)
# supports collecting debug level for local runs
if os.environ.get('OS_DEBUG') in _TRUE_VALUES:
if os.environ.get('OS_DEBUG') in ('True', 'true', '1', 'yes'):
level = std_logging.DEBUG
else:
level = std_logging.INFO
@ -247,8 +247,11 @@ class SingleCellSimple(fixtures.Fixture):
instances_created=False to init.
"""
def __init__(self, instances_created=True):
def __init__(
self, instances_created=True, project_id=PROJECT_ID,
):
self.instances_created = instances_created
self.project_id = project_id
def setUp(self):
super(SingleCellSimple, self).setUp()
@ -294,7 +297,7 @@ class SingleCellSimple(fixtures.Fixture):
'created_at': None,
'instance_uuid': instance_uuid,
'cell_id': (self.instances_created and 1 or None),
'project_id': 'project',
'project_id': self.project_id,
'cell_mapping': (
self.instances_created and self._fake_cell_get() or None),
}
@ -839,9 +842,10 @@ class OSAPIFixture(fixtures.Fixture):
"""
def __init__(self, api_version='v2',
project_id='6f70656e737461636b20342065766572',
use_project_id_in_urls=False, stub_keystone=True):
def __init__(
self, api_version='v2', project_id=PROJECT_ID,
use_project_id_in_urls=False, stub_keystone=True,
):
"""Constructor
:param api_version: the API version that we're interested in
@ -1162,7 +1166,7 @@ class NeutronFixture(fixtures.Fixture):
"""A fixture to boot instances with neutron ports"""
# the default project_id in OsaAPIFixtures
tenant_id = '6f70656e737461636b20342065766572'
tenant_id = PROJECT_ID
network_1 = {
'id': '3cb9bc59-5699-4588-a4b1-b87f96708bc6',
@ -2046,7 +2050,7 @@ class CinderFixture(fixtures.Fixture):
"""A fixture to volume operations with the new Cinder attach/detach API"""
# the default project_id in OSAPIFixtures
tenant_id = '6f70656e737461636b20342065766572'
tenant_id = PROJECT_ID
SWAP_OLD_VOL = 'a07f71dc-8151-4e7d-a0cc-cd24a3f11113'
SWAP_NEW_VOL = '227cc671-f30b-4488-96fd-7d0bf13648d8'

View File

@ -55,9 +55,6 @@
"config_drive": "%(cdrive)s",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "%(compute_host)s",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "%(hypervisor_hostname)s",
"OS-EXT-SRV-ATTR:instance_name": "%(instance_name)s",
"OS-EXT-STS:power_state": 4,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "rescued",

View File

@ -56,9 +56,6 @@
"config_drive": "%(cdrive)s",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "%(compute_host)s",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "%(hypervisor_hostname)s",
"OS-EXT-SRV-ATTR:instance_name": "%(instance_name)s",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",

View File

@ -2,16 +2,6 @@
"server": {
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "compute",
"OS-EXT-SRV-ATTR:hostname": "new-server-test",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:reservation_id": "%(reservation_id)s",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"OS-EXT-STS:power_state": 4,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "rescued",
@ -42,7 +32,6 @@
"vcpus": 1
},
"hostId": "2091634baaccdc4c5a1d57069c833e402921df696b7f970791b12ec6",
"host_status": "UP",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",

View File

@ -2,16 +2,6 @@
"server": {
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "compute",
"OS-EXT-SRV-ATTR:hostname": "new-server-test",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "fake-mini",
"OS-EXT-SRV-ATTR:instance_name": "instance-00000001",
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:reservation_id": "%(reservation_id)s",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "IyEvYmluL2Jhc2gKL2Jpbi9zdQplY2hvICJJIGFtIGluIHlvdSEiCg==",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
@ -42,7 +32,6 @@
"vcpus": 1
},
"hostId": "2091634baaccdc4c5a1d57069c833e402921df696b7f970791b12ec6",
"host_status": "UP",
"id": "%(id)s",
"image": {
"id": "%(uuid)s",

View File

@ -59,16 +59,6 @@
"config_drive": "",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "%(compute_host)s",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "%(hypervisor_hostname)s",
"OS-EXT-SRV-ATTR:instance_name": "%(instance_name)s",
"OS-EXT-SRV-ATTR:reservation_id": "%(reservation_id)s",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:hostname": "%(hostname)s",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "%(user_data)s",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
@ -79,7 +69,6 @@
{
"name": "default"
}
],
"host_status": "UP"
]
}
}

View File

@ -60,16 +60,6 @@
"config_drive": "",
"OS-DCF:diskConfig": "AUTO",
"OS-EXT-AZ:availability_zone": "us-west",
"OS-EXT-SRV-ATTR:host": "%(compute_host)s",
"OS-EXT-SRV-ATTR:hypervisor_hostname": "%(hypervisor_hostname)s",
"OS-EXT-SRV-ATTR:instance_name": "%(instance_name)s",
"OS-EXT-SRV-ATTR:reservation_id": "%(reservation_id)s",
"OS-EXT-SRV-ATTR:launch_index": 0,
"OS-EXT-SRV-ATTR:kernel_id": "",
"OS-EXT-SRV-ATTR:ramdisk_id": "",
"OS-EXT-SRV-ATTR:hostname": "%(hostname)s",
"OS-EXT-SRV-ATTR:root_device_name": "/dev/sda",
"OS-EXT-SRV-ATTR:user_data": "%(user_data)s",
"OS-EXT-STS:power_state": 1,
"OS-EXT-STS:task_state": null,
"OS-EXT-STS:vm_state": "active",
@ -80,8 +70,7 @@
{
"name": "default"
}
],
"host_status": "UP"
]
}
]
}

View File

@ -51,6 +51,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -72,6 +72,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -50,6 +50,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -73,7 +73,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -80,7 +80,7 @@
"status": "ACTIVE",
"host_status": "UP",
"tenant_id": "6f70656e737461636b20342065766572",
"user_id": "fake",
"user_id": "admin",
"key_name": null
}
}

View File

@ -81,7 +81,7 @@
"host_status": "UP",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
],

View File

@ -53,6 +53,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -81,7 +81,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
}

View File

@ -51,7 +51,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
}

View File

@ -82,7 +82,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
],

View File

@ -51,7 +51,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"locked": false,
"description": "%(description)s",
"tags": ["tag1", "tag2"]

View File

@ -79,6 +79,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -80,7 +80,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -54,6 +54,6 @@
"tags": [],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -85,6 +85,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -53,6 +53,6 @@
"tags": [],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -86,7 +86,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -83,6 +83,6 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -84,7 +84,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -54,7 +54,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"tags": []
}
}

View File

@ -54,7 +54,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"tags": [],
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi"
}

View File

@ -62,6 +62,6 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -82,7 +82,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"trusted_image_certificates": [
"0b5d2c72-12cc-4ba6-a8d7-3ff5cc1d8cb8",
"674736e3-f25c-405c-8362-bbf991e0ce0a"

View File

@ -59,6 +59,6 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -87,7 +87,7 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
],
"servers_links": [

View File

@ -87,7 +87,7 @@
"674736e3-f25c-405c-8362-bbf991e0ce0a"
],
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
]
}

View File

@ -23,8 +23,8 @@
]
},
"status": "UNKNOWN",
"tenant_id": "project",
"user_id": "fake",
"tenant_id": "6f70656e737461636b20342065766572",
"user_id": "admin",
"links": [
{
"href": "%(versioned_compute_endpoint)s/servers/%(uuid)s",
@ -36,4 +36,4 @@
}
]
}
}
}

View File

@ -57,7 +57,7 @@
"tags": [],
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi"
}
}

View File

@ -24,8 +24,8 @@
},
"status": "UNKNOWN",
"server_groups": ["%(uuid)s"],
"tenant_id": "project",
"user_id": "fake",
"tenant_id": "6f70656e737461636b20342065766572",
"user_id": "admin",
"links": [
{
"href": "%(versioned_compute_endpoint)s/servers/%(uuid)s",

View File

@ -82,6 +82,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -6,6 +6,6 @@
"policy": "affinity",
"project_id": "6f70656e737461636b20342065766572",
"rules": {},
"user_id": "fake"
"user_id": "admin"
}
}
}

View File

@ -56,6 +56,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -59,6 +59,6 @@
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi",
"user_id": "fake"
"user_id": "admin"
}
}
}

View File

@ -83,6 +83,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}
}

View File

@ -56,6 +56,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}
}

View File

@ -83,7 +83,7 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
]
}
}

View File

@ -84,6 +84,6 @@
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_data": "ZWNobyAiaGVsbG8gd29ybGQi",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -83,6 +83,6 @@
"tenant_id": "6f70656e737461636b20342065766572",
"trusted_image_certificates": null,
"updated": "%(isotime)s",
"user_id": "fake"
"user_id": "admin"
}
}

View File

@ -79,7 +79,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
}

View File

@ -80,7 +80,7 @@
"status": "ACTIVE",
"tenant_id": "6f70656e737461636b20342065766572",
"updated": "%(isotime)s",
"user_id": "fake",
"user_id": "admin",
"locked": false
}
],

View File

@ -17,6 +17,8 @@ from nova.tests.functional.api_sample_tests import test_servers
class AdminActionsSamplesJsonTest(test_servers.ServersSampleBase):
# The various 'os_compute_api:os-admin-actions:*' policies are admin-only
ADMIN_API = True
sample_dir = "os-admin-actions"
def setUp(self):

View File

@ -17,6 +17,9 @@ from nova.tests.unit.api.openstack import fakes
class AssistedVolumeSnapshotsJsonTests(test_servers.ServersSampleBase):
# The various 'os_compute_api:os-assisted-volume-snapshots:*' policies are
# admin-only
ADMIN_API = True
sample_dir = "os-assisted-volume-snapshots"
def test_create(self):

View File

@ -15,7 +15,6 @@
from nova.tests.functional.api_sample_tests import test_servers
from nova.tests.functional import api_samples_test_base
from nova.tests.unit import policy_fixture
class ServerActionsSampleJsonTest(test_servers.ServersSampleBase):
@ -35,7 +34,6 @@ class ServerActionsSampleJsonTest(test_servers.ServersSampleBase):
actions = api_samples_test_base.objectify(response_data)
self.action_stop = actions['instanceActions'][0]
self._wait_for_state_change({'id': self.uuid}, 'SHUTOFF')
self.policy = self.useFixture(policy_fixture.RealPolicyFixture())
def _get_subs(self):
return {

View File

@ -37,6 +37,8 @@ def fake_get_compute(context, host):
class MigrateServerSamplesJsonTest(test_servers.ServersSampleBase):
# The various 'os_compute_api:os-migrate-server:*' policies are admin-only
ADMIN_API = True
sample_dir = "os-migrate-server"
def setUp(self):
@ -149,6 +151,8 @@ class MigrateServerSamplesJsonTestV230(MigrateServerSamplesJsonTest):
class MigrateServerSamplesJsonTestV256(test_servers.ServersSampleBase):
# The various 'os_compute_api:os-migrate-server:*' policies are admin-only
ADMIN_API = True
sample_dir = "os-migrate-server"
microversion = '2.56'
scenarios = [('v2_56', {'api_major_version': 'v2.1'})]
@ -188,6 +192,8 @@ class MigrateServerSamplesJsonTestV256(test_servers.ServersSampleBase):
class MigrateServerSamplesJsonTestV268(test_servers.ServersSampleBase):
# The various 'os_compute_api:os-migrate-server:*' policies are admin-only
ADMIN_API = True
sample_dir = "os-migrate-server"
microversion = '2.68'
scenarios = [('v2_68', {'api_major_version': 'v2.1'})]

View File

@ -17,6 +17,8 @@ from nova.tests.functional.api_sample_tests import test_servers
class ServerDiagnosticsSamplesJsonTest(test_servers.ServersSampleBase):
# The 'os_compute_api:os-server-diagnostics' policy is admin-only
ADMIN_API = True
sample_dir = "os-server-diagnostics"
def test_server_diagnostics_get(self):

Some files were not shown because too many files have changed in this diff Show More