ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
Jay Pipes | 13b479b | 2012-06-11 14:52:27 -0400 | [diff] [blame] | 2 | # All Rights Reserved. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | # not use this file except in compliance with the License. You may obtain |
| 6 | # a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 13 | # License for the specific language governing permissions and limitations |
| 14 | # under the License. |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 15 | |
Adam Gandelman | 85f5bed | 2014-06-19 16:48:17 -0700 | [diff] [blame] | 16 | import StringIO |
| 17 | |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 18 | from tempest_lib import exceptions as lib_exc |
| 19 | |
Sean Dague | 1937d09 | 2013-05-17 16:36:38 -0400 | [diff] [blame] | 20 | from tempest.api.compute import base |
Matthew Treinish | 481466b | 2012-12-20 17:16:01 -0500 | [diff] [blame] | 21 | from tempest import clients |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 22 | from tempest.common.utils import data_utils |
Matthew Treinish | b0a78fc | 2014-01-29 16:49:12 +0000 | [diff] [blame] | 23 | from tempest import config |
Giulio Fidente | 92f7719 | 2013-08-26 17:13:28 +0200 | [diff] [blame] | 24 | from tempest.openstack.common import log as logging |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 25 | from tempest import test |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 26 | |
Matthew Treinish | b0a78fc | 2014-01-29 16:49:12 +0000 | [diff] [blame] | 27 | CONF = config.CONF |
| 28 | |
Giulio Fidente | 92f7719 | 2013-08-26 17:13:28 +0200 | [diff] [blame] | 29 | LOG = logging.getLogger(__name__) |
| 30 | |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 31 | |
ivan-zhu | f2b0050 | 2013-10-18 10:06:52 +0800 | [diff] [blame] | 32 | class AuthorizationTestJSON(base.BaseV2ComputeTest): |
Emily Hugenbruch | e7991d9 | 2014-12-12 16:53:36 +0000 | [diff] [blame] | 33 | |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 34 | @classmethod |
Emily Hugenbruch | e7991d9 | 2014-12-12 16:53:36 +0000 | [diff] [blame] | 35 | def skip_checks(cls): |
| 36 | super(AuthorizationTestJSON, cls).skip_checks() |
Adam Gandelman | 85f5bed | 2014-06-19 16:48:17 -0700 | [diff] [blame] | 37 | if not CONF.service_available.glance: |
| 38 | raise cls.skipException('Glance is not available.') |
Emily Hugenbruch | e7991d9 | 2014-12-12 16:53:36 +0000 | [diff] [blame] | 39 | |
| 40 | @classmethod |
| 41 | def setup_credentials(cls): |
Salvatore Orlando | 5a33724 | 2014-01-15 22:49:22 +0000 | [diff] [blame] | 42 | # No network resources required for this test |
| 43 | cls.set_network_resources() |
Emily Hugenbruch | e7991d9 | 2014-12-12 16:53:36 +0000 | [diff] [blame] | 44 | super(AuthorizationTestJSON, cls).setup_credentials() |
Matthew Treinish | f7fca6a | 2013-12-09 16:27:23 +0000 | [diff] [blame] | 45 | if not cls.multi_user: |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 46 | msg = "Need >1 user" |
ivan-zhu | 1feeb38 | 2013-01-24 10:14:39 +0800 | [diff] [blame] | 47 | raise cls.skipException(msg) |
Emily Hugenbruch | e7991d9 | 2014-12-12 16:53:36 +0000 | [diff] [blame] | 48 | |
| 49 | creds = cls.isolated_creds.get_alt_creds() |
| 50 | cls.alt_manager = clients.Manager(credentials=creds) |
| 51 | |
| 52 | @classmethod |
| 53 | def setup_clients(cls): |
| 54 | super(AuthorizationTestJSON, cls).setup_clients() |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 55 | cls.client = cls.os.servers_client |
| 56 | cls.images_client = cls.os.images_client |
Adam Gandelman | 85f5bed | 2014-06-19 16:48:17 -0700 | [diff] [blame] | 57 | cls.glance_client = cls.os.image_client |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 58 | cls.keypairs_client = cls.os.keypairs_client |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 59 | cls.security_client = cls.os.security_groups_client |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 60 | |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 61 | cls.alt_client = cls.alt_manager.servers_client |
| 62 | cls.alt_images_client = cls.alt_manager.images_client |
| 63 | cls.alt_keypairs_client = cls.alt_manager.keypairs_client |
| 64 | cls.alt_security_client = cls.alt_manager.security_groups_client |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 65 | |
Emily Hugenbruch | e7991d9 | 2014-12-12 16:53:36 +0000 | [diff] [blame] | 66 | @classmethod |
| 67 | def resource_setup(cls): |
| 68 | super(AuthorizationTestJSON, cls).resource_setup() |
David Kranz | 0fb1429 | 2015-02-11 15:55:20 -0500 | [diff] [blame] | 69 | server = cls.create_test_server(wait_until='ACTIVE') |
| 70 | cls.server = cls.client.get_server(server['id']) |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 71 | |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 72 | name = data_utils.rand_name('image') |
David Kranz | 34f1878 | 2015-01-06 13:43:55 -0500 | [diff] [blame] | 73 | body = cls.glance_client.create_image(name=name, |
| 74 | container_format='bare', |
| 75 | disk_format='raw', |
| 76 | is_public=False) |
Adam Gandelman | 85f5bed | 2014-06-19 16:48:17 -0700 | [diff] [blame] | 77 | image_id = body['id'] |
| 78 | image_file = StringIO.StringIO(('*' * 1024)) |
David Kranz | 34f1878 | 2015-01-06 13:43:55 -0500 | [diff] [blame] | 79 | body = cls.glance_client.update_image(image_id, data=image_file) |
Adam Gandelman | 85f5bed | 2014-06-19 16:48:17 -0700 | [diff] [blame] | 80 | cls.glance_client.wait_for_image_status(image_id, 'active') |
David Kranz | a5299eb | 2015-01-15 17:24:05 -0500 | [diff] [blame] | 81 | cls.image = cls.images_client.get_image(image_id) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 82 | |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 83 | cls.keypairname = data_utils.rand_name('keypair') |
David Kranz | 173f0e0 | 2015-02-06 13:47:57 -0500 | [diff] [blame] | 84 | cls.keypairs_client.create_keypair(cls.keypairname) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 85 | |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 86 | name = data_utils.rand_name('security') |
| 87 | description = data_utils.rand_name('description') |
David Kranz | 9964b4e | 2015-02-06 15:45:29 -0500 | [diff] [blame] | 88 | cls.security_group = cls.security_client.create_security_group( |
nayna-patel | eda1d12 | 2013-03-20 14:44:31 +0000 | [diff] [blame] | 89 | name, description) |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 90 | |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 91 | parent_group_id = cls.security_group['id'] |
| 92 | ip_protocol = 'tcp' |
| 93 | from_port = 22 |
| 94 | to_port = 22 |
David Kranz | 9964b4e | 2015-02-06 15:45:29 -0500 | [diff] [blame] | 95 | cls.rule = cls.security_client.create_security_group_rule( |
nayna-patel | eda1d12 | 2013-03-20 14:44:31 +0000 | [diff] [blame] | 96 | parent_group_id, ip_protocol, from_port, to_port) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 97 | |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 98 | @classmethod |
Andrea Frittoli | 50bb80d | 2014-09-15 12:34:27 +0100 | [diff] [blame] | 99 | def resource_cleanup(cls): |
Matthew Treinish | f7fca6a | 2013-12-09 16:27:23 +0000 | [diff] [blame] | 100 | if cls.multi_user: |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 101 | cls.images_client.delete_image(cls.image['id']) |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 102 | cls.keypairs_client.delete_keypair(cls.keypairname) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 103 | cls.security_client.delete_security_group(cls.security_group['id']) |
Andrea Frittoli | 50bb80d | 2014-09-15 12:34:27 +0100 | [diff] [blame] | 104 | super(AuthorizationTestJSON, cls).resource_cleanup() |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 105 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 106 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 107 | def test_get_server_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 108 | # A GET request for a server on another user's account should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 109 | self.assertRaises(lib_exc.NotFound, self.alt_client.get_server, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 110 | self.server['id']) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 111 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 112 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 113 | def test_delete_server_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 114 | # A DELETE request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 115 | self.assertRaises(lib_exc.NotFound, self.alt_client.delete_server, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 116 | self.server['id']) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 117 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 118 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 119 | def test_update_server_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 120 | # An update server request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 121 | self.assertRaises(lib_exc.NotFound, self.alt_client.update_server, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 122 | self.server['id'], name='test') |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 123 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 124 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 125 | def test_list_server_addresses_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 126 | # A list addresses request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 127 | self.assertRaises(lib_exc.NotFound, self.alt_client.list_addresses, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 128 | self.server['id']) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 129 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 130 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 131 | def test_list_server_addresses_by_network_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 132 | # A list address/network request for another user's server should fail |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 133 | server_id = self.server['id'] |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 134 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 135 | self.alt_client.list_addresses_by_network, server_id, |
| 136 | 'public') |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 137 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 138 | @test.attr(type='gate') |
sapan-kona | 3793976 | 2012-06-28 20:22:43 +0530 | [diff] [blame] | 139 | def test_list_servers_with_alternate_tenant(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 140 | # A list on servers from one tenant should not |
| 141 | # show on alternate tenant |
Attila Fazekas | f7f34f9 | 2013-08-01 17:01:44 +0200 | [diff] [blame] | 142 | # Listing servers from alternate tenant |
sapan-kona | 3793976 | 2012-06-28 20:22:43 +0530 | [diff] [blame] | 143 | alt_server_ids = [] |
David Kranz | ae99b9a | 2015-02-16 13:37:01 -0500 | [diff] [blame] | 144 | body = self.alt_client.list_servers() |
sapan-kona | 3793976 | 2012-06-28 20:22:43 +0530 | [diff] [blame] | 145 | alt_server_ids = [s['id'] for s in body['servers']] |
| 146 | self.assertNotIn(self.server['id'], alt_server_ids) |
| 147 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 148 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 149 | def test_change_password_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 150 | # A change password request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 151 | self.assertRaises(lib_exc.NotFound, self.alt_client.change_password, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 152 | self.server['id'], 'newpass') |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 153 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 154 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 155 | def test_reboot_server_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 156 | # A reboot request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 157 | self.assertRaises(lib_exc.NotFound, self.alt_client.reboot, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 158 | self.server['id'], 'HARD') |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 159 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 160 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 161 | def test_rebuild_server_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 162 | # A rebuild request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 163 | self.assertRaises(lib_exc.NotFound, self.alt_client.rebuild, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 164 | self.server['id'], self.image_ref_alt) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 165 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 166 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 167 | def test_resize_server_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 168 | # A resize request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 169 | self.assertRaises(lib_exc.NotFound, self.alt_client.resize, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 170 | self.server['id'], self.flavor_ref_alt) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 171 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 172 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 173 | def test_create_image_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 174 | # A create image request for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 175 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 176 | self.alt_images_client.create_image, |
| 177 | self.server['id'], 'testImage') |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 178 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 179 | @test.attr(type='gate') |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 180 | def test_create_server_with_unauthorized_image(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 181 | # Server creation with another user's image should fail |
Masayuki Igawa | 4b29e47 | 2015-02-16 10:41:54 +0900 | [diff] [blame] | 182 | self.assertRaises(lib_exc.BadRequest, self.alt_client.create_server, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 183 | 'test', self.image['id'], self.flavor_ref) |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 184 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 185 | @test.attr(type='gate') |
Daryl Walleck | ced8eb8 | 2012-03-19 13:52:37 -0500 | [diff] [blame] | 186 | def test_create_server_fails_when_tenant_incorrect(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 187 | # A create server request should fail if the tenant id does not match |
| 188 | # the current user |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 189 | # Change the base URL to impersonate another user |
| 190 | self.alt_client.auth_provider.set_alt_auth_data( |
| 191 | request_part='url', |
| 192 | auth_data=self.client.auth_provider.auth_data |
| 193 | ) |
Masayuki Igawa | 4b29e47 | 2015-02-16 10:41:54 +0900 | [diff] [blame] | 194 | self.assertRaises(lib_exc.BadRequest, |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 195 | self.alt_client.create_server, 'test', |
| 196 | self.image['id'], self.flavor_ref) |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 197 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 198 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 199 | def test_create_keypair_in_analt_user_tenant(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 200 | # A create keypair request should fail if the tenant id does not match |
| 201 | # the current user |
Attila Fazekas | f7f34f9 | 2013-08-01 17:01:44 +0200 | [diff] [blame] | 202 | # POST keypair with other user tenant |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 203 | k_name = data_utils.rand_name('keypair-') |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 204 | try: |
| 205 | # Change the base URL to impersonate another user |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 206 | self.alt_keypairs_client.auth_provider.set_alt_auth_data( |
| 207 | request_part='url', |
| 208 | auth_data=self.keypairs_client.auth_provider.auth_data |
| 209 | ) |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 210 | resp = {} |
| 211 | resp['status'] = None |
Masayuki Igawa | 4b29e47 | 2015-02-16 10:41:54 +0900 | [diff] [blame] | 212 | self.assertRaises(lib_exc.BadRequest, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 213 | self.alt_keypairs_client.create_keypair, k_name) |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 214 | finally: |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 215 | # Next request the base_url is back to normal |
Zhongyue Luo | e471d6e | 2012-09-17 17:02:43 +0800 | [diff] [blame] | 216 | if (resp['status'] is not None): |
David Kranz | 173f0e0 | 2015-02-06 13:47:57 -0500 | [diff] [blame] | 217 | self.alt_keypairs_client.delete_keypair(k_name) |
Giulio Fidente | 92f7719 | 2013-08-26 17:13:28 +0200 | [diff] [blame] | 218 | LOG.error("Create keypair request should not happen " |
Zhongyue Luo | 79d8d36 | 2012-09-25 13:49:27 +0800 | [diff] [blame] | 219 | "if the tenant id does not match the current user") |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 220 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 221 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 222 | def test_get_keypair_of_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 223 | # A GET request for another user's keypair should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 224 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 225 | self.alt_keypairs_client.get_keypair, |
| 226 | self.keypairname) |
rajalakshmi-ganesan | b74a11a | 2012-05-16 10:37:58 +0530 | [diff] [blame] | 227 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 228 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 229 | def test_delete_keypair_of_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 230 | # A DELETE request for another user's keypair should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 231 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 232 | self.alt_keypairs_client.delete_keypair, |
| 233 | self.keypairname) |
rajalakshmi-ganesan | 32f8db6 | 2012-05-18 19:13:40 +0530 | [diff] [blame] | 234 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 235 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 236 | def test_get_image_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 237 | # A GET request for an image on another user's account should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 238 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 239 | self.alt_images_client.get_image, self.image['id']) |
rajalakshmi-ganesan | 32f8db6 | 2012-05-18 19:13:40 +0530 | [diff] [blame] | 240 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 241 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 242 | def test_delete_image_for_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 243 | # A DELETE request for another user's image should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 244 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 245 | self.alt_images_client.delete_image, |
| 246 | self.image['id']) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 247 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 248 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 249 | def test_create_security_group_in_analt_user_tenant(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 250 | # A create security group request should fail if the tenant id does not |
| 251 | # match the current user |
Attila Fazekas | f7f34f9 | 2013-08-01 17:01:44 +0200 | [diff] [blame] | 252 | # POST security group with other user tenant |
Masayuki Igawa | 259c113 | 2013-10-31 17:48:44 +0900 | [diff] [blame] | 253 | s_name = data_utils.rand_name('security-') |
| 254 | s_description = data_utils.rand_name('security') |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 255 | try: |
| 256 | # Change the base URL to impersonate another user |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 257 | self.alt_security_client.auth_provider.set_alt_auth_data( |
| 258 | request_part='url', |
| 259 | auth_data=self.security_client.auth_provider.auth_data |
| 260 | ) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 261 | resp = {} |
| 262 | resp['status'] = None |
Masayuki Igawa | 4b29e47 | 2015-02-16 10:41:54 +0900 | [diff] [blame] | 263 | self.assertRaises(lib_exc.BadRequest, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 264 | self.alt_security_client.create_security_group, |
| 265 | s_name, s_description) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 266 | finally: |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 267 | # Next request the base_url is back to normal |
Zhongyue Luo | e471d6e | 2012-09-17 17:02:43 +0800 | [diff] [blame] | 268 | if resp['status'] is not None: |
Monty Taylor | b2ca5ca | 2013-04-28 18:00:21 -0700 | [diff] [blame] | 269 | self.alt_security_client.delete_security_group(resp['id']) |
Giulio Fidente | 92f7719 | 2013-08-26 17:13:28 +0200 | [diff] [blame] | 270 | LOG.error("Create Security Group request should not happen if" |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 271 | "the tenant id does not match the current user") |
| 272 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 273 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 274 | def test_get_security_group_of_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 275 | # A GET request for another user's security group should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 276 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 277 | self.alt_security_client.get_security_group, |
| 278 | self.security_group['id']) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 279 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 280 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 281 | def test_delete_security_group_of_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 282 | # A DELETE request for another user's security group should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 283 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 284 | self.alt_security_client.delete_security_group, |
| 285 | self.security_group['id']) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 286 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 287 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 288 | def test_create_security_group_rule_in_analt_user_tenant(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 289 | # A create security group rule request should fail if the tenant id |
| 290 | # does not match the current user |
Attila Fazekas | f7f34f9 | 2013-08-01 17:01:44 +0200 | [diff] [blame] | 291 | # POST security group rule with other user tenant |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 292 | parent_group_id = self.security_group['id'] |
| 293 | ip_protocol = 'icmp' |
| 294 | from_port = -1 |
| 295 | to_port = -1 |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 296 | try: |
| 297 | # Change the base URL to impersonate another user |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 298 | self.alt_security_client.auth_provider.set_alt_auth_data( |
| 299 | request_part='url', |
| 300 | auth_data=self.security_client.auth_provider.auth_data |
| 301 | ) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 302 | resp = {} |
| 303 | resp['status'] = None |
Masayuki Igawa | 4b29e47 | 2015-02-16 10:41:54 +0900 | [diff] [blame] | 304 | self.assertRaises(lib_exc.BadRequest, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 305 | self.alt_security_client. |
| 306 | create_security_group_rule, |
| 307 | parent_group_id, ip_protocol, from_port, |
| 308 | to_port) |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 309 | finally: |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 310 | # Next request the base_url is back to normal |
Zhongyue Luo | e471d6e | 2012-09-17 17:02:43 +0800 | [diff] [blame] | 311 | if resp['status'] is not None: |
Monty Taylor | b2ca5ca | 2013-04-28 18:00:21 -0700 | [diff] [blame] | 312 | self.alt_security_client.delete_security_group_rule(resp['id']) |
Giulio Fidente | 92f7719 | 2013-08-26 17:13:28 +0200 | [diff] [blame] | 313 | LOG.error("Create security group rule request should not " |
rajalakshmi-ganesan | 184daad | 2012-05-18 14:47:38 +0530 | [diff] [blame] | 314 | "happen if the tenant id does not match the" |
| 315 | " current user") |
| 316 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 317 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 318 | def test_delete_security_group_rule_of_alt_account_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 319 | # A DELETE request for another user's security group rule |
| 320 | # should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 321 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 322 | self.alt_security_client.delete_security_group_rule, |
| 323 | self.rule['id']) |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 324 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 325 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 326 | def test_set_metadata_of_alt_account_server_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 327 | # A set metadata for another user's server should fail |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 328 | req_metadata = {'meta1': 'data1', 'meta2': 'data2'} |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 329 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 330 | self.alt_client.set_server_metadata, |
| 331 | self.server['id'], |
| 332 | req_metadata) |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 333 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 334 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 335 | def test_set_metadata_of_alt_account_image_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 336 | # A set metadata for another user's image should fail |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 337 | req_metadata = {'meta1': 'value1', 'meta2': 'value2'} |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 338 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 339 | self.alt_images_client.set_image_metadata, |
| 340 | self.image['id'], req_metadata) |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 341 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 342 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 343 | def test_get_metadata_of_alt_account_server_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 344 | # A get metadata for another user's server should fail |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 345 | req_metadata = {'meta1': 'data1'} |
Zhongyue Luo | e0884a3 | 2012-09-25 17:24:17 +0800 | [diff] [blame] | 346 | self.client.set_server_metadata(self.server['id'], req_metadata) |
hi2suresh | 31bb7cb | 2013-03-14 04:53:49 +0000 | [diff] [blame] | 347 | self.addCleanup(self.client.delete_server_metadata_item, |
| 348 | self.server['id'], 'meta1') |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 349 | self.assertRaises(lib_exc.NotFound, |
hi2suresh | 31bb7cb | 2013-03-14 04:53:49 +0000 | [diff] [blame] | 350 | self.alt_client.get_server_metadata_item, |
| 351 | self.server['id'], 'meta1') |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 352 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 353 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 354 | def test_get_metadata_of_alt_account_image_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 355 | # A get metadata for another user's image should fail |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 356 | req_metadata = {'meta1': 'value1'} |
hi2suresh | d0e2412 | 2013-03-15 03:06:53 +0000 | [diff] [blame] | 357 | self.addCleanup(self.images_client.delete_image_metadata_item, |
| 358 | self.image['id'], 'meta1') |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 359 | self.images_client.set_image_metadata(self.image['id'], |
Zhongyue Luo | 79d8d36 | 2012-09-25 13:49:27 +0800 | [diff] [blame] | 360 | req_metadata) |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 361 | self.assertRaises(lib_exc.NotFound, |
hi2suresh | d0e2412 | 2013-03-15 03:06:53 +0000 | [diff] [blame] | 362 | self.alt_images_client.get_image_metadata_item, |
| 363 | self.image['id'], 'meta1') |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 364 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 365 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 366 | def test_delete_metadata_of_alt_account_server_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 367 | # A delete metadata for another user's server should fail |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 368 | req_metadata = {'meta1': 'data1'} |
hi2suresh | d0e2412 | 2013-03-15 03:06:53 +0000 | [diff] [blame] | 369 | self.addCleanup(self.client.delete_server_metadata_item, |
| 370 | self.server['id'], 'meta1') |
Zhongyue Luo | e0884a3 | 2012-09-25 17:24:17 +0800 | [diff] [blame] | 371 | self.client.set_server_metadata(self.server['id'], req_metadata) |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 372 | self.assertRaises(lib_exc.NotFound, |
hi2suresh | d0e2412 | 2013-03-15 03:06:53 +0000 | [diff] [blame] | 373 | self.alt_client.delete_server_metadata_item, |
| 374 | self.server['id'], 'meta1') |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 375 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 376 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 377 | def test_delete_metadata_of_alt_account_image_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 378 | # A delete metadata for another user's image should fail |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 379 | req_metadata = {'meta1': 'data1'} |
hi2suresh | d0e2412 | 2013-03-15 03:06:53 +0000 | [diff] [blame] | 380 | self.addCleanup(self.images_client.delete_image_metadata_item, |
| 381 | self.image['id'], 'meta1') |
rajalakshmi-ganesan | 929a32a | 2012-05-29 18:00:25 +0530 | [diff] [blame] | 382 | self.images_client.set_image_metadata(self.image['id'], |
| 383 | req_metadata) |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 384 | self.assertRaises(lib_exc.NotFound, |
hi2suresh | d0e2412 | 2013-03-15 03:06:53 +0000 | [diff] [blame] | 385 | self.alt_images_client.delete_image_metadata_item, |
| 386 | self.image['id'], 'meta1') |
rajalakshmi-ganesan | 72ea31a | 2012-05-25 11:59:10 +0530 | [diff] [blame] | 387 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 388 | @test.attr(type='gate') |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 389 | def test_get_console_output_of_alt_account_server_fails(self): |
Sean Dague | 4dd2c0b | 2013-01-03 17:50:28 -0500 | [diff] [blame] | 390 | # A Get Console Output for another user's server should fail |
Masayuki Igawa | bfa0760 | 2015-01-20 18:47:17 +0900 | [diff] [blame] | 391 | self.assertRaises(lib_exc.NotFound, |
Chris Yeoh | 8b4eaa5 | 2013-02-06 18:03:10 +1030 | [diff] [blame] | 392 | self.alt_client.get_console_output, |
| 393 | self.server['id'], 10) |