blob: 68af81ce969a1814a3191e62ab5035ed78a81a48 [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2012 OpenStack Foundation
Jay Pipes13b479b2012-06-11 14:52:27 -04002# 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.
15
Daryl Walleck6b9b2882012-04-08 21:43:39 -050016import base64
Jay Pipes13b479b2012-06-11 14:52:27 -040017
Mauro S. M. Rodrigues54110362013-02-15 13:14:04 -050018import netaddr
ivan-zhu1feeb382013-01-24 10:14:39 +080019import testtools
Jay Pipes13b479b2012-06-11 14:52:27 -040020
Sean Dague1937d092013-05-17 16:36:38 -040021from tempest.api.compute import base
Fei Long Wangd39431f2015-05-14 11:30:48 +120022from tempest.common.utils import data_utils
Masayuki Igawa209fd502014-02-17 14:46:43 +090023from tempest.common.utils.linux import remote_client
Ken'ichi Ohmichie91a0c62015-08-13 02:09:16 +000024from tempest.common import waiters
Sean Dague86bd8422013-12-20 09:56:44 -050025from tempest import config
Masayuki Igawa209fd502014-02-17 14:46:43 +090026from tempest import test
Daryl Walleck6b9b2882012-04-08 21:43:39 -050027
Sean Dague86bd8422013-12-20 09:56:44 -050028CONF = config.CONF
29
Daryl Walleck6b9b2882012-04-08 21:43:39 -050030
ivan-zhuf2b00502013-10-18 10:06:52 +080031class ServersTestJSON(base.BaseV2ComputeTest):
ivan-zhua5141d92013-03-06 23:12:43 +080032 disk_config = 'AUTO'
Daryl Walleck6b9b2882012-04-08 21:43:39 -050033
Attila Fazekas19044d52013-02-16 07:35:06 +010034 @classmethod
Rohan Kanade60b73092015-02-04 17:58:19 +053035 def setup_credentials(cls):
Attila Fazekas423834d2014-03-14 17:33:13 +010036 cls.prepare_instance_network()
Rohan Kanade60b73092015-02-04 17:58:19 +053037 super(ServersTestJSON, cls).setup_credentials()
38
39 @classmethod
40 def setup_clients(cls):
41 super(ServersTestJSON, cls).setup_clients()
42 cls.client = cls.servers_client
43 cls.network_client = cls.os.network_client
44
45 @classmethod
46 def resource_setup(cls):
nithya-ganesan222efd72015-01-22 12:20:27 +000047 cls.set_validation_resources()
Andrea Frittoli50bb80d2014-09-15 12:34:27 +010048 super(ServersTestJSON, cls).resource_setup()
Daryl Walleck6b9b2882012-04-08 21:43:39 -050049 cls.meta = {'hello': 'world'}
50 cls.accessIPv4 = '1.1.1.1'
Mauro S. M. Rodrigues54110362013-02-15 13:14:04 -050051 cls.accessIPv6 = '0000:0000:0000:0000:0000:babe:220.12.22.2'
Masayuki Igawa259c1132013-10-31 17:48:44 +090052 cls.name = data_utils.rand_name('server')
Daryl Walleck6b9b2882012-04-08 21:43:39 -050053 file_contents = 'This is a test file.'
Pádraig Bradyc6081cf2013-01-04 17:43:53 +000054 personality = [{'path': '/test.txt',
Daryl Walleck6b9b2882012-04-08 21:43:39 -050055 'contents': base64.b64encode(file_contents)}]
David Kranz0fb14292015-02-11 15:55:20 -050056 disk_config = cls.disk_config
Joseph Lanouxb3e1f872015-01-30 11:13:07 +000057 cls.server_initial = cls.create_test_server(
58 validatable=True,
59 wait_until='ACTIVE',
60 name=cls.name,
Ken'ichi Ohmichif2d436e2015-09-03 01:13:16 +000061 metadata=cls.meta,
Joseph Lanouxb3e1f872015-01-30 11:13:07 +000062 accessIPv4=cls.accessIPv4,
63 accessIPv6=cls.accessIPv6,
64 personality=personality,
65 disk_config=disk_config)
Daryl Walleck6b9b2882012-04-08 21:43:39 -050066 cls.password = cls.server_initial['adminPass']
ghanshyam0f825252015-08-25 16:02:50 +090067 cls.server = (cls.client.show_server(cls.server_initial['id'])
68 ['server'])
Daryl Walleck6b9b2882012-04-08 21:43:39 -050069
Matt Riedemann778b5f92015-03-11 12:44:28 -070070 def _create_net_subnet_ret_net_from_cidr(self, cidr):
71 name_net = data_utils.rand_name(self.__class__.__name__)
72 net = self.network_client.create_network(name=name_net)
73 self.addCleanup(self.network_client.delete_network,
74 net['network']['id'])
75
76 subnet = self.network_client.create_subnet(
77 network_id=net['network']['id'],
78 cidr=cidr,
79 ip_version=4)
80 self.addCleanup(self.network_client.delete_subnet,
81 subnet['subnet']['id'])
82 return net
83
Masayuki Igawa209fd502014-02-17 14:46:43 +090084 @test.attr(type='smoke')
Chris Hoge7579c1a2015-02-26 14:12:15 -080085 @test.idempotent_id('5de47127-9977-400a-936f-abcfbec1218f')
Daryl Wallecked97dca2012-07-04 23:25:45 -050086 def test_verify_server_details(self):
Sean Dague4dd2c0b2013-01-03 17:50:28 -050087 # Verify the specified server attributes are set correctly
Daryl Walleck6b9b2882012-04-08 21:43:39 -050088 self.assertEqual(self.accessIPv4, self.server['accessIPv4'])
Mauro S. M. Rodrigues54110362013-02-15 13:14:04 -050089 # NOTE(maurosr): See http://tools.ietf.org/html/rfc5952 (section 4)
90 # Here we compare directly with the canonicalized format.
91 self.assertEqual(self.server['accessIPv6'],
92 str(netaddr.IPAddress(self.accessIPv6)))
Daryl Walleck6b9b2882012-04-08 21:43:39 -050093 self.assertEqual(self.name, self.server['name'])
94 self.assertEqual(self.image_ref, self.server['image']['id'])
Ken'ichi Ohmichi35772602013-11-14 15:03:27 +090095 self.assertEqual(self.flavor_ref, self.server['flavor']['id'])
Daryl Walleck6b9b2882012-04-08 21:43:39 -050096 self.assertEqual(self.meta, self.server['metadata'])
97
Masayuki Igawa209fd502014-02-17 14:46:43 +090098 @test.attr(type='smoke')
Chris Hoge7579c1a2015-02-26 14:12:15 -080099 @test.idempotent_id('9a438d88-10c6-4bcd-8b5b-5b6e25e1346f')
Daryl Wallecked97dca2012-07-04 23:25:45 -0500100 def test_list_servers(self):
Sean Dague4dd2c0b2013-01-03 17:50:28 -0500101 # The created server should be in the list of all servers
David Kranzae99b9a2015-02-16 13:37:01 -0500102 body = self.client.list_servers()
Daryl Wallecked97dca2012-07-04 23:25:45 -0500103 servers = body['servers']
104 found = any([i for i in servers if i['id'] == self.server['id']])
105 self.assertTrue(found)
106
Chris Hoge7579c1a2015-02-26 14:12:15 -0800107 @test.idempotent_id('585e934c-448e-43c4-acbf-d06a9b899997')
Daryl Wallecked97dca2012-07-04 23:25:45 -0500108 def test_list_servers_with_detail(self):
Sean Dague4dd2c0b2013-01-03 17:50:28 -0500109 # The created server should be in the detailed list of all servers
Ken'ichi Ohmichicbc26a82015-07-03 08:18:04 +0000110 body = self.client.list_servers(detail=True)
Daryl Wallecked97dca2012-07-04 23:25:45 -0500111 servers = body['servers']
112 found = any([i for i in servers if i['id'] == self.server['id']])
113 self.assertTrue(found)
114
Chris Hoge7579c1a2015-02-26 14:12:15 -0800115 @test.idempotent_id('cbc0f52f-05aa-492b-bdc1-84b575ca294b')
Matthew Treinishe5cca002015-05-11 15:36:50 -0400116 @testtools.skipUnless(CONF.validation.run_validation,
Matt Riedemann6c668202014-03-24 09:17:10 -0700117 'Instance validation tests are disabled.')
Daryl Walleck6b9b2882012-04-08 21:43:39 -0500118 def test_verify_created_server_vcpus(self):
Sean Dague4dd2c0b2013-01-03 17:50:28 -0500119 # Verify that the number of vcpus reported by the instance matches
120 # the amount stated by the flavor
ghanshyam19973be2015-08-18 15:46:42 +0900121 flavor = self.flavors_client.show_flavor(self.flavor_ref)['flavor']
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000122 linux_client = remote_client.RemoteClient(
123 self.get_server_ip(self.server),
124 self.ssh_user,
125 self.password,
126 self.validation_resources['keypair']['private_key'])
Daryl Walleck6b9b2882012-04-08 21:43:39 -0500127 self.assertEqual(flavor['vcpus'], linux_client.get_number_of_vcpus())
128
Chris Hoge7579c1a2015-02-26 14:12:15 -0800129 @test.idempotent_id('ac1ad47f-984b-4441-9274-c9079b7a0666')
Matthew Treinishe5cca002015-05-11 15:36:50 -0400130 @testtools.skipUnless(CONF.validation.run_validation,
Matt Riedemann6c668202014-03-24 09:17:10 -0700131 'Instance validation tests are disabled.')
Daryl Walleck6b9b2882012-04-08 21:43:39 -0500132 def test_host_name_is_same_as_server_name(self):
Sean Dague4dd2c0b2013-01-03 17:50:28 -0500133 # Verify the instance host name is the same as the server name
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000134 linux_client = remote_client.RemoteClient(
135 self.get_server_ip(self.server),
136 self.ssh_user,
137 self.password,
138 self.validation_resources['keypair']['private_key'])
Daryl Walleck6b9b2882012-04-08 21:43:39 -0500139 self.assertTrue(linux_client.hostname_equals_servername(self.name))
Dan Smith4307f992012-08-16 09:23:20 -0700140
Chris Hoge7579c1a2015-02-26 14:12:15 -0800141 @test.idempotent_id('ed20d3fb-9d1f-4329-b160-543fbd5d9811')
Ken'ichi Ohmichi60a67f72014-05-20 09:19:50 +0900142 def test_create_server_with_scheduler_hint_group(self):
143 # Create a server with the scheduler hint "group".
144 name = data_utils.rand_name('server_group')
145 policies = ['affinity']
Ken'ichi Ohmichi7ca54b82015-07-07 01:10:26 +0000146 body = self.server_groups_client.create_server_group(
ghanshyam2dc13452015-08-24 17:39:25 +0900147 name=name, policies=policies)['server_group']
Ken'ichi Ohmichi60a67f72014-05-20 09:19:50 +0900148 group_id = body['id']
Ken'ichi Ohmichi7ca54b82015-07-07 01:10:26 +0000149 self.addCleanup(self.server_groups_client.delete_server_group,
150 group_id)
Ken'ichi Ohmichi60a67f72014-05-20 09:19:50 +0900151
152 hints = {'group': group_id}
Ken'ichi Ohmichif2d436e2015-09-03 01:13:16 +0000153 server = self.create_test_server(scheduler_hints=hints,
David Kranz0fb14292015-02-11 15:55:20 -0500154 wait_until='ACTIVE')
Ken'ichi Ohmichi60a67f72014-05-20 09:19:50 +0900155
156 # Check a server is in the group
ghanshyam2dc13452015-08-24 17:39:25 +0900157 server_group = (self.server_groups_client.get_server_group(group_id)
158 ['server_group'])
Ken'ichi Ohmichi60a67f72014-05-20 09:19:50 +0900159 self.assertIn(server['id'], server_group['members'])
160
Chris Hoge7579c1a2015-02-26 14:12:15 -0800161 @test.idempotent_id('0578d144-ed74-43f8-8e57-ab10dbf9b3c2')
Joseph Lanoux38edc052014-09-18 14:25:46 +0000162 @testtools.skipUnless(CONF.service_available.neutron,
163 'Neutron service must be available.')
164 def test_verify_multiple_nics_order(self):
165 # Verify that the networks order given at the server creation is
166 # preserved within the server.
Matt Riedemann778b5f92015-03-11 12:44:28 -0700167 net1 = self._create_net_subnet_ret_net_from_cidr('19.80.0.0/24')
168 net2 = self._create_net_subnet_ret_net_from_cidr('19.86.0.0/24')
Joseph Lanoux38edc052014-09-18 14:25:46 +0000169
170 networks = [{'uuid': net1['network']['id']},
171 {'uuid': net2['network']['id']}]
172
David Kranz0fb14292015-02-11 15:55:20 -0500173 server_multi_nics = self.create_test_server(
Joseph Lanoux38edc052014-09-18 14:25:46 +0000174 networks=networks, wait_until='ACTIVE')
175
Joseph Lanouxe59f0ff2014-10-17 14:56:56 +0000176 # Cleanup server; this is needed in the test case because with the LIFO
177 # nature of the cleanups, if we don't delete the server first, the port
178 # will still be part of the subnet and we'll get a 409 from Neutron
179 # when trying to delete the subnet. The tear down in the base class
180 # will try to delete the server and get a 404 but it's ignored so
181 # we're OK.
182 def cleanup_server():
183 self.client.delete_server(server_multi_nics['id'])
Ken'ichi Ohmichie91a0c62015-08-13 02:09:16 +0000184 waiters.wait_for_server_termination(self.client,
185 server_multi_nics['id'])
Joseph Lanouxe59f0ff2014-10-17 14:56:56 +0000186
187 self.addCleanup(cleanup_server)
188
ghanshyam0f825252015-08-25 16:02:50 +0900189 addresses = (self.client.list_addresses(server_multi_nics['id'])
190 ['addresses'])
Joseph Lanoux38edc052014-09-18 14:25:46 +0000191
venkata anilbd2d49a2015-01-16 08:07:15 +0000192 # We can't predict the ip addresses assigned to the server on networks.
193 # Sometimes the assigned addresses are ['19.80.0.2', '19.86.0.2'], at
194 # other times ['19.80.0.3', '19.86.0.3']. So we check if the first
195 # address is in first network, similarly second address is in second
196 # network.
Matt Riedemann778b5f92015-03-11 12:44:28 -0700197 addr = [addresses[net1['network']['name']][0]['addr'],
198 addresses[net2['network']['name']][0]['addr']]
venkata anilbd2d49a2015-01-16 08:07:15 +0000199 networks = [netaddr.IPNetwork('19.80.0.0/24'),
200 netaddr.IPNetwork('19.86.0.0/24')]
201 for address, network in zip(addr, networks):
202 self.assertIn(address, network)
Joseph Lanoux38edc052014-09-18 14:25:46 +0000203
Matt Riedemann778b5f92015-03-11 12:44:28 -0700204 @test.idempotent_id('1678d144-ed74-43f8-8e57-ab10dbf9b3c2')
205 @testtools.skipUnless(CONF.service_available.neutron,
206 'Neutron service must be available.')
207 # The below skipUnless should be removed once Kilo-eol happens.
208 @testtools.skipUnless(CONF.compute_feature_enabled.
209 allow_duplicate_networks,
210 'Duplicate networks must be allowed')
211 def test_verify_duplicate_network_nics(self):
212 # Verify that server creation does not fail when more than one nic
213 # is created on the same network.
214 net1 = self._create_net_subnet_ret_net_from_cidr('19.80.0.0/24')
215 net2 = self._create_net_subnet_ret_net_from_cidr('19.86.0.0/24')
216
217 networks = [{'uuid': net1['network']['id']},
218 {'uuid': net2['network']['id']},
219 {'uuid': net1['network']['id']}]
220
221 server_multi_nics = self.create_test_server(
222 networks=networks, wait_until='ACTIVE')
223
224 def cleanup_server():
225 self.client.delete_server(server_multi_nics['id'])
Ken'ichi Ohmichie91a0c62015-08-13 02:09:16 +0000226 waiters.wait_for_server_termination(self.client,
227 server_multi_nics['id'])
Matt Riedemann778b5f92015-03-11 12:44:28 -0700228
229 self.addCleanup(cleanup_server)
230
ghanshyam0f825252015-08-25 16:02:50 +0900231 addresses = (self.client.list_addresses(server_multi_nics['id'])
232 ['addresses'])
Matt Riedemann778b5f92015-03-11 12:44:28 -0700233
234 addr = [addresses[net1['network']['name']][0]['addr'],
235 addresses[net2['network']['name']][0]['addr'],
236 addresses[net1['network']['name']][1]['addr']]
237 networks = [netaddr.IPNetwork('19.80.0.0/24'),
238 netaddr.IPNetwork('19.86.0.0/24'),
239 netaddr.IPNetwork('19.80.0.0/24')]
240 for address, network in zip(addr, networks):
241 self.assertIn(address, network)
242
Dan Smith4307f992012-08-16 09:23:20 -0700243
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800244class ServersWithSpecificFlavorTestJSON(base.BaseV2ComputeAdminTest):
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800245 disk_config = 'AUTO'
246
247 @classmethod
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000248 def setup_credentials(cls):
Attila Fazekas423834d2014-03-14 17:33:13 +0100249 cls.prepare_instance_network()
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000250 super(ServersWithSpecificFlavorTestJSON, cls).setup_credentials()
251
252 @classmethod
253 def setup_clients(cls):
Rohan Kanade60b73092015-02-04 17:58:19 +0530254 super(ServersWithSpecificFlavorTestJSON, cls).setup_clients()
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800255 cls.flavor_client = cls.os_adm.flavors_client
Attila Fazekas076f79f2014-03-14 17:43:46 +0100256 cls.client = cls.servers_client
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800257
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000258 @classmethod
259 def resource_setup(cls):
260 cls.set_validation_resources()
261
262 super(ServersWithSpecificFlavorTestJSON, cls).resource_setup()
263
Chris Hoge7579c1a2015-02-26 14:12:15 -0800264 @test.idempotent_id('b3c7bcfc-bb5b-4e22-b517-c7f686b802ca')
Matthew Treinishe5cca002015-05-11 15:36:50 -0400265 @testtools.skipUnless(CONF.validation.run_validation,
Matt Riedemann6c668202014-03-24 09:17:10 -0700266 'Instance validation tests are disabled.')
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800267 def test_verify_created_server_ephemeral_disk(self):
268 # Verify that the ephemeral disk is created when creating server
269
Attila Fazekas076f79f2014-03-14 17:43:46 +0100270 def create_flavor_with_extra_specs():
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800271 flavor_with_eph_disk_name = data_utils.rand_name('eph_flavor')
272 flavor_with_eph_disk_id = data_utils.rand_int_id(start=1000)
273 ram = 64
274 vcpus = 1
275 disk = 0
276
277 # Create a flavor with extra specs
David Kranz2fa77b22015-02-09 11:39:50 -0500278 flavor = (self.flavor_client.
Ken'ichi Ohmichi96338c42015-07-17 06:25:14 +0000279 create_flavor(name=flavor_with_eph_disk_name,
280 ram=ram, vcpus=vcpus, disk=disk,
281 id=flavor_with_eph_disk_id,
ghanshyam19973be2015-08-18 15:46:42 +0900282 ephemeral=1))['flavor']
Attila Fazekas076f79f2014-03-14 17:43:46 +0100283 self.addCleanup(flavor_clean_up, flavor['id'])
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800284
285 return flavor['id']
286
Attila Fazekas076f79f2014-03-14 17:43:46 +0100287 def create_flavor_without_extra_specs():
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800288 flavor_no_eph_disk_name = data_utils.rand_name('no_eph_flavor')
289 flavor_no_eph_disk_id = data_utils.rand_int_id(start=1000)
290
291 ram = 64
292 vcpus = 1
293 disk = 0
294
295 # Create a flavor without extra specs
David Kranz2fa77b22015-02-09 11:39:50 -0500296 flavor = (self.flavor_client.
Ken'ichi Ohmichi96338c42015-07-17 06:25:14 +0000297 create_flavor(name=flavor_no_eph_disk_name,
298 ram=ram, vcpus=vcpus, disk=disk,
ghanshyam19973be2015-08-18 15:46:42 +0900299 id=flavor_no_eph_disk_id))['flavor']
Attila Fazekas076f79f2014-03-14 17:43:46 +0100300 self.addCleanup(flavor_clean_up, flavor['id'])
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800301
302 return flavor['id']
303
Attila Fazekas076f79f2014-03-14 17:43:46 +0100304 def flavor_clean_up(flavor_id):
David Kranz2fa77b22015-02-09 11:39:50 -0500305 self.flavor_client.delete_flavor(flavor_id)
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800306 self.flavor_client.wait_for_resource_deletion(flavor_id)
307
Attila Fazekas076f79f2014-03-14 17:43:46 +0100308 flavor_with_eph_disk_id = create_flavor_with_extra_specs()
309 flavor_no_eph_disk_id = create_flavor_without_extra_specs()
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800310
311 admin_pass = self.image_ssh_password
312
Ken'ichi Ohmichie1dc9912015-08-27 09:06:26 +0000313 server_no_eph_disk = self.create_test_server(
314 validatable=True,
315 wait_until='ACTIVE',
316 adminPass=admin_pass,
317 flavor=flavor_no_eph_disk_id)
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000318
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800319 # Get partition number of server without extra specs.
Ken'ichi Ohmichi76800242015-07-03 05:12:31 +0000320 server_no_eph_disk = self.client.show_server(
ghanshyam0f825252015-08-25 16:02:50 +0900321 server_no_eph_disk['id'])['server']
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000322 linux_client = remote_client.RemoteClient(
323 self.get_server_ip(server_no_eph_disk),
324 self.ssh_user,
325 admin_pass,
326 self.validation_resources['keypair']['private_key'])
Attila Fazekas076f79f2014-03-14 17:43:46 +0100327 partition_num = len(linux_client.get_partitions().split('\n'))
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800328
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000329 # Explicit server deletion necessary for Juno compatibility
330 self.client.delete_server(server_no_eph_disk['id'])
331
Ken'ichi Ohmichie1dc9912015-08-27 09:06:26 +0000332 server_with_eph_disk = self.create_test_server(
333 validatable=True,
334 wait_until='ACTIVE',
335 adminPass=admin_pass,
336 flavor=flavor_with_eph_disk_id)
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000337
Ken'ichi Ohmichi76800242015-07-03 05:12:31 +0000338 server_with_eph_disk = self.client.show_server(
ghanshyam0f825252015-08-25 16:02:50 +0900339 server_with_eph_disk['id'])['server']
Joseph Lanouxffe09dd2015-03-18 16:45:33 +0000340 linux_client = remote_client.RemoteClient(
341 self.get_server_ip(server_with_eph_disk),
342 self.ssh_user,
343 admin_pass,
344 self.validation_resources['keypair']['private_key'])
Attila Fazekas076f79f2014-03-14 17:43:46 +0100345 partition_num_emph = len(linux_client.get_partitions().split('\n'))
346 self.assertEqual(partition_num + 1, partition_num_emph)
Chang Bo Guoedd6ec02013-12-12 23:53:09 -0800347
348
Attila Fazekas19044d52013-02-16 07:35:06 +0100349class ServersTestManualDisk(ServersTestJSON):
350 disk_config = 'MANUAL'
351
Daryl Walleck0aea0032012-12-04 00:53:28 -0600352 @classmethod
Rohan Kanade60b73092015-02-04 17:58:19 +0530353 def skip_checks(cls):
354 super(ServersTestManualDisk, cls).skip_checks()
Sean Dague86bd8422013-12-20 09:56:44 -0500355 if not CONF.compute_feature_enabled.disk_config:
Daryl Walleck0aea0032012-12-04 00:53:28 -0600356 msg = "DiskConfig extension not enabled."
ivan-zhu1feeb382013-01-24 10:14:39 +0800357 raise cls.skipException(msg)