From 8750c4e173b94313948be9e7112902615ad750df Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Tue, 11 Aug 2020 10:40:01 +0100 Subject: [PATCH] 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 --- .../os-rescue/server-get-resp-rescue.json | 3 -- .../os-rescue/server-get-resp-unrescue.json | 3 -- .../os-rescue/server-unrescue-req.json | 2 +- .../v2.87/server-get-resp-rescue.json | 13 +------ .../v2.87/server-get-resp-unrescue.json | 13 +------ .../v2.26/server-tags-show-details-resp.json | 13 +------ .../v2.26/servers-tags-details-resp.json | 13 +------ .../servers/server-action-rebuild-resp.json | 2 +- doc/api_samples/servers/server-get-resp.json | 2 +- .../servers/server-update-resp.json | 2 +- .../servers/servers-details-resp.json | 2 +- .../servers/v2.16/server-get-resp.json | 2 +- .../servers/v2.16/servers-details-resp.json | 2 +- .../v2.19/server-action-rebuild-resp.json | 2 +- .../servers/v2.19/server-get-resp.json | 2 +- .../servers/v2.19/server-put-resp.json | 2 +- .../servers/v2.19/servers-details-resp.json | 2 +- .../v2.26/server-action-rebuild-resp.json | 2 +- .../servers/v2.3/server-get-resp.json | 2 +- .../servers/v2.3/servers-details-resp.json | 2 +- .../v2.47/server-action-rebuild-resp.json | 2 +- .../servers/v2.47/server-get-resp.json | 2 +- .../servers/v2.47/server-update-resp.json | 2 +- .../servers/v2.47/servers-details-resp.json | 2 +- .../servers/v2.52/server-get-resp.json | 2 +- .../servers/v2.52/servers-details-resp.json | 2 +- .../v2.54/server-action-rebuild-resp.json | 2 +- .../v2.57/server-action-rebuild-resp.json | 2 +- .../v2.63/server-action-rebuild-resp.json | 2 +- .../servers/v2.63/server-get-resp.json | 2 +- .../servers/v2.63/server-update-resp.json | 2 +- .../servers/v2.63/servers-details-resp.json | 2 +- .../servers-details-with-changes-before.json | 2 +- .../servers/v2.69/server-get-resp.json | 6 ++-- .../v2.71/server-action-rebuild-resp.json | 2 +- .../v2.71/server-get-down-cell-resp.json | 4 +-- .../servers/v2.71/server-get-resp.json | 2 +- .../v2.71/server-groups-post-resp.json | 2 +- .../servers/v2.71/server-update-resp.json | 2 +- .../v2.73/server-action-rebuild-resp.json | 2 +- .../servers/v2.73/server-get-resp.json | 2 +- .../servers/v2.73/server-update-resp.json | 2 +- .../servers/v2.73/servers-details-resp.json | 2 +- .../v2.75/server-action-rebuild-resp.json | 2 +- .../servers/v2.75/server-update-resp.json | 2 +- .../servers/v2.9/server-get-resp.json | 2 +- .../servers/v2.9/servers-details-resp.json | 2 +- nova/tests/fixtures.py | 26 ++++++++------ .../os-rescue/server-get-resp-rescue.json.tpl | 3 -- .../server-get-resp-unrescue.json.tpl | 3 -- .../os-rescue/server-unrescue-req.json.tpl | 2 +- .../v2.87/server-get-resp-rescue.json.tpl | 11 ------ .../v2.87/server-get-resp-unrescue.json.tpl | 11 ------ .../server-tags-show-details-resp.json.tpl | 13 +------ .../v2.26/servers-tags-details-resp.json.tpl | 13 +------ .../server-action-rebuild-resp.json.tpl | 2 +- .../servers/server-get-resp.json.tpl | 2 +- .../servers/server-update-resp.json.tpl | 2 +- .../servers/servers-details-resp.json.tpl | 2 +- .../servers/v2.16/server-get-resp.json.tpl | 2 +- .../v2.16/servers-details-resp.json.tpl | 2 +- .../v2.19/server-action-rebuild-resp.json.tpl | 2 +- .../servers/v2.19/server-get-resp.json.tpl | 2 +- .../servers/v2.19/server-put-resp.json.tpl | 2 +- .../v2.19/servers-details-resp.json.tpl | 2 +- .../v2.26/server-action-rebuild-resp.json.tpl | 2 +- .../servers/v2.3/server-get-resp.json.tpl | 2 +- .../v2.3/servers-details-resp.json.tpl | 2 +- .../v2.47/server-action-rebuild-resp.json.tpl | 2 +- .../servers/v2.47/server-get-resp.json.tpl | 2 +- .../servers/v2.47/server-update-resp.json.tpl | 2 +- .../v2.47/servers-details-resp.json.tpl | 2 +- .../servers/v2.52/server-get-resp.json.tpl | 2 +- .../v2.52/servers-details-resp.json.tpl | 2 +- .../v2.54/server-action-rebuild-resp.json.tpl | 2 +- .../v2.57/server-action-rebuild-resp.json.tpl | 2 +- .../v2.63/server-action-rebuild-resp.json.tpl | 2 +- .../servers/v2.63/server-get-resp.json.tpl | 2 +- .../servers/v2.63/server-update-resp.json.tpl | 2 +- .../v2.63/servers-details-resp.json.tpl | 2 +- ...rvers-details-with-changes-before.json.tpl | 2 +- .../servers/v2.69/server-get-resp.json.tpl | 6 ++-- .../v2.71/server-action-rebuild-resp.json.tpl | 2 +- .../v2.71/server-get-down-cell-resp.json.tpl | 4 +-- .../servers/v2.71/server-get-resp.json.tpl | 2 +- .../v2.71/server-groups-post-resp.json.tpl | 4 +-- .../servers/v2.71/server-update-resp.json.tpl | 2 +- .../v2.73/server-action-rebuild-resp.json.tpl | 4 +-- .../servers/v2.73/server-get-resp.json.tpl | 4 +-- .../servers/v2.73/server-update-resp.json.tpl | 4 +-- .../v2.73/servers-details-resp.json.tpl | 4 +-- .../v2.75/server-action-rebuild-resp.json.tpl | 2 +- .../servers/v2.75/server-update-resp.json.tpl | 2 +- .../servers/v2.9/server-get-resp.json.tpl | 2 +- .../v2.9/servers-details-resp.json.tpl | 2 +- .../api_sample_tests/test_admin_actions.py | 2 ++ .../test_assisted_volume_snapshots.py | 3 ++ .../api_sample_tests/test_instance_actions.py | 2 -- .../api_sample_tests/test_migrate_server.py | 6 ++++ .../test_server_diagnostics.py | 2 ++ .../test_server_migrations.py | 9 +++-- .../api_sample_tests/test_servers.py | 36 +++++++++++++++++++ .../api_sample_tests/test_shelve.py | 2 ++ .../test_simple_tenant_usage.py | 4 +++ .../api_sample_tests/test_volumes.py | 2 ++ .../functional/compute/test_live_migration.py | 2 ++ nova/tests/functional/integrated_helpers.py | 9 +++-- .../functional/libvirt/test_numa_servers.py | 6 ++-- .../libvirt/test_pci_sriov_servers.py | 4 ++- nova/tests/functional/libvirt/test_vgpu.py | 4 +-- nova/tests/functional/libvirt/test_vtpm.py | 3 ++ .../regressions/test_bug_1879878.py | 5 +++ .../regressions/test_bug_1886418.py | 4 +-- nova/tests/functional/test_servers.py | 7 ++-- 114 files changed, 206 insertions(+), 230 deletions(-) diff --git a/doc/api_samples/os-rescue/server-get-resp-rescue.json b/doc/api_samples/os-rescue/server-get-resp-rescue.json index 9a9c29eea2..9a99aa8824 100644 --- a/doc/api_samples/os-rescue/server-get-resp-rescue.json +++ b/doc/api_samples/os-rescue/server-get-resp-rescue.json @@ -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", diff --git a/doc/api_samples/os-rescue/server-get-resp-unrescue.json b/doc/api_samples/os-rescue/server-get-resp-unrescue.json index 0136ca4e9b..581dc19e01 100644 --- a/doc/api_samples/os-rescue/server-get-resp-unrescue.json +++ b/doc/api_samples/os-rescue/server-get-resp-unrescue.json @@ -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", diff --git a/doc/api_samples/os-rescue/server-unrescue-req.json b/doc/api_samples/os-rescue/server-unrescue-req.json index cafc9b13a8..635fb7a25e 100644 --- a/doc/api_samples/os-rescue/server-unrescue-req.json +++ b/doc/api_samples/os-rescue/server-unrescue-req.json @@ -1,3 +1,3 @@ { "unrescue": null -} \ No newline at end of file +} diff --git a/doc/api_samples/os-rescue/v2.87/server-get-resp-rescue.json b/doc/api_samples/os-rescue/v2.87/server-get-resp-rescue.json index 3500b3ebd8..4fc5ce6f1e 100644 --- a/doc/api_samples/os-rescue/v2.87/server-get-resp-rescue.json +++ b/doc/api_samples/os-rescue/v2.87/server-get-resp-rescue.json @@ -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" } -} \ No newline at end of file +} diff --git a/doc/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json b/doc/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json index 3388fb55a5..2d54aa1382 100644 --- a/doc/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json +++ b/doc/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json @@ -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" } -} \ No newline at end of file +} diff --git a/doc/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json b/doc/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json index deeba67511..9c20c9f086 100644 --- a/doc/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json +++ b/doc/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json @@ -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" + ] } } diff --git a/doc/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json b/doc/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json index 023e45b5cc..1e9cf8f99a 100644 --- a/doc/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json +++ b/doc/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json @@ -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" + ] } ] } diff --git a/doc/api_samples/servers/server-action-rebuild-resp.json b/doc/api_samples/servers/server-action-rebuild-resp.json index 65acbb5d9b..a021f888a0 100644 --- a/doc/api_samples/servers/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/server-action-rebuild-resp.json @@ -51,6 +51,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-11-14T06:29:02Z", - "user_id": "fake" + "user_id": "admin" } } \ No newline at end of file diff --git a/doc/api_samples/servers/server-get-resp.json b/doc/api_samples/servers/server-get-resp.json index f04a0ae0b2..66d1930fb4 100644 --- a/doc/api_samples/servers/server-get-resp.json +++ b/doc/api_samples/servers/server-get-resp.json @@ -76,6 +76,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-03T04:01:33Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/server-update-resp.json b/doc/api_samples/servers/server-update-resp.json index 26384cee2c..6c9de44daa 100644 --- a/doc/api_samples/servers/server-update-resp.json +++ b/doc/api_samples/servers/server-update-resp.json @@ -50,6 +50,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2012-12-02T02:11:58Z", - "user_id": "fake" + "user_id": "admin" } } \ No newline at end of file diff --git a/doc/api_samples/servers/servers-details-resp.json b/doc/api_samples/servers/servers-details-resp.json index 5dd38f78f4..874164288c 100644 --- a/doc/api_samples/servers/servers-details-resp.json +++ b/doc/api_samples/servers/servers-details-resp.json @@ -77,7 +77,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-03T04:01:32Z", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/doc/api_samples/servers/v2.16/server-get-resp.json b/doc/api_samples/servers/v2.16/server-get-resp.json index 426db9f903..99d0155b9f 100644 --- a/doc/api_samples/servers/v2.16/server-get-resp.json +++ b/doc/api_samples/servers/v2.16/server-get-resp.json @@ -87,6 +87,6 @@ "host_status": "UP", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-16T02:55:08Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.16/servers-details-resp.json b/doc/api_samples/servers/v2.16/servers-details-resp.json index 9886ebf3da..694909da35 100644 --- a/doc/api_samples/servers/v2.16/servers-details-resp.json +++ b/doc/api_samples/servers/v2.16/servers-details-resp.json @@ -88,7 +88,7 @@ "host_status": "UP", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-16T02:55:05Z", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/doc/api_samples/servers/v2.19/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.19/server-action-rebuild-resp.json index 73528464e1..46b34f09de 100644 --- a/doc/api_samples/servers/v2.19/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.19/server-action-rebuild-resp.json @@ -53,6 +53,6 @@ "OS-DCF:diskConfig": "AUTO", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-11-14T06:29:02Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.19/server-get-resp.json b/doc/api_samples/servers/v2.19/server-get-resp.json index b808a159c7..f8efde972f 100644 --- a/doc/api_samples/servers/v2.19/server-get-resp.json +++ b/doc/api_samples/servers/v2.19/server-get-resp.json @@ -88,6 +88,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2015-12-07T17:24:15Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.19/server-put-resp.json b/doc/api_samples/servers/v2.19/server-put-resp.json index 6ec7fa6b0d..ede653a057 100644 --- a/doc/api_samples/servers/v2.19/server-put-resp.json +++ b/doc/api_samples/servers/v2.19/server-put-resp.json @@ -52,6 +52,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2015-12-07T19:19:36Z", - "user_id": "fake" + "user_id": "admin" } } \ No newline at end of file diff --git a/doc/api_samples/servers/v2.19/servers-details-resp.json b/doc/api_samples/servers/v2.19/servers-details-resp.json index 395c91f9fc..dfbd0baacb 100644 --- a/doc/api_samples/servers/v2.19/servers-details-resp.json +++ b/doc/api_samples/servers/v2.19/servers-details-resp.json @@ -89,7 +89,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2015-12-07T19:54:49Z", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/doc/api_samples/servers/v2.26/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.26/server-action-rebuild-resp.json index 40c9e6070a..781cee5a0c 100644 --- a/doc/api_samples/servers/v2.26/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.26/server-action-rebuild-resp.json @@ -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"] diff --git a/doc/api_samples/servers/v2.3/server-get-resp.json b/doc/api_samples/servers/v2.3/server-get-resp.json index 037673f20c..2bfa311ead 100644 --- a/doc/api_samples/servers/v2.3/server-get-resp.json +++ b/doc/api_samples/servers/v2.3/server-get-resp.json @@ -85,6 +85,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-03T04:01:33Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.3/servers-details-resp.json b/doc/api_samples/servers/v2.3/servers-details-resp.json index ccdc3193bf..6cc2a0c880 100644 --- a/doc/api_samples/servers/v2.3/servers-details-resp.json +++ b/doc/api_samples/servers/v2.3/servers-details-resp.json @@ -86,7 +86,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-03T04:01:32Z", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/doc/api_samples/servers/v2.47/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.47/server-action-rebuild-resp.json index 9b4350eea5..790e31d241 100644 --- a/doc/api_samples/servers/v2.47/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.47/server-action-rebuild-resp.json @@ -54,6 +54,6 @@ "tags": [], "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-11-14T06:29:02Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.47/server-get-resp.json b/doc/api_samples/servers/v2.47/server-get-resp.json index eadd8cccad..38c28a2d6d 100644 --- a/doc/api_samples/servers/v2.47/server-get-resp.json +++ b/doc/api_samples/servers/v2.47/server-get-resp.json @@ -91,6 +91,6 @@ "tags": [], "tenant_id": "6f70656e737461636b20342065766572", "updated": "2017-02-14T19:24:00Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.47/server-update-resp.json b/doc/api_samples/servers/v2.47/server-update-resp.json index cc96f4db26..7857b0e34e 100644 --- a/doc/api_samples/servers/v2.47/server-update-resp.json +++ b/doc/api_samples/servers/v2.47/server-update-resp.json @@ -53,6 +53,6 @@ "tags": [], "tenant_id": "6f70656e737461636b20342065766572", "updated": "2012-12-02T02:11:58Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.47/servers-details-resp.json b/doc/api_samples/servers/v2.47/servers-details-resp.json index 5714949907..67c81e8fc2 100644 --- a/doc/api_samples/servers/v2.47/servers-details-resp.json +++ b/doc/api_samples/servers/v2.47/servers-details-resp.json @@ -92,7 +92,7 @@ "tags": [], "tenant_id": "6f70656e737461636b20342065766572", "updated": "2017-02-14T19:24:43Z", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/doc/api_samples/servers/v2.52/server-get-resp.json b/doc/api_samples/servers/v2.52/server-get-resp.json index 189400df24..ec3ea20121 100644 --- a/doc/api_samples/servers/v2.52/server-get-resp.json +++ b/doc/api_samples/servers/v2.52/server-get-resp.json @@ -89,6 +89,6 @@ "tags": ["tag1", "tag2"], "tenant_id": "6f70656e737461636b20342065766572", "updated": "2017-02-14T19:24:00Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.52/servers-details-resp.json b/doc/api_samples/servers/v2.52/servers-details-resp.json index c42c5a2d02..212a2ec1de 100644 --- a/doc/api_samples/servers/v2.52/servers-details-resp.json +++ b/doc/api_samples/servers/v2.52/servers-details-resp.json @@ -90,7 +90,7 @@ "tags": ["tag1", "tag2"], "tenant_id": "6f70656e737461636b20342065766572", "updated": "2017-02-14T19:24:43Z", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/doc/api_samples/servers/v2.54/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.54/server-action-rebuild-resp.json index 668303f5b2..cf809aeb53 100644 --- a/doc/api_samples/servers/v2.54/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.54/server-action-rebuild-resp.json @@ -54,7 +54,7 @@ "OS-DCF:diskConfig": "AUTO", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-11-14T06:29:02Z", - "user_id": "fake", + "user_id": "admin", "tags": [] } } diff --git a/doc/api_samples/servers/v2.57/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.57/server-action-rebuild-resp.json index 7680368a67..92b43c45da 100644 --- a/doc/api_samples/servers/v2.57/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.57/server-action-rebuild-resp.json @@ -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" } diff --git a/doc/api_samples/servers/v2.63/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.63/server-action-rebuild-resp.json index 9beefb1256..fa3c34cb6d 100644 --- a/doc/api_samples/servers/v2.63/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.63/server-action-rebuild-resp.json @@ -62,7 +62,7 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "2017-10-10T16:06:03Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.63/server-get-resp.json b/doc/api_samples/servers/v2.63/server-get-resp.json index c7abc9ad65..e47589885b 100644 --- a/doc/api_samples/servers/v2.63/server-get-resp.json +++ b/doc/api_samples/servers/v2.63/server-get-resp.json @@ -86,6 +86,6 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "2017-02-14T19:24:00Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.63/server-update-resp.json b/doc/api_samples/servers/v2.63/server-update-resp.json index d9bb68dc06..c1d544fed9 100644 --- a/doc/api_samples/servers/v2.63/server-update-resp.json +++ b/doc/api_samples/servers/v2.63/server-update-resp.json @@ -59,6 +59,6 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "2012-12-02T02:11:58Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.63/servers-details-resp.json b/doc/api_samples/servers/v2.63/servers-details-resp.json index 3603f1214f..358439eded 100644 --- a/doc/api_samples/servers/v2.63/servers-details-resp.json +++ b/doc/api_samples/servers/v2.63/servers-details-resp.json @@ -87,7 +87,7 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "2017-10-10T15:49:09Z", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/doc/api_samples/servers/v2.66/servers-details-with-changes-before.json b/doc/api_samples/servers/v2.66/servers-details-with-changes-before.json index 15e786a661..f4c39ac519 100644 --- a/doc/api_samples/servers/v2.66/servers-details-with-changes-before.json +++ b/doc/api_samples/servers/v2.66/servers-details-with-changes-before.json @@ -87,7 +87,7 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "2018-10-10T15:49:09Z", - "user_id": "fake" + "user_id": "admin" } ] } diff --git a/doc/api_samples/servers/v2.69/server-get-resp.json b/doc/api_samples/servers/v2.69/server-get-resp.json index 107930f21f..981cd23f8c 100644 --- a/doc/api_samples/servers/v2.69/server-get-resp.json +++ b/doc/api_samples/servers/v2.69/server-get-resp.json @@ -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 @@ } ] } -} \ No newline at end of file +} diff --git a/doc/api_samples/servers/v2.71/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.71/server-action-rebuild-resp.json index 3044b69e13..16dd0a1030 100644 --- a/doc/api_samples/servers/v2.71/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.71/server-action-rebuild-resp.json @@ -60,6 +60,6 @@ "trusted_image_certificates": null, "updated": "2019-02-28T03:16:20Z", "user_data": "ZWNobyAiaGVsbG8gd29ybGQi", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.71/server-get-down-cell-resp.json b/doc/api_samples/servers/v2.71/server-get-down-cell-resp.json index 08cc753b5f..9dded66a72 100644 --- a/doc/api_samples/servers/v2.71/server-get-down-cell-resp.json +++ b/doc/api_samples/servers/v2.71/server-get-down-cell-resp.json @@ -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", diff --git a/doc/api_samples/servers/v2.71/server-get-resp.json b/doc/api_samples/servers/v2.71/server-get-resp.json index afe68495bb..72e893e2e0 100644 --- a/doc/api_samples/servers/v2.71/server-get-resp.json +++ b/doc/api_samples/servers/v2.71/server-get-resp.json @@ -84,6 +84,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "2019-02-28T03:16:19Z", - "user_id": "fake" + "user_id": "admin" } } \ No newline at end of file diff --git a/doc/api_samples/servers/v2.71/server-groups-post-resp.json b/doc/api_samples/servers/v2.71/server-groups-post-resp.json index 969da31263..99b9c98f2d 100644 --- a/doc/api_samples/servers/v2.71/server-groups-post-resp.json +++ b/doc/api_samples/servers/v2.71/server-groups-post-resp.json @@ -6,6 +6,6 @@ "policy": "affinity", "project_id": "6f70656e737461636b20342065766572", "rules": {}, - "user_id": "fake" + "user_id": "admin" } } \ No newline at end of file diff --git a/doc/api_samples/servers/v2.71/server-update-resp.json b/doc/api_samples/servers/v2.71/server-update-resp.json index 26be517a68..408f0bea4a 100644 --- a/doc/api_samples/servers/v2.71/server-update-resp.json +++ b/doc/api_samples/servers/v2.71/server-update-resp.json @@ -57,6 +57,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "2019-02-28T03:16:19Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.73/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.73/server-action-rebuild-resp.json index aacceae048..d6be9e95e1 100644 --- a/doc/api_samples/servers/v2.73/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.73/server-action-rebuild-resp.json @@ -59,6 +59,6 @@ "trusted_image_certificates": null, "updated": "2019-04-23T17:10:24Z", "user_data": "ZWNobyAiaGVsbG8gd29ybGQi", - "user_id": "fake" + "user_id": "admin" } } \ No newline at end of file diff --git a/doc/api_samples/servers/v2.73/server-get-resp.json b/doc/api_samples/servers/v2.73/server-get-resp.json index 5776774dfa..edd30317f5 100644 --- a/doc/api_samples/servers/v2.73/server-get-resp.json +++ b/doc/api_samples/servers/v2.73/server-get-resp.json @@ -83,6 +83,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "2019-04-23T15:19:11Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.73/server-update-resp.json b/doc/api_samples/servers/v2.73/server-update-resp.json index c7b960cc7e..b99333e902 100644 --- a/doc/api_samples/servers/v2.73/server-update-resp.json +++ b/doc/api_samples/servers/v2.73/server-update-resp.json @@ -56,6 +56,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "2019-04-23T17:37:48Z", - "user_id": "fake" + "user_id": "admin" } } \ No newline at end of file diff --git a/doc/api_samples/servers/v2.73/servers-details-resp.json b/doc/api_samples/servers/v2.73/servers-details-resp.json index 67865fa3ae..98fcc91306 100644 --- a/doc/api_samples/servers/v2.73/servers-details-resp.json +++ b/doc/api_samples/servers/v2.73/servers-details-resp.json @@ -83,7 +83,7 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "2019-04-23T15:19:15Z", - "user_id": "fake" + "user_id": "admin" } ] } \ No newline at end of file diff --git a/doc/api_samples/servers/v2.75/server-action-rebuild-resp.json b/doc/api_samples/servers/v2.75/server-action-rebuild-resp.json index 78025ab0c6..a4421b85e8 100644 --- a/doc/api_samples/servers/v2.75/server-action-rebuild-resp.json +++ b/doc/api_samples/servers/v2.75/server-action-rebuild-resp.json @@ -84,6 +84,6 @@ "trusted_image_certificates": null, "updated": "2019-04-23T17:10:24Z", "user_data": "ZWNobyAiaGVsbG8gd29ybGQi", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.75/server-update-resp.json b/doc/api_samples/servers/v2.75/server-update-resp.json index cd22347a00..0fc5cf237b 100644 --- a/doc/api_samples/servers/v2.75/server-update-resp.json +++ b/doc/api_samples/servers/v2.75/server-update-resp.json @@ -83,6 +83,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "2012-12-02T02:11:58Z", - "user_id": "fake" + "user_id": "admin" } } diff --git a/doc/api_samples/servers/v2.9/server-get-resp.json b/doc/api_samples/servers/v2.9/server-get-resp.json index af1bbb296d..25ac6ae305 100644 --- a/doc/api_samples/servers/v2.9/server-get-resp.json +++ b/doc/api_samples/servers/v2.9/server-get-resp.json @@ -85,7 +85,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-03T04:01:33Z", - "user_id": "fake", + "user_id": "admin", "locked": false } } diff --git a/doc/api_samples/servers/v2.9/servers-details-resp.json b/doc/api_samples/servers/v2.9/servers-details-resp.json index ff5818a860..84cb44c1b2 100644 --- a/doc/api_samples/servers/v2.9/servers-details-resp.json +++ b/doc/api_samples/servers/v2.9/servers-details-resp.json @@ -86,7 +86,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "2013-09-03T04:01:32Z", - "user_id": "fake", + "user_id": "admin", "locked": false } ], diff --git a/nova/tests/fixtures.py b/nova/tests/fixtures.py index 8a3b23801c..0736f76018 100644 --- a/nova/tests/fixtures.py +++ b/nova/tests/fixtures.py @@ -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' diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-rescue.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-rescue.json.tpl index 1838c50533..2cecbcd343 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-rescue.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-rescue.json.tpl @@ -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", diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-unrescue.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-unrescue.json.tpl index 35ed72fc5f..7600f4bb25 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-unrescue.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-get-resp-unrescue.json.tpl @@ -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", diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-unrescue-req.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-unrescue-req.json.tpl index cafc9b13a8..635fb7a25e 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-unrescue-req.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/server-unrescue-req.json.tpl @@ -1,3 +1,3 @@ { "unrescue": null -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-rescue.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-rescue.json.tpl index 34343fe8c2..6ac8919cd9 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-rescue.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-rescue.json.tpl @@ -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", diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json.tpl index 02ac1caa9d..0f74940d29 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-rescue/v2.87/server-get-resp-unrescue.json.tpl @@ -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", diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json.tpl index e8ec32ccf3..13835137a1 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/server-tags-show-details-resp.json.tpl @@ -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" + ] } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json.tpl index 5ecbd6814f..6a639eacd9 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/os-server-tags/v2.26/servers-tags-details-resp.json.tpl @@ -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" + ] } ] } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/server-action-rebuild-resp.json.tpl index 178124d904..229c2a7cd8 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/server-action-rebuild-resp.json.tpl @@ -51,6 +51,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/server-get-resp.json.tpl index db22c63a60..3bf66754d2 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/server-get-resp.json.tpl @@ -72,6 +72,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/server-update-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/server-update-resp.json.tpl index 252f6478c0..dd5d27dd42 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/server-update-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/server-update-resp.json.tpl @@ -50,6 +50,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/servers-details-resp.json.tpl index 29bbc2498c..c06500a0a2 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/servers-details-resp.json.tpl @@ -73,7 +73,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/server-get-resp.json.tpl index 3a2679ccf2..950fd1d3ed 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/server-get-resp.json.tpl @@ -80,7 +80,7 @@ "status": "ACTIVE", "host_status": "UP", "tenant_id": "6f70656e737461636b20342065766572", - "user_id": "fake", + "user_id": "admin", "key_name": null } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/servers-details-resp.json.tpl index fb7d43ec08..7acceff91e 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.16/servers-details-resp.json.tpl @@ -81,7 +81,7 @@ "host_status": "UP", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "locked": false } ], diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-action-rebuild-resp.json.tpl index ce724404b3..8501a01da1 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-action-rebuild-resp.json.tpl @@ -53,6 +53,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-get-resp.json.tpl index 1c4110528d..5f3f16b0db 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-get-resp.json.tpl @@ -81,7 +81,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "locked": false } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-put-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-put-resp.json.tpl index 31e9a32b3b..be8106df4a 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-put-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/server-put-resp.json.tpl @@ -51,7 +51,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "locked": false } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/servers-details-resp.json.tpl index 12b8ee539e..4ef20cb8ab 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.19/servers-details-resp.json.tpl @@ -82,7 +82,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "locked": false } ], diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.26/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.26/server-action-rebuild-resp.json.tpl index 7f7a7ba8c8..fc6466b19a 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.26/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.26/server-action-rebuild-resp.json.tpl @@ -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"] diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/server-get-resp.json.tpl index 05a4ab614b..74353abab6 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/server-get-resp.json.tpl @@ -79,6 +79,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/servers-details-resp.json.tpl index c993fc1f8f..e66aaa6554 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.3/servers-details-resp.json.tpl @@ -80,7 +80,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-action-rebuild-resp.json.tpl index 1e990ed9e3..dad7b1f7bc 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-action-rebuild-resp.json.tpl @@ -54,6 +54,6 @@ "tags": [], "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-get-resp.json.tpl index 782ca09740..1092b01cab 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-get-resp.json.tpl @@ -85,6 +85,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-update-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-update-resp.json.tpl index 4daca2c30f..99ce266be9 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-update-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/server-update-resp.json.tpl @@ -53,6 +53,6 @@ "tags": [], "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/servers-details-resp.json.tpl index ded56e01b3..0c647bd589 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.47/servers-details-resp.json.tpl @@ -86,7 +86,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/server-get-resp.json.tpl index 8ae086dd58..058042c060 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/server-get-resp.json.tpl @@ -83,6 +83,6 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/servers-details-resp.json.tpl index 8a2669ce82..fd69908fb7 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.52/servers-details-resp.json.tpl @@ -84,7 +84,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.54/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.54/server-action-rebuild-resp.json.tpl index e77bbd952b..8cbd781f42 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.54/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.54/server-action-rebuild-resp.json.tpl @@ -54,7 +54,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "tags": [] } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.57/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.57/server-action-rebuild-resp.json.tpl index 33c05f6ca2..936cdd57ef 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.57/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.57/server-action-rebuild-resp.json.tpl @@ -54,7 +54,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "tags": [], "user_data": "ZWNobyAiaGVsbG8gd29ybGQi" } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-action-rebuild-resp.json.tpl index 76b93ab767..a4c2065c00 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-action-rebuild-resp.json.tpl @@ -62,6 +62,6 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-get-resp.json.tpl index b0e890df2d..5336f2b63f 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-get-resp.json.tpl @@ -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" diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-update-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-update-resp.json.tpl index 233751590e..5b9df007a7 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-update-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/server-update-resp.json.tpl @@ -59,6 +59,6 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/servers-details-resp.json.tpl index ee96b1df86..20684f35c4 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.63/servers-details-resp.json.tpl @@ -87,7 +87,7 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } ], "servers_links": [ diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.66/servers-details-with-changes-before.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.66/servers-details-with-changes-before.json.tpl index 8f0a505178..f24e5646b5 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.66/servers-details-with-changes-before.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.66/servers-details-with-changes-before.json.tpl @@ -87,7 +87,7 @@ "674736e3-f25c-405c-8362-bbf991e0ce0a" ], "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } ] } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.69/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.69/server-get-resp.json.tpl index 12a67c6691..8b237094c7 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.69/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.69/server-get-resp.json.tpl @@ -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 @@ } ] } -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-action-rebuild-resp.json.tpl index 6082dd35f7..47a7ce1cb3 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-action-rebuild-resp.json.tpl @@ -57,7 +57,7 @@ "tags": [], "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "user_data": "ZWNobyAiaGVsbG8gd29ybGQi" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-down-cell-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-down-cell-resp.json.tpl index 5f732b8400..071d2cbb05 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-down-cell-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-down-cell-resp.json.tpl @@ -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", diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-resp.json.tpl index 260a22d785..1424522e32 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-get-resp.json.tpl @@ -82,6 +82,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-groups-post-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-groups-post-resp.json.tpl index ab5af46265..43d01c51f7 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-groups-post-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-groups-post-resp.json.tpl @@ -6,6 +6,6 @@ "policy": "affinity", "project_id": "6f70656e737461636b20342065766572", "rules": {}, - "user_id": "fake" + "user_id": "admin" } -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-update-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-update-resp.json.tpl index 98a4a0c57c..c8dfe4f08d 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-update-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.71/server-update-resp.json.tpl @@ -56,6 +56,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-action-rebuild-resp.json.tpl index 8b25ba622b..b056230c51 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-action-rebuild-resp.json.tpl @@ -59,6 +59,6 @@ "trusted_image_certificates": null, "updated": "%(isotime)s", "user_data": "ZWNobyAiaGVsbG8gd29ybGQi", - "user_id": "fake" + "user_id": "admin" } -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-get-resp.json.tpl index 1fd0f291a7..7479485c3e 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-get-resp.json.tpl @@ -83,6 +83,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-update-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-update-resp.json.tpl index 1dee1263b7..3c9a1b6f5f 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-update-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/server-update-resp.json.tpl @@ -56,6 +56,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/servers-details-resp.json.tpl index fcf12e1901..f747c757a3 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.73/servers-details-resp.json.tpl @@ -83,7 +83,7 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } ] -} \ No newline at end of file +} diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-action-rebuild-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-action-rebuild-resp.json.tpl index 37e52c17d5..559dd02fcf 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-action-rebuild-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-action-rebuild-resp.json.tpl @@ -84,6 +84,6 @@ "trusted_image_certificates": null, "updated": "%(isotime)s", "user_data": "ZWNobyAiaGVsbG8gd29ybGQi", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-update-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-update-resp.json.tpl index dfe6700a2b..876dccfa16 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-update-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.75/server-update-resp.json.tpl @@ -83,6 +83,6 @@ "tenant_id": "6f70656e737461636b20342065766572", "trusted_image_certificates": null, "updated": "%(isotime)s", - "user_id": "fake" + "user_id": "admin" } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/server-get-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/server-get-resp.json.tpl index 01c8d93096..a2bfefb6c2 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/server-get-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/server-get-resp.json.tpl @@ -79,7 +79,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "locked": false } } diff --git a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/servers-details-resp.json.tpl b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/servers-details-resp.json.tpl index 59f7885deb..7d49fb801c 100644 --- a/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/servers-details-resp.json.tpl +++ b/nova/tests/functional/api_sample_tests/api_samples/servers/v2.9/servers-details-resp.json.tpl @@ -80,7 +80,7 @@ "status": "ACTIVE", "tenant_id": "6f70656e737461636b20342065766572", "updated": "%(isotime)s", - "user_id": "fake", + "user_id": "admin", "locked": false } ], diff --git a/nova/tests/functional/api_sample_tests/test_admin_actions.py b/nova/tests/functional/api_sample_tests/test_admin_actions.py index aaa967a707..fd35b96a19 100644 --- a/nova/tests/functional/api_sample_tests/test_admin_actions.py +++ b/nova/tests/functional/api_sample_tests/test_admin_actions.py @@ -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): diff --git a/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py b/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py index ccd65e27d3..459775b78f 100644 --- a/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py +++ b/nova/tests/functional/api_sample_tests/test_assisted_volume_snapshots.py @@ -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): diff --git a/nova/tests/functional/api_sample_tests/test_instance_actions.py b/nova/tests/functional/api_sample_tests/test_instance_actions.py index e91a87301c..72caa13bd8 100644 --- a/nova/tests/functional/api_sample_tests/test_instance_actions.py +++ b/nova/tests/functional/api_sample_tests/test_instance_actions.py @@ -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 { diff --git a/nova/tests/functional/api_sample_tests/test_migrate_server.py b/nova/tests/functional/api_sample_tests/test_migrate_server.py index 1ea7a5fe3d..2fc545459a 100644 --- a/nova/tests/functional/api_sample_tests/test_migrate_server.py +++ b/nova/tests/functional/api_sample_tests/test_migrate_server.py @@ -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'})] diff --git a/nova/tests/functional/api_sample_tests/test_server_diagnostics.py b/nova/tests/functional/api_sample_tests/test_server_diagnostics.py index 336aab7946..a67e8a844e 100644 --- a/nova/tests/functional/api_sample_tests/test_server_diagnostics.py +++ b/nova/tests/functional/api_sample_tests/test_server_diagnostics.py @@ -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): diff --git a/nova/tests/functional/api_sample_tests/test_server_migrations.py b/nova/tests/functional/api_sample_tests/test_server_migrations.py index f9a658feb0..477bc81cb0 100644 --- a/nova/tests/functional/api_sample_tests/test_server_migrations.py +++ b/nova/tests/functional/api_sample_tests/test_server_migrations.py @@ -27,6 +27,9 @@ from nova.tests.unit import fake_instance class ServerMigrationsSampleJsonTest(test_servers.ServersSampleBase): + # The 'os_compute_api:servers:migrations:*' and + # 'os_compute_api:os-migrations:*' policies are admin-only + ADMIN_API = True sample_dir = 'server-migrations' scenarios = [('v2_22', {'api_major_version': 'v2.1'})] microversion = '2.22' @@ -66,6 +69,8 @@ class ServerMigrationsSampleJsonTest(test_servers.ServersSampleBase): class ServerMigrationsSamplesJsonTestV2_23(test_servers.ServersSampleBase): + # The 'os_compute_api:servers:migrations:*' and + # 'os_compute_api:os-migrations:*' policies are admin-only ADMIN_API = True sample_dir = "server-migrations" microversion = '2.23' @@ -163,6 +168,8 @@ class ServerMigrationsSamplesJsonTestV2_23(test_servers.ServersSampleBase): class ServerMigrationsSampleJsonTestV2_24(test_servers.ServersSampleBase): + # The 'os_compute_api:servers:migrations:*' and + # 'os_compute_api:os-migrations:*' policies are admin-only ADMIN_API = True microversion = '2.24' sample_dir = "server-migrations" @@ -216,7 +223,6 @@ class ServerMigrationsSampleJsonTestV2_24(test_servers.ServersSampleBase): class ServerMigrationsSamplesJsonTestV2_59( ServerMigrationsSamplesJsonTestV2_23 ): - ADMIN_API = True microversion = '2.59' scenarios = [('v2_59', {'api_major_version': 'v2.1'})] @@ -230,7 +236,6 @@ class ServerMigrationsSamplesJsonTestV2_59( class ServerMigrationsSampleJsonTestV2_65(ServerMigrationsSampleJsonTestV2_24): - ADMIN_API = True microversion = '2.65' scenarios = [('v2_65', {'api_major_version': 'v2.1'})] diff --git a/nova/tests/functional/api_sample_tests/test_servers.py b/nova/tests/functional/api_sample_tests/test_servers.py index 958eda595f..17ecc19649 100644 --- a/nova/tests/functional/api_sample_tests/test_servers.py +++ b/nova/tests/functional/api_sample_tests/test_servers.py @@ -104,6 +104,9 @@ class ServersSampleBase(api_sample_base.ApiSampleTestBaseV21): class ServersSampleJsonTest(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True # This controls whether or not we use the common server API sample # for server post req/resp. use_common_server_post = True @@ -256,6 +259,9 @@ class ServersSampleJson252Test(ServersSampleJsonTest): class ServersSampleJson263Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.63' scenarios = [('v2_63', {'api_major_version': 'v2.1'})] @@ -324,6 +330,9 @@ class ServersSampleJson263Test(ServersSampleBase): class ServersSampleJson266Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.66' scenarios = [('v2_66', {'api_major_version': 'v2.1'})] @@ -376,6 +385,9 @@ class ServersSampleJson267Test(ServersSampleBase): class ServersSampleJson269Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.69' scenarios = [('v2_69', {'api_major_version': 'v2.1'})] @@ -423,6 +435,9 @@ class ServersSampleJson269Test(ServersSampleBase): class ServersSampleJson271Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.71' scenarios = [('v2_71', {'api_major_version': 'v2.1'})] @@ -515,6 +530,9 @@ class ServersSampleJson271Test(ServersSampleBase): class ServersSampleJson273Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.73' scenarios = [('v2_73', {'api_major_version': 'v2.1'})] @@ -571,6 +589,8 @@ class ServersSampleJson274Test(ServersSampleBase): """Supporting host and/or hypervisor_hostname is an admin API to create servers. """ + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't ADMIN_API = True SUPPORTS_CELLS = True microversion = '2.74' @@ -601,6 +621,10 @@ class ServersSampleJson274Test(ServersSampleBase): class ServersUpdateSampleJsonTest(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True + def test_update_server(self): uuid = self._post_server() subs = {} @@ -668,6 +692,9 @@ class _ServersActionsJsonTestMixin(object): class ServersActionsJsonTest(ServersSampleBase, _ServersActionsJsonTestMixin): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True SUPPORTS_CELLS = True def test_server_reboot_hard(self): @@ -793,6 +820,9 @@ class ServersActionsJsonTest(ServersSampleBase, _ServersActionsJsonTestMixin): class ServersActionsJson219Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.19' scenarios = [('v2_19', {'api_major_version': 'v2.1'})] @@ -817,6 +847,9 @@ class ServersActionsJson219Test(ServersSampleBase): class ServersActionsJson226Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.26' scenarios = [('v2_26', {'api_major_version': 'v2.1'})] @@ -849,6 +882,9 @@ class ServersActionsJson226Test(ServersSampleBase): class ServersActionsJson254Test(ServersSampleBase): + # Many of the 'os_compute_api:servers:*' policies are admin-only, and we + # want to get admin-style (complete) responses even for those aren't + ADMIN_API = True microversion = '2.54' sample_dir = 'servers' scenarios = [('v2_54', {'api_major_version': 'v2.1'})] diff --git a/nova/tests/functional/api_sample_tests/test_shelve.py b/nova/tests/functional/api_sample_tests/test_shelve.py index 958cdb2de5..37d24b6cea 100644 --- a/nova/tests/functional/api_sample_tests/test_shelve.py +++ b/nova/tests/functional/api_sample_tests/test_shelve.py @@ -21,6 +21,8 @@ CONF = nova.conf.CONF class ShelveJsonTest(test_servers.ServersSampleBase): + # The 'os_compute_api:os-shelve:shelve_offload' policy is admin-only + ADMIN_API = True sample_dir = "os-shelve" def setUp(self): diff --git a/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py b/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py index 640dc972de..ca718294eb 100644 --- a/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py +++ b/nova/tests/functional/api_sample_tests/test_simple_tenant_usage.py @@ -23,6 +23,8 @@ import nova.tests.functional.api_samples_test_base as astb class SimpleTenantUsageSampleJsonTest(test_servers.ServersSampleBase): + # The 'os_compute_api:os-simple-tenant-usage:list' policy is admin-only + ADMIN_API = True sample_dir = "os-simple-tenant-usage" def setUp(self): @@ -71,6 +73,8 @@ class SimpleTenantUsageSampleJsonTest(test_servers.ServersSampleBase): class SimpleTenantUsageV240Test(test_servers.ServersSampleBase): + # The 'os_compute_api:os-simple-tenant-usage:list' policy is admin-only + ADMIN_API = True USE_PROJECT_ID = False sample_dir = 'os-simple-tenant-usage' diff --git a/nova/tests/functional/api_sample_tests/test_volumes.py b/nova/tests/functional/api_sample_tests/test_volumes.py index 4c48a3e164..bb4039161f 100644 --- a/nova/tests/functional/api_sample_tests/test_volumes.py +++ b/nova/tests/functional/api_sample_tests/test_volumes.py @@ -190,6 +190,8 @@ class VolumesSampleJsonTest(test_servers.ServersSampleBase): class VolumeAttachmentsSample(test_servers.ServersSampleBase): + # The 'os_compute_api:os-volumes-attachments:swap' policy is admin-only + ADMIN_API = True sample_dir = "os-volumes" OLD_VOLUME_ID = fixtures.CinderFixture.SWAP_OLD_VOL diff --git a/nova/tests/functional/compute/test_live_migration.py b/nova/tests/functional/compute/test_live_migration.py index f1d02626fd..d94b084736 100644 --- a/nova/tests/functional/compute/test_live_migration.py +++ b/nova/tests/functional/compute/test_live_migration.py @@ -41,6 +41,8 @@ class FakeCinderError(object): class LiveMigrationCinderFailure(integrated_helpers._IntegratedTestBase): + # Default self.api to the self.admin_api as live migration is admin only + ADMIN_API = True api_major_version = 'v2.1' microversion = 'latest' diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py index 1d0380d3cc..5dec6bae50 100644 --- a/nova/tests/functional/integrated_helpers.py +++ b/nova/tests/functional/integrated_helpers.py @@ -1052,26 +1052,29 @@ class _IntegratedTestBase(test.TestCase, PlacementInstanceHelperMixin): self.fake_image_service =\ nova.tests.unit.image.fake.stub_out_image_service(self) + self.addCleanup(nova.tests.unit.image.fake.FakeImageService_reset) self.useFixture(cast_as_call.CastAsCall(self)) self.placement = self.useFixture(func_fixtures.PlacementFixture()).api self.neutron = self.useFixture(nova_fixtures.NeutronFixture(self)) self.cinder = self.useFixture(nova_fixtures.CinderFixture(self)) + self.policy = self.useFixture(policy_fixture.RealPolicyFixture()) fake_notifier.stub_notifier(self) self.addCleanup(fake_notifier.reset) self._setup_services() - self.addCleanup(nova.tests.unit.image.fake.FakeImageService_reset) - def _setup_compute_service(self): return self._start_compute('compute') def _setup_scheduler_service(self): return self.start_service('scheduler') + def _setup_conductor_service(self): + return self.start_service('conductor') + def _setup_services(self): # NOTE(danms): Set the global MQ connection to that of our first cell # for any cells-ignorant code. Normally this is defaulted in the tests @@ -1079,7 +1082,7 @@ class _IntegratedTestBase(test.TestCase, PlacementInstanceHelperMixin): if 'cell1' in self.cell_mappings: self.flags(transport_url=self.cell_mappings['cell1'].transport_url) - self.conductor = self.start_service('conductor') + self.conductor = self._setup_conductor_service() self.scheduler = self._setup_scheduler_service() self.compute = self._setup_compute_service() diff --git a/nova/tests/functional/libvirt/test_numa_servers.py b/nova/tests/functional/libvirt/test_numa_servers.py index 6266f12dac..a0da12c7cb 100644 --- a/nova/tests/functional/libvirt/test_numa_servers.py +++ b/nova/tests/functional/libvirt/test_numa_servers.py @@ -330,7 +330,7 @@ class NUMAServersTest(NUMAServersTestBase): flavor_id = self._create_flavor(vcpu=2, extra_spec=extra_spec) # Update the core quota less than we requested - self.api.update_quota({'cores': 1}) + self.admin_api.update_quota({'cores': 1}) post = {'server': self._build_server(flavor_id=flavor_id)} @@ -430,7 +430,7 @@ class NUMAServersTest(NUMAServersTestBase): flavor_id = self._create_flavor(vcpu=2, extra_spec=extra_spec) # Update the core quota less than we requested - self.api.update_quota({'cores': 1}) + self.admin_api.update_quota({'cores': 1}) post = {'server': self._build_server(flavor_id=flavor_id)} @@ -1140,7 +1140,7 @@ class NUMAServersWithNetworksTest(NUMAServersTestBase): # probably be less...dumb with mock.patch('nova.virt.libvirt.driver.LibvirtDriver' '.migrate_disk_and_power_off', return_value='{}'): - self.api.post_server_action(server['id'], {'migrate': None}) + self.admin_api.post_server_action(server['id'], {'migrate': None}) server = self._wait_for_state_change(server, 'VERIFY_RESIZE') diff --git a/nova/tests/functional/libvirt/test_pci_sriov_servers.py b/nova/tests/functional/libvirt/test_pci_sriov_servers.py index ffab7c8473..d494d66a07 100644 --- a/nova/tests/functional/libvirt/test_pci_sriov_servers.py +++ b/nova/tests/functional/libvirt/test_pci_sriov_servers.py @@ -250,7 +250,9 @@ class SRIOVServersTest(_PCIServersTestBase): # now check the server diagnostics to ensure the VF-type PCI device is # attached - diagnostics = self.api.get_server_diagnostics(server['id']) + diagnostics = self.admin_api.get_server_diagnostics( + server['id'] + ) self.assertEqual( base.LibvirtNeutronFixture.network_1_port_2['mac_address'], diff --git a/nova/tests/functional/libvirt/test_vgpu.py b/nova/tests/functional/libvirt/test_vgpu.py index 53d03cb2f8..3c41d39885 100644 --- a/nova/tests/functional/libvirt/test_vgpu.py +++ b/nova/tests/functional/libvirt/test_vgpu.py @@ -25,7 +25,6 @@ import nova.conf from nova import context from nova import objects from nova.tests.functional.libvirt import base -from nova.tests.unit import policy_fixture from nova.tests.unit.virt.libvirt import fakelibvirt from nova.virt.libvirt import driver as libvirt_driver from nova.virt.libvirt import utils as libvirt_utils @@ -142,9 +141,8 @@ class VGPUTests(VGPUTestBase): return_value=[])) self.useFixture(fixtures.MockPatch('os.rename')) - policy = self.useFixture(policy_fixture.RealPolicyFixture()) # Allow non-admins to see instance action events. - policy.set_rules({ + self.policy.set_rules({ 'os_compute_api:os-instance-actions:events': 'rule:admin_or_owner' }, overwrite=False) diff --git a/nova/tests/functional/libvirt/test_vtpm.py b/nova/tests/functional/libvirt/test_vtpm.py index 26661dcb22..4778863a7b 100644 --- a/nova/tests/functional/libvirt/test_vtpm.py +++ b/nova/tests/functional/libvirt/test_vtpm.py @@ -118,6 +118,9 @@ class FakeKeyManager(key_manager.KeyManager): class VTPMServersTest(base.ServersTestBase): + # many move operations are admin-only + ADMIN_API = True + def setUp(self): # enable vTPM and use our own fake key service self.flags(swtpm_enabled=True, group='libvirt') diff --git a/nova/tests/functional/regressions/test_bug_1879878.py b/nova/tests/functional/regressions/test_bug_1879878.py index dc03ac3425..3a21c5c11d 100644 --- a/nova/tests/functional/regressions/test_bug_1879878.py +++ b/nova/tests/functional/regressions/test_bug_1879878.py @@ -33,6 +33,8 @@ class TestSameCell(integrated_helpers._IntegratedTestBase): destination host, respectively. """ + # cold migration is an admin-only operation by default + ADMIN_API = True compute_driver = 'fake.MediumFakeDriver' microversion = 'latest' @@ -179,6 +181,9 @@ class TestCrossCell(integrated_helpers.ProviderUsageBaseTestCase): reverted and dropping the claim for that migration on the source or destination host, respectively. """ + + # cold migration is an admin-only operation by default + ADMIN_API = True NUMBER_OF_CELLS = 2 compute_driver = 'fake.MediumFakeDriver' diff --git a/nova/tests/functional/regressions/test_bug_1886418.py b/nova/tests/functional/regressions/test_bug_1886418.py index 30360b8e14..640e3134fe 100644 --- a/nova/tests/functional/regressions/test_bug_1886418.py +++ b/nova/tests/functional/regressions/test_bug_1886418.py @@ -32,11 +32,11 @@ class TestServices(integrated_helpers._IntegratedTestBase): ).body['traits'] def _disable_compute(self): - self.api.put_service( + self.admin_api.put_service( self.compute_service_id, {'status': 'disabled'}) def _enable_compute(self): - self.api.put_service( + self.admin_api.put_service( self.compute_service_id, {'status': 'enabled'}) def _has_disabled_trait(self): diff --git a/nova/tests/functional/test_servers.py b/nova/tests/functional/test_servers.py index dd84547308..994f40367d 100644 --- a/nova/tests/functional/test_servers.py +++ b/nova/tests/functional/test_servers.py @@ -1303,13 +1303,12 @@ class ServerRebuildTestCase(integrated_helpers._IntegratedTestBase): def _disable_compute_for(self, server): # Refresh to get its host - server = self.api.get_server(server['id']) + server = self.admin_api.get_server(server['id']) host = server['OS-EXT-SRV-ATTR:host'] # Disable the service it is on - self.api_fixture.admin_api.put_service('disable', - {'host': host, - 'binary': 'nova-compute'}) + self.admin_api.put_service( + 'disable', {'host': host, 'binary': 'nova-compute'}) def test_rebuild_with_image_novalidhost(self): """Creates a server with an image that is valid for the single compute