Browse Source

Remove intree ec2-api tempest tests

ec2-api jobs have been switched to use
ec2api-tempest-plugin for ec2-api tests, so
we can remove the in-tree tempest tests now.

Change-Id: I82ace9ebd1ca5216c2e3fc3d75f07146417ebf94
tags/7.0.0
ghanshyam 1 year ago
parent
commit
f5983d7cdc
52 changed files with 5 additions and 10874 deletions
  1. 0
    0
      ec2api/tests/botocoreclient.py
  2. 0
    0
      ec2api/tests/functional/__init__.py
  3. 0
    0
      ec2api/tests/functional/api/__init__.py
  4. 0
    436
      ec2api/tests/functional/api/test_addresses.py
  5. 0
    57
      ec2api/tests/functional/api/test_customer_gateways.py
  6. 0
    182
      ec2api/tests/functional/api/test_dhcp_options.py
  7. 0
    359
      ec2api/tests/functional/api/test_images.py
  8. 0
    365
      ec2api/tests/functional/api/test_instance_attributes.py
  9. 0
    252
      ec2api/tests/functional/api/test_instances.py
  10. 0
    92
      ec2api/tests/functional/api/test_instances_ebs.py
  11. 0
    282
      ec2api/tests/functional/api/test_instances_vpc.py
  12. 0
    223
      ec2api/tests/functional/api/test_internet_gateways.py
  13. 0
    149
      ec2api/tests/functional/api/test_key_pairs.py
  14. 0
    582
      ec2api/tests/functional/api/test_network_interfaces.py
  15. 0
    47
      ec2api/tests/functional/api/test_regions.py
  16. 0
    338
      ec2api/tests/functional/api/test_routes.py
  17. 0
    324
      ec2api/tests/functional/api/test_security_groups.py
  18. 0
    267
      ec2api/tests/functional/api/test_snapshots.py
  19. 0
    191
      ec2api/tests/functional/api/test_subnets.py
  20. 0
    509
      ec2api/tests/functional/api/test_tags.py
  21. 0
    411
      ec2api/tests/functional/api/test_volumes.py
  22. 0
    208
      ec2api/tests/functional/api/test_vpcs.py
  23. 0
    113
      ec2api/tests/functional/api/test_vpn_connections.py
  24. 0
    93
      ec2api/tests/functional/api/test_vpn_gateways.py
  25. 0
    888
      ec2api/tests/functional/base.py
  26. 0
    89
      ec2api/tests/functional/config.py
  27. 0
    96
      ec2api/tests/functional/config_opts.py
  28. 0
    86
      ec2api/tests/functional/obsolete/base.py
  29. 0
    361
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/base.py
  30. 0
    225
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_instance_mysql.py
  31. 0
    110
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_unixbench.py
  32. 0
    250
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_ec2_volume_benchmark.py
  33. 0
    297
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_behavior.py
  34. 0
    188
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_benchmark.py
  35. 0
    451
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_nat_scenario.py
  36. 0
    379
      ec2api/tests/functional/obsolete/thirdparty/scenario/aws_compat/test_vpc_scenario.py
  37. 0
    35
      ec2api/tests/functional/obsolete/utils.py
  38. 0
    52
      ec2api/tests/functional/plugin.py
  39. 0
    0
      ec2api/tests/functional/scenario/__init__.py
  40. 0
    135
      ec2api/tests/functional/scenario/base.py
  41. 0
    455
      ec2api/tests/functional/scenario/test_ebs_instances.py
  42. 0
    95
      ec2api/tests/functional/scenario/test_instance_restart.py
  43. 0
    180
      ec2api/tests/functional/scenario/test_instances.py
  44. 0
    170
      ec2api/tests/functional/scenario/test_instances_in_vpc.py
  45. 0
    410
      ec2api/tests/functional/scenario/test_paging.py
  46. 0
    157
      ec2api/tests/functional/scenario/test_vpc_addresses.py
  47. 0
    278
      ec2api/tests/functional/scenario/test_vpn.py
  48. 1
    1
      rally-scenarios/plugins/context_plugin_ec2_objects.py
  49. 1
    1
      rally-scenarios/plugins/context_plugin_images.py
  50. 2
    1
      rally-scenarios/plugins/ec2api_plugin.py
  51. 0
    3
      setup.cfg
  52. 1
    1
      tox.ini

ec2api/tests/functional/botocoreclient.py → ec2api/tests/botocoreclient.py View File


+ 0
- 0
ec2api/tests/functional/__init__.py View File


+ 0
- 0
ec2api/tests/functional/api/__init__.py View File


+ 0
- 436
ec2api/tests/functional/api/test_addresses.py View File

@@ -1,436 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-import time
17
-
18
-import botocore.exceptions
19
-from oslo_log import log
20
-from tempest.lib import decorators
21
-import testtools
22
-
23
-from ec2api.tests.functional import base
24
-from ec2api.tests.functional import config
25
-
26
-CONF = config.CONF
27
-LOG = log.getLogger(__name__)
28
-
29
-
30
-class AddressTest(base.EC2TestCase):
31
-
32
-    @base.skip_without_vpc()
33
-    @decorators.idempotent_id('218a4b6b-c3a9-44b0-8148-4bd0bc36bd7d')
34
-    def test_create_delete_vpc_address(self):
35
-        kwargs = {
36
-            'Domain': 'vpc',
37
-        }
38
-        data = self.client.allocate_address(*[], **kwargs)
39
-        id = data['AllocationId']
40
-        res_clean = self.addResourceCleanUp(self.client.release_address,
41
-                                            AllocationId=id)
42
-        self.assertEqual('vpc', data['Domain'])
43
-
44
-        data = self.client.release_address(AllocationId=id)
45
-        self.cancelResourceCleanUp(res_clean)
46
-
47
-    @base.skip_without_ec2()
48
-    @decorators.idempotent_id('285b8b4e-5aef-4e7f-be9e-37e6475be21b')
49
-    def test_create_delete_standard_address(self):
50
-        data = self.client.allocate_address()
51
-        ip = data['PublicIp']
52
-        res_clean = self.addResourceCleanUp(self.client.release_address,
53
-                                            PublicIp=ip)
54
-
55
-        data = self.client.release_address(PublicIp=ip)
56
-        self.cancelResourceCleanUp(res_clean)
57
-
58
-    @base.skip_without_vpc()
59
-    @decorators.idempotent_id('5be3ad8d-b071-472b-b92a-7199c82334a2')
60
-    def test_invalid_delete_vpc_address(self):
61
-        kwargs = {
62
-            'Domain': 'vpc',
63
-        }
64
-        data = self.client.allocate_address(*[], **kwargs)
65
-        ip = data['PublicIp']
66
-        id = data['AllocationId']
67
-        res_clean = self.addResourceCleanUp(self.client.release_address,
68
-                                            AllocationId=id)
69
-        self.assertEqual('vpc', data['Domain'])
70
-
71
-        self.assertRaises('InvalidParameterCombination',
72
-            self.client.release_address,
73
-            PublicIp=ip, AllocationId=id)
74
-
75
-        self.assertRaises('InvalidParameterValue',
76
-            self.client.release_address,
77
-            PublicIp=ip)
78
-
79
-        data = self.client.release_address(AllocationId=id)
80
-        self.cancelResourceCleanUp(res_clean)
81
-
82
-        if CONF.aws.run_incompatible_tests:
83
-            self.assertRaises('AuthFailure',
84
-                self.client.release_address,
85
-                PublicIp=ip)
86
-
87
-        self.assertRaises('InvalidAllocationID.NotFound',
88
-            self.client.release_address,
89
-            AllocationId=id)
90
-
91
-        kwargs = {
92
-            "AllocationId": 'eipalloc-00000000',
93
-        }
94
-        self.assertRaises('InvalidAllocationID.NotFound',
95
-            self.client.release_address,
96
-            **kwargs)
97
-
98
-        if CONF.aws.run_incompatible_tests:
99
-            self.assertRaises('InvalidParameterValue',
100
-                self.client.release_address,
101
-                PublicIp='ip')
102
-
103
-    @decorators.idempotent_id('e8171637-9ccd-471a-97da-c78a36ba3c4b')
104
-    def test_invalid_create_address(self):
105
-        kwargs = {
106
-            'Domain': 'invalid',
107
-        }
108
-        try:
109
-            data = self.client.allocate_address(*[], **kwargs)
110
-            allocation_id = data.get('AllocationId')
111
-            if allocation_id:
112
-                self.client.release_address(AllocationId=allocation_id)
113
-            else:
114
-                public_ip = data.get('PublicIp')
115
-                self.client.release_address(PublicIp=public_ip)
116
-        except botocore.exceptions.ClientError as e:
117
-            self.assertEqual('InvalidParameterValue',
118
-                             e.response['Error']['Code'])
119
-
120
-    @base.skip_without_vpc()
121
-    @decorators.idempotent_id('b0d0b498-1fe2-479e-995c-80ace2f339a7')
122
-    def test_describe_vpc_addresses(self):
123
-        kwargs = {
124
-            'Domain': 'vpc',
125
-        }
126
-        data = self.client.allocate_address(*[], **kwargs)
127
-        ip = data['PublicIp']
128
-        id = data['AllocationId']
129
-        res_clean = self.addResourceCleanUp(self.client.release_address,
130
-                                            AllocationId=id)
131
-
132
-        data = self.client.describe_addresses(*[], **{})
133
-        for address in data['Addresses']:
134
-            if address.get('AllocationId') == id:
135
-                self.assertEqual('vpc', address['Domain'])
136
-                self.assertEqual(ip, address['PublicIp'])
137
-                break
138
-        else:
139
-            self.fail('Created address could not be found')
140
-
141
-        kwargs = {
142
-            'PublicIps': [ip],
143
-        }
144
-        data = self.client.describe_addresses(*[], **kwargs)
145
-        self.assertEqual(1, len(data['Addresses']))
146
-        self.assertEqual(id, data['Addresses'][0]['AllocationId'])
147
-
148
-        kwargs = {
149
-            'AllocationIds': [id],
150
-        }
151
-        data = self.client.describe_addresses(*[], **kwargs)
152
-        self.assertEqual(1, len(data['Addresses']))
153
-        self.assertEqual(ip, data['Addresses'][0]['PublicIp'])
154
-
155
-        kwargs = {
156
-            'PublicIps': ['invalidIp'],
157
-        }
158
-        self.assertRaises('InvalidParameterValue',
159
-            self.client.describe_addresses,
160
-            **kwargs)
161
-
162
-        kwargs = {
163
-            'AllocationIds': ['eipalloc-00000000'],
164
-        }
165
-        self.assertRaises('InvalidAllocationID.NotFound',
166
-            self.client.describe_addresses,
167
-            **kwargs)
168
-
169
-        kwargs = {
170
-            'Domain': 'vpc',
171
-        }
172
-        data = self.client.allocate_address(*[], **kwargs)
173
-        id2 = data['AllocationId']
174
-        res_clean2 = self.addResourceCleanUp(self.client.release_address,
175
-                                             AllocationId=id2)
176
-
177
-        kwargs = {
178
-            'PublicIps': [ip],
179
-            'AllocationIds': [id2],
180
-        }
181
-        data = self.client.describe_addresses(*[], **kwargs)
182
-        self.assertEqual(2, len(data['Addresses']))
183
-
184
-        # NOTE(andrey-mp): wait abit before releasing
185
-        time.sleep(3)
186
-
187
-        self.client.release_address(AllocationId=id)
188
-        self.cancelResourceCleanUp(res_clean)
189
-
190
-        self.client.release_address(AllocationId=id2)
191
-        self.cancelResourceCleanUp(res_clean2)
192
-
193
-    @base.skip_without_ec2()
194
-    @decorators.idempotent_id('a5c09f47-3be3-4d46-b59d-25195d67e6d5')
195
-    def test_describe_standard_addresses(self):
196
-        data = self.client.allocate_address(*[], **{})
197
-        ip = data['PublicIp']
198
-        res_clean = self.addResourceCleanUp(self.client.release_address,
199
-                                            PublicIp=ip)
200
-
201
-        data = self.client.describe_addresses(*[], **{})
202
-        for address in data['Addresses']:
203
-            if address['PublicIp'] == ip:
204
-                self.assertEqual('standard', address['Domain'])
205
-                break
206
-        else:
207
-            self.fail('Created address could not be found')
208
-
209
-        kwargs = {
210
-            'PublicIps': [ip],
211
-        }
212
-        data = self.client.describe_addresses(*[], **kwargs)
213
-        self.assertEqual(1, len(data['Addresses']))
214
-        self.assertEqual(ip, data['Addresses'][0]['PublicIp'])
215
-
216
-        kwargs = {
217
-            'PublicIps': ['invalidIp'],
218
-        }
219
-        self.assertRaises('InvalidParameterValue',
220
-            self.client.describe_addresses,
221
-            PublicIps=['invalidIp'])
222
-
223
-        # NOTE(andrey-mp): wait abit before releasing
224
-        time.sleep(3)
225
-
226
-        self.client.release_address(PublicIp=ip)
227
-        self.cancelResourceCleanUp(res_clean)
228
-
229
-    @base.skip_without_vpc()
230
-    @decorators.idempotent_id('6f154e48-f260-4d8d-b1d1-a1cf174f58fa')
231
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
232
-    def test_associate_disassociate_vpc_addresses(self):
233
-        aws_zone = CONF.aws.aws_zone
234
-
235
-        base_net = '10.3.0.0'
236
-        data = self.client.create_vpc(CidrBlock=base_net + '/20')
237
-        vpc_id = data['Vpc']['VpcId']
238
-        clean_vpc = self.addResourceCleanUp(self.client.delete_vpc,
239
-                                            VpcId=vpc_id)
240
-        self.get_vpc_waiter().wait_available(vpc_id)
241
-
242
-        cidr = base_net + '/24'
243
-        data = self.client.create_subnet(VpcId=vpc_id, CidrBlock=cidr,
244
-                                         AvailabilityZone=aws_zone)
245
-        subnet_id = data['Subnet']['SubnetId']
246
-        clean_subnet = self.addResourceCleanUp(self.client.delete_subnet,
247
-                                               SubnetId=subnet_id)
248
-
249
-        instance_id = self.run_instance(SubnetId=subnet_id)
250
-
251
-        data = self.client.allocate_address(Domain='vpc')
252
-        alloc_id = data['AllocationId']
253
-        clean_a = self.addResourceCleanUp(self.client.release_address,
254
-                                          AllocationId=alloc_id)
255
-
256
-        self.assertRaises('Gateway.NotAttached',
257
-            self.client.associate_address,
258
-            InstanceId=instance_id, AllocationId=alloc_id)
259
-
260
-        # Create internet gateway and try to associate again
261
-        data = self.client.create_internet_gateway()
262
-        gw_id = data['InternetGateway']['InternetGatewayId']
263
-        clean_ig = self.addResourceCleanUp(self.client.delete_internet_gateway,
264
-                                           InternetGatewayId=gw_id)
265
-        data = self.client.attach_internet_gateway(VpcId=vpc_id,
266
-                                                   InternetGatewayId=gw_id)
267
-        clean_aig = self.addResourceCleanUp(
268
-            self.client.detach_internet_gateway,
269
-            VpcId=vpc_id,
270
-            InternetGatewayId=gw_id)
271
-
272
-        self.prepare_route(vpc_id, gw_id)
273
-
274
-        data = self.client.associate_address(InstanceId=instance_id,
275
-                                             AllocationId=alloc_id)
276
-        assoc_id = data['AssociationId']
277
-        clean_aa = self.addResourceCleanUp(self.client.disassociate_address,
278
-                                           AssociationId=assoc_id)
279
-        self.get_address_assoc_waiter().wait_available(
280
-            {'AllocationId': alloc_id})
281
-
282
-        kwargs = {
283
-            'AllocationIds': [alloc_id],
284
-        }
285
-        data = self.client.describe_addresses(*[], **kwargs)
286
-        self.assertEqual(instance_id, data['Addresses'][0]['InstanceId'])
287
-
288
-        data = self.client.disassociate_address(AssociationId=assoc_id)
289
-        self.cancelResourceCleanUp(clean_aa)
290
-        self.get_address_assoc_waiter().wait_delete({'AllocationId': alloc_id})
291
-
292
-        # NOTE(andrey-mp): cleanup
293
-        time.sleep(3)
294
-
295
-        self.client.detach_internet_gateway(VpcId=vpc_id,
296
-                                            InternetGatewayId=gw_id)
297
-        self.cancelResourceCleanUp(clean_aig)
298
-
299
-        self.client.delete_internet_gateway(InternetGatewayId=gw_id)
300
-        self.cancelResourceCleanUp(clean_ig)
301
-
302
-        self.client.release_address(AllocationId=alloc_id)
303
-        self.cancelResourceCleanUp(clean_a)
304
-
305
-        self.client.terminate_instances(InstanceIds=[instance_id])
306
-        self.get_instance_waiter().wait_delete(instance_id)
307
-
308
-        self.client.delete_subnet(SubnetId=subnet_id)
309
-        self.cancelResourceCleanUp(clean_subnet)
310
-        self.get_subnet_waiter().wait_delete(subnet_id)
311
-
312
-        self.client.delete_vpc(VpcId=vpc_id)
313
-        self.cancelResourceCleanUp(clean_vpc)
314
-        self.get_vpc_waiter().wait_delete(vpc_id)
315
-
316
-    @decorators.idempotent_id('4aaf01d2-ade5-4e8b-b24a-ab22448b3236')
317
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
318
-    # skip this test for nova network due to bug #1607350
319
-    @base.skip_without_vpc()
320
-    # this is a correct skip
321
-    @base.skip_without_ec2()
322
-    def test_associate_disassociate_standard_addresses(self):
323
-        instance_id = self.run_instance()
324
-
325
-        data = self.client.allocate_address(*[], **{})
326
-        ip = data['PublicIp']
327
-        clean_a = self.addResourceCleanUp(self.client.release_address,
328
-                                          PublicIp=ip)
329
-
330
-        data = self.client.associate_address(InstanceId=instance_id,
331
-                                             PublicIp=ip)
332
-        clean_aa = self.addResourceCleanUp(self.client.disassociate_address,
333
-                                           PublicIp=ip)
334
-        self.get_address_assoc_waiter().wait_available({'PublicIp': ip})
335
-
336
-        kwargs = {
337
-            'PublicIps': [ip],
338
-        }
339
-        data = self.client.describe_addresses(*[], **kwargs)
340
-        self.assertEqual(instance_id, data['Addresses'][0]['InstanceId'])
341
-
342
-        data = self.client.disassociate_address(PublicIp=ip)
343
-        self.cancelResourceCleanUp(clean_aa)
344
-        self.get_address_assoc_waiter().wait_delete({'PublicIp': ip})
345
-
346
-        time.sleep(3)
347
-
348
-        data = self.client.release_address(PublicIp=ip)
349
-        self.cancelResourceCleanUp(clean_a)
350
-
351
-        data = self.client.terminate_instances(InstanceIds=[instance_id])
352
-        self.get_instance_waiter().wait_delete(instance_id)
353
-
354
-    @base.skip_without_vpc()
355
-    @decorators.idempotent_id('3c0ab7f5-ee9c-4966-8d43-e89f5520f245')
356
-    def test_disassociate_not_associated_vpc_addresses(self):
357
-        aws_zone = CONF.aws.aws_zone
358
-
359
-        base_net = '10.3.0.0'
360
-        data = self.client.create_vpc(CidrBlock=base_net + '/20')
361
-        vpc_id = data['Vpc']['VpcId']
362
-        clean_vpc = self.addResourceCleanUp(self.client.delete_vpc,
363
-                                            VpcId=vpc_id)
364
-        self.get_vpc_waiter().wait_available(vpc_id)
365
-
366
-        cidr = base_net + '/24'
367
-        data = self.client.create_subnet(VpcId=vpc_id, CidrBlock=cidr,
368
-                                              AvailabilityZone=aws_zone)
369
-        subnet_id = data['Subnet']['SubnetId']
370
-        clean_subnet = self.addResourceCleanUp(self.client.delete_subnet,
371
-                                               SubnetId=subnet_id)
372
-
373
-        data = self.client.allocate_address(Domain='vpc')
374
-        alloc_id = data['AllocationId']
375
-        ip = data['PublicIp']
376
-        clean_a = self.addResourceCleanUp(self.client.release_address,
377
-                                          AllocationId=alloc_id)
378
-
379
-        assoc_id = 'eipassoc-00000001'
380
-        self.assertRaises('InvalidAssociationID.NotFound',
381
-            self.client.disassociate_address,
382
-            AssociationId=assoc_id)
383
-
384
-        self.assertRaises('InvalidParameterValue',
385
-            self.client.disassociate_address,
386
-            PublicIp=ip)
387
-
388
-        self.client.release_address(AllocationId=alloc_id)
389
-        self.cancelResourceCleanUp(clean_a)
390
-
391
-        self.client.delete_subnet(SubnetId=subnet_id)
392
-        self.cancelResourceCleanUp(clean_subnet)
393
-        self.get_subnet_waiter().wait_delete(subnet_id)
394
-
395
-        self.client.delete_vpc(VpcId=vpc_id)
396
-        self.cancelResourceCleanUp(clean_vpc)
397
-        self.get_vpc_waiter().wait_delete(vpc_id)
398
-
399
-    @base.skip_without_ec2()
400
-    @decorators.idempotent_id('a70babef-18ec-4340-a3a2-63388cfc3cb5')
401
-    def test_disassociate_not_associated_standard_addresses(self):
402
-        data = self.client.allocate_address(Domain='standard')
403
-        ip = data['PublicIp']
404
-        clean_a = self.addResourceCleanUp(self.client.release_address,
405
-                                          PublicIp=ip)
406
-
407
-        data = self.client.disassociate_address(PublicIp=ip)
408
-
409
-        data = self.client.release_address(PublicIp=ip)
410
-        self.cancelResourceCleanUp(clean_a)
411
-
412
-    @base.skip_without_vpc()
413
-    @decorators.idempotent_id('91b971f5-2674-478e-84df-115fef506c5b')
414
-    @testtools.skipUnless(CONF.aws.run_incompatible_tests,
415
-                          'preliminary address association is not supported')
416
-    def test_preliminary_associate_address(self):
417
-        # NOTE(ft): AWS can associate an address to a subnet IP if the subnet
418
-        # has no internet access
419
-        vpc_id, subnet_id = self.create_vpc_and_subnet('10.3.0.0/20')
420
-        self.create_and_attach_internet_gateway(vpc_id)
421
-        data = self.client.allocate_address(Domain='vpc')
422
-        alloc_id = data['AllocationId']
423
-        self.addResourceCleanUp(self.client.release_address,
424
-                                AllocationId=alloc_id)
425
-
426
-        data = self.client.create_network_interface(SubnetId=subnet_id)
427
-        ni_id = data['NetworkInterface']['NetworkInterfaceId']
428
-        self.addResourceCleanUp(self.client.delete_network_interface,
429
-                                NetworkInterfaceId=ni_id)
430
-        self.get_network_interface_waiter().wait_available(ni_id)
431
-
432
-        data = self.client.associate_address(
433
-            AllocationId=alloc_id, NetworkInterfaceId=ni_id)
434
-        assoc_id = data['AssociationId']
435
-        self.addResourceCleanUp(self.client.disassociate_address,
436
-                                AssociationId=assoc_id)

+ 0
- 57
ec2api/tests/functional/api/test_customer_gateways.py View File

@@ -1,57 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-import botocore.exceptions
17
-from tempest.lib import decorators
18
-
19
-from ec2api.tests.functional import base
20
-from ec2api.tests.functional import config
21
-
22
-CONF = config.CONF
23
-
24
-
25
-class CustomerGatewayTest(base.EC2TestCase):
26
-
27
-    CUSTOMER_GATEWAY_IP = '198.51.100.77'
28
-
29
-    @classmethod
30
-    @base.safe_setup
31
-    def setUpClass(cls):
32
-        super(CustomerGatewayTest, cls).setUpClass()
33
-        if not base.TesterStateHolder().get_vpc_enabled():
34
-            raise cls.skipException('VPC is disabled')
35
-        base.check_network_feature_enabled('vpnaas')
36
-
37
-    @decorators.idempotent_id('54a40b66-1675-44b1-938d-0cad2eb6afe4')
38
-    def test_create_delete_customer_gateway(self):
39
-        data = self.client.create_customer_gateway(
40
-            Type='ipsec.1', PublicIp=self.CUSTOMER_GATEWAY_IP, BgpAsn=65000)
41
-        cgw_id = data['CustomerGateway']['CustomerGatewayId']
42
-        cgw_clean = self.addResourceCleanUp(
43
-            self.client.delete_customer_gateway, CustomerGatewayId=cgw_id)
44
-        self.assertEqual(self.CUSTOMER_GATEWAY_IP,
45
-                         data['CustomerGateway']['IpAddress'])
46
-
47
-        self.client.delete_customer_gateway(CustomerGatewayId=cgw_id)
48
-        self.cancelResourceCleanUp(cgw_clean)
49
-
50
-        try:
51
-            data = self.client.describe_customer_gateways(
52
-                CustomerGatewayIds=[cgw_id])
53
-            self.assertEqual(1, len(data['CustomerGateways']))
54
-            self.assertEqual('deleted', data['CustomerGateways'][0]['State'])
55
-        except botocore.exceptions.ClientError as ex:
56
-            self.assertEqual('InvalidCustomerGatewayID.NotFound',
57
-                             ex.response['Error']['Code'])

+ 0
- 182
ec2api/tests/functional/api/test_dhcp_options.py View File

@@ -1,182 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-import time
17
-
18
-from oslo_log import log
19
-from tempest.lib import decorators
20
-
21
-from ec2api.tests.functional import base
22
-from ec2api.tests.functional import config
23
-
24
-CONF = config.CONF
25
-LOG = log.getLogger(__name__)
26
-
27
-
28
-class DhcpOptionsTest(base.EC2TestCase):
29
-
30
-    @classmethod
31
-    @base.safe_setup
32
-    def setUpClass(cls):
33
-        super(DhcpOptionsTest, cls).setUpClass()
34
-        if not base.TesterStateHolder().get_vpc_enabled():
35
-            raise cls.skipException('VPC is disabled')
36
-
37
-    @decorators.idempotent_id('2331fc49-50e0-4df3-8c45-bd6f61cc86bf')
38
-    def test_create_delete_dhcp_options(self):
39
-        kwargs = {
40
-            'DhcpConfigurations': [
41
-                {'Key': 'domain-name',
42
-                 'Values': ['my.com', 'it.com']},
43
-                {'Key': 'domain-name-servers',
44
-                 'Values': ['8.8.8.8', '8.8.4.4']},
45
-                {'Key': 'ntp-servers',
46
-                 'Values': ['1.2.3.4']},
47
-                {'Key': 'netbios-name-servers',
48
-                 'Values': ['4.3.2.1']},
49
-                {'Key': 'netbios-node-type',
50
-                 'Values': ['2']},
51
-            ],
52
-        }
53
-        data = self.client.create_dhcp_options(*[], **kwargs)
54
-        options = data['DhcpOptions']
55
-        id = options['DhcpOptionsId']
56
-        res_clean = self.addResourceCleanUp(self.client.delete_dhcp_options,
57
-                                            DhcpOptionsId=id)
58
-        self.assertEqual(5, len(options['DhcpConfigurations']))
59
-        for cfg in options['DhcpConfigurations']:
60
-            self.assertEqual(2, len(cfg))
61
-            if cfg['Key'] == 'domain-name':
62
-                self.assertEqual(2, len(cfg['Values']))
63
-                values = [i['Value'] for i in cfg['Values']]
64
-                self.assertIn('my.com', values)
65
-                self.assertIn('it.com', values)
66
-            elif cfg['Key'] == 'domain-name-servers':
67
-                self.assertEqual(2, len(cfg['Values']))
68
-                values = [i['Value'] for i in cfg['Values']]
69
-                self.assertIn('8.8.8.8', values)
70
-                self.assertIn('8.8.4.4', values)
71
-            elif cfg['Key'] == 'ntp-servers':
72
-                self.assertEqual(1, len(cfg['Values']))
73
-                self.assertEqual('1.2.3.4', cfg['Values'][0]['Value'])
74
-            elif cfg['Key'] == 'netbios-name-servers':
75
-                self.assertEqual(1, len(cfg['Values']))
76
-                self.assertEqual('4.3.2.1', cfg['Values'][0]['Value'])
77
-            elif cfg['Key'] == 'netbios-node-type':
78
-                self.assertEqual(1, len(cfg['Values']))
79
-                self.assertEqual('2', cfg['Values'][0]['Value'])
80
-            else:
81
-                self.fail('Unknown key name in result - %s' % cfg['Key'])
82
-
83
-        data = self.client.delete_dhcp_options(DhcpOptionsId=id)
84
-        self.cancelResourceCleanUp(res_clean)
85
-
86
-    @decorators.idempotent_id('ff1d4f6e-97fc-4053-b98f-ff59e7e8d061')
87
-    def test_invalid_create_delete(self):
88
-        def _rollback(fn_data):
89
-            self.client.delete_dhcp_options(
90
-                DhcpOptionsId=fn_data['DhcpOptions']['DhcpOptionsId'])
91
-
92
-        kwargs = {
93
-            'DhcpConfigurations': [
94
-            ],
95
-        }
96
-        self.assertRaises('MissingParameter',
97
-                          self.client.create_dhcp_options,
98
-                          **kwargs)
99
-
100
-        kwargs = {
101
-            'DhcpConfigurations': [{'Key': 'aaa', 'Values': []}],
102
-        }
103
-        self.assertRaises('InvalidParameterValue',
104
-            self.client.create_dhcp_options, rollback_fn=_rollback,
105
-            **kwargs)
106
-
107
-        kwargs = {
108
-            'DhcpConfigurations': [{'Key': 'domain-name', 'Values': []}],
109
-        }
110
-        self.assertRaises('InvalidParameterValue',
111
-            self.client.create_dhcp_options, rollback_fn=_rollback,
112
-            **kwargs)
113
-
114
-    @decorators.idempotent_id('1c3e8ff9-bb3b-40ba-889e-d2306a92f418')
115
-    def test_describe_dhcp_options(self):
116
-        kwargs = {
117
-            'DhcpConfigurations': [
118
-                {'Key': 'domain-name',
119
-                 'Values': ['my.com']},
120
-            ],
121
-        }
122
-        data = self.client.create_dhcp_options(*[], **kwargs)
123
-        options = data['DhcpOptions']
124
-        id = options['DhcpOptionsId']
125
-        res_clean = self.addResourceCleanUp(self.client.delete_dhcp_options,
126
-                                            DhcpOptionsId=id)
127
-
128
-        time.sleep(10)
129
-
130
-        kwargs = {
131
-            'DhcpOptionsIds': [id],
132
-        }
133
-        data = self.client.describe_dhcp_options(*[], **kwargs)
134
-        self.assertEqual(1, len(data['DhcpOptions']))
135
-        options = data['DhcpOptions'][0]
136
-        self.assertEqual(id, options['DhcpOptionsId'])
137
-        self.assertEqual(1, len(options['DhcpConfigurations']))
138
-        cfg = options['DhcpConfigurations'][0]
139
-        self.assertEqual(2, len(cfg))
140
-        self.assertEqual('domain-name', cfg['Key'])
141
-        self.assertEqual(1, len(cfg['Values']))
142
-        self.assertIn('my.com', cfg['Values'][0]['Value'])
143
-
144
-        data = self.client.delete_dhcp_options(DhcpOptionsId=id)
145
-        self.cancelResourceCleanUp(res_clean)
146
-
147
-    @decorators.idempotent_id('1b4d678a-c2a2-4c73-9e62-789fe2f6b173')
148
-    def test_associate_dhcp_options(self):
149
-        kwargs = {
150
-            'DhcpConfigurations': [
151
-                {'Key': 'domain-name',
152
-                 'Values': ['my.com']},
153
-            ],
154
-        }
155
-        data = self.client.create_dhcp_options(*[], **kwargs)
156
-        options = data['DhcpOptions']
157
-        id = options['DhcpOptionsId']
158
-        res_clean = self.addResourceCleanUp(self.client.delete_dhcp_options,
159
-                                            DhcpOptionsId=id)
160
-
161
-        cidr = '10.0.0.0/24'
162
-        data = self.client.create_vpc(CidrBlock=cidr)
163
-        vpc_id = data['Vpc']['VpcId']
164
-        dv_clean = self.addResourceCleanUp(self.client.delete_vpc,
165
-                                           VpcId=vpc_id)
166
-
167
-        kwargs = {
168
-            'DhcpOptionsId': id,
169
-            'VpcId': vpc_id,
170
-        }
171
-        data = self.client.associate_dhcp_options(*[], **kwargs)
172
-
173
-        self.assertRaises('DependencyViolation',
174
-                          self.client.delete_dhcp_options,
175
-                          DhcpOptionsId=id)
176
-
177
-        data = self.client.delete_vpc(VpcId=vpc_id)
178
-        self.cancelResourceCleanUp(dv_clean)
179
-        self.get_vpc_waiter().wait_delete(vpc_id)
180
-
181
-        data = self.client.delete_dhcp_options(DhcpOptionsId=id)
182
-        self.cancelResourceCleanUp(res_clean)

+ 0
- 359
ec2api/tests/functional/api/test_images.py View File

@@ -1,359 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-from tempest.lib.common.utils import data_utils
17
-from tempest.lib import decorators
18
-import testtools
19
-
20
-from ec2api.tests.functional import base
21
-from ec2api.tests.functional import config
22
-
23
-CONF = config.CONF
24
-
25
-
26
-class ImageTest(base.EC2TestCase):
27
-
28
-    @decorators.idempotent_id('19a2fda6-0b78-4544-a6c5-ac16f39811c8')
29
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
30
-    def test_check_ebs_image_type(self):
31
-        image_id = CONF.aws.ebs_image_id
32
-        data = self.client.describe_images(ImageIds=[image_id])
33
-        self.assertEqual(1, len(data['Images']))
34
-        image = data['Images'][0]
35
-        self.assertEqual("ebs", image['RootDeviceType'],
36
-                         "Image is not EBS image")
37
-
38
-    @decorators.idempotent_id('d45be578-5968-4189-8f25-56bf8ef23d20')
39
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
40
-    def test_check_ebs_image_volume_properties(self):
41
-        image_id = CONF.aws.ebs_image_id
42
-        data = self.client.describe_images(ImageIds=[image_id])
43
-        self.assertEqual(1, len(data['Images']))
44
-        image = data['Images'][0]
45
-        self.assertTrue(image['RootDeviceName'])
46
-        self.assertTrue(image['BlockDeviceMappings'])
47
-        device_name = image['RootDeviceName']
48
-        bdm = image['BlockDeviceMappings']
49
-        bdm = [v for v in bdm if v['DeviceName'] == device_name]
50
-        self.assertEqual(1, len(bdm))
51
-        bdm = bdm[0]
52
-        self.assertIn('Ebs', bdm)
53
-        ebs = bdm['Ebs']
54
-        self.assertIsNotNone(ebs.get('SnapshotId'))
55
-        self.assertIsNotNone(ebs.get('DeleteOnTermination'))
56
-        self.assertIsNotNone(ebs.get('VolumeSize'))
57
-        if CONF.aws.run_incompatible_tests:
58
-            self.assertIsNotNone(ebs.get('Encrypted'))
59
-            self.assertFalse(ebs.get('Encrypted'))
60
-            self.assertIsNotNone(ebs.get('VolumeType'))
61
-
62
-    @decorators.idempotent_id('a139f5ea-45fd-4b3e-9a52-32de0f8c3bca')
63
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
64
-    def test_describe_image_with_filters(self):
65
-        image_id = CONF.aws.ebs_image_id
66
-        data = self.client.describe_images(ImageIds=[image_id])
67
-        self.assertEqual(1, len(data['Images']))
68
-
69
-        data = self.client.describe_images(
70
-            # NOTE(ft): limit output to prevent timeout over AWS
71
-            Filters=[{'Name': 'image-type', 'Values': ['kernel', 'ramdisk']}])
72
-        if len(data['Images']) < 2:
73
-            self.skipTest("Insufficient images to check filters")
74
-        data = self.client.describe_images(
75
-            Filters=[{'Name': 'image-id', 'Values': [image_id]}])
76
-        self.assertEqual(1, len(data['Images']))
77
-        self.assertEqual(image_id, data['Images'][0]['ImageId'])
78
-
79
-    @decorators.idempotent_id('743e1f87-e0b6-4787-ab22-176379030007')
80
-    @testtools.skipUnless(CONF.aws.image_id, "Image id is not defined")
81
-    def test_check_image_operations_negative(self):
82
-        # NOTE(andrey-mp): image_id is a public image created by admin
83
-        image_id = CONF.aws.image_id
84
-
85
-        self.assertRaises('InvalidRequest',
86
-            self.client.describe_image_attribute,
87
-            ImageId=image_id, Attribute='unsupported')
88
-
89
-        self.assertRaises('AuthFailure',
90
-            self.client.describe_image_attribute,
91
-            ImageId=image_id, Attribute='description')
92
-
93
-        self.assertRaises('InvalidParameterCombination',
94
-            self.client.modify_image_attribute,
95
-            ImageId=image_id, Attribute='unsupported')
96
-
97
-        self.assertRaises('InvalidParameter',
98
-            self.client.modify_image_attribute,
99
-            ImageId=image_id, Attribute='blockDeviceMapping')
100
-
101
-        self.assertRaises('InvalidParameterCombination',
102
-            self.client.modify_image_attribute,
103
-            ImageId=image_id)
104
-
105
-        self.assertRaises('AuthFailure',
106
-            self.client.modify_image_attribute,
107
-            ImageId=image_id, Description={'Value': 'fake'})
108
-
109
-        self.assertRaises('AuthFailure',
110
-            self.client.modify_image_attribute,
111
-            ImageId=image_id, LaunchPermission={'Add': [{'Group': 'all'}]})
112
-
113
-        self.assertRaises('MissingParameter',
114
-            self.client.modify_image_attribute,
115
-            ImageId=image_id, Attribute='description')
116
-
117
-        self.assertRaises('InvalidParameterCombination',
118
-            self.client.modify_image_attribute,
119
-            ImageId=image_id, Attribute='launchPermission')
120
-
121
-        self.assertRaises('InvalidRequest',
122
-            self.client.reset_image_attribute,
123
-            ImageId=image_id, Attribute='fake')
124
-
125
-        self.assertRaises('AuthFailure',
126
-            self.client.reset_image_attribute,
127
-            ImageId=image_id, Attribute='launchPermission')
128
-
129
-        self.assertRaises('AuthFailure',
130
-            self.client.deregister_image,
131
-            ImageId=image_id)
132
-
133
-    @decorators.idempotent_id('a948dad1-9128-446b-86ee-82db13342054')
134
-    @testtools.skipUnless(CONF.aws.image_id, 'image id is not defined')
135
-    def test_create_image_from_non_ebs_instance(self):
136
-        image_id = CONF.aws.image_id
137
-        data = self.client.describe_images(ImageIds=[image_id])
138
-        image = data['Images'][0]
139
-        if 'RootDeviceType' in image and 'ebs' in image['RootDeviceType']:
140
-            raise self.skipException('image_id should not be EBS image.')
141
-
142
-        instance_id = self.run_instance(ImageId=image_id)
143
-
144
-        def _rollback(fn_data):
145
-            self.client.deregister_image(ImageId=fn_data['ImageId'])
146
-
147
-        self.assertRaises('InvalidParameterValue',
148
-            self.client.create_image, rollback_fn=_rollback,
149
-            InstanceId=instance_id, Name='name', Description='desc')
150
-
151
-        data = self.client.terminate_instances(InstanceIds=[instance_id])
152
-        self.get_instance_waiter().wait_delete(instance_id)
153
-
154
-    def _create_image(self, name, desc, extra_run_instance_args={}):
155
-        image_id = CONF.aws.ebs_image_id
156
-        data = self.client.describe_images(ImageIds=[image_id])
157
-        image = data['Images'][0]
158
-        self.assertTrue('RootDeviceType' in image
159
-                        and 'ebs' in image['RootDeviceType'])
160
-
161
-        instance_id = self.run_instance(ImageId=image_id,
162
-                                        **extra_run_instance_args)
163
-        instance = self.get_instance(instance_id)
164
-        for bdm in instance.get('BlockDeviceMappings', []):
165
-            if 'Ebs' in bdm:
166
-                self.addResourceCleanUp(self.client.delete_volume,
167
-                                        VolumeId=bdm['Ebs']['VolumeId'])
168
-
169
-        data = self.client.create_image(InstanceId=instance_id,
170
-                                             Name=name, Description=desc)
171
-        image_id = data['ImageId']
172
-        image_clean = self.addResourceCleanUp(self.client.deregister_image,
173
-                                              ImageId=image_id)
174
-        self.get_image_waiter().wait_available(image_id)
175
-
176
-        data = self.client.describe_images(ImageIds=[image_id])
177
-        for bdm in data['Images'][0].get('BlockDeviceMappings', []):
178
-            if 'Ebs' in bdm and 'SnapshotId' in bdm['Ebs']:
179
-                snapshot_id = bdm['Ebs']['SnapshotId']
180
-                self.addResourceCleanUp(self.client.delete_snapshot,
181
-                                        SnapshotId=snapshot_id)
182
-
183
-        data = self.client.terminate_instances(InstanceIds=[instance_id])
184
-        self.get_instance_waiter().wait_delete(instance_id)
185
-
186
-        return image_id, image_clean
187
-
188
-    @decorators.idempotent_id('f4fbb311-8a59-443d-a60a-11779917c757')
189
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
190
-    def test_create_image_from_ebs_instance(self):
191
-        name = data_utils.rand_name('image')
192
-        desc = data_utils.rand_name('description')
193
-        image_id, image_clean = self._create_image(name, desc)
194
-
195
-        data = self.client.describe_images(ImageIds=[image_id])
196
-        self.assertEqual(1, len(data['Images']))
197
-        image = data['Images'][0]
198
-
199
-        self.assertIsNotNone(image['CreationDate'])
200
-        self.assertEqual("ebs", image['RootDeviceType'])
201
-        self.assertFalse(image['Public'])
202
-        self.assertEqual(name, image['Name'])
203
-        self.assertEqual(desc, image['Description'])
204
-        self.assertEqual('machine', image['ImageType'])
205
-        self.assertNotEmpty(image['BlockDeviceMappings'])
206
-        for bdm in image['BlockDeviceMappings']:
207
-            self.assertIn('DeviceName', bdm)
208
-
209
-        data = self.client.deregister_image(ImageId=image_id)
210
-        self.cancelResourceCleanUp(image_clean)
211
-
212
-    @decorators.idempotent_id('b9aba1f7-0a7e-4717-b879-efe3bbea74e2')
213
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
214
-    def test_check_simple_image_attributes(self):
215
-        data = self.client.describe_images(ImageIds=[CONF.aws.ebs_image_id])
216
-        base_image = data['Images'][0]
217
-
218
-        name = data_utils.rand_name('image')
219
-        desc = data_utils.rand_name('desc for image')
220
-        image_id, image_clean = self._create_image(name, desc)
221
-
222
-        data = self.client.describe_image_attribute(
223
-            ImageId=image_id, Attribute='kernel')
224
-        if 'KernelId' in base_image:
225
-            self.assertIn('KernelId', data)
226
-        else:
227
-            self.assertNotIn('KernelId', data)
228
-
229
-        data = self.client.describe_image_attribute(
230
-            ImageId=image_id, Attribute='ramdisk')
231
-        if 'RamdiskId' in base_image:
232
-            self.assertIn('RamdiskId', data)
233
-        else:
234
-            self.assertNotIn('RamdiskId', data)
235
-
236
-        # description
237
-        data = self.client.describe_image_attribute(
238
-            ImageId=image_id, Attribute='description')
239
-        self.assertIn('Description', data)
240
-        self.assertIn('Value', data['Description'])
241
-        self.assertEqual(desc, data['Description']['Value'])
242
-
243
-        def _modify_description(**kwargs):
244
-            self.client.modify_image_attribute(ImageId=image_id, **kwargs)
245
-            data = self.client.describe_image_attribute(
246
-                ImageId=image_id, Attribute='description')
247
-            self.assertEqual(new_desc, data['Description']['Value'])
248
-
249
-        new_desc = data_utils.rand_name('new desc')
250
-        _modify_description(Attribute='description', Value=new_desc)
251
-        _modify_description(Description={'Value': new_desc})
252
-
253
-        data = self.client.deregister_image(ImageId=image_id)
254
-        self.cancelResourceCleanUp(image_clean)
255
-
256
-    @decorators.idempotent_id('680963cf-84f2-488d-bcdb-fc6f9b39f78c')
257
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
258
-    def test_check_bdm_in_image(self):
259
-        image_id = CONF.aws.ebs_image_id
260
-        data = self.client.describe_images(ImageIds=[image_id])
261
-        root_device_name = data['Images'][0]['RootDeviceName']
262
-        device_name_prefix = base.get_device_name_prefix(root_device_name)
263
-        device_name = device_name_prefix + 'h'
264
-
265
-        name = data_utils.rand_name('image')
266
-        desc = data_utils.rand_name('description')
267
-        image_id, image_clean = self._create_image(
268
-            name, desc,
269
-            extra_run_instance_args={
270
-                'BlockDeviceMappings': [{'DeviceName': device_name,
271
-                                         'Ebs': {'VolumeSize': 1}}]})
272
-
273
-        data = self.client.describe_images(ImageIds=[image_id])
274
-        image = data['Images'][0]
275
-
276
-        for bdm in image['BlockDeviceMappings']:
277
-            self.assertTrue('DeviceName', bdm)
278
-
279
-        data = self.client.deregister_image(ImageId=image_id)
280
-        self.cancelResourceCleanUp(image_clean)
281
-
282
-    @decorators.idempotent_id('1c244c9a-af3e-47f0-bc85-034e24b051e4')
283
-    @testtools.skipUnless(CONF.aws.run_incompatible_tests,
284
-        'By default glance is configured as "publicize_image": "role:admin"')
285
-    @testtools.skipUnless(CONF.aws.run_incompatible_tests,
286
-        'skip due to bug #1439819')
287
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
288
-    def test_check_launch_permission_attribute(self):
289
-        name = data_utils.rand_name('image')
290
-        desc = data_utils.rand_name('desc for image')
291
-        image_id, image_clean = self._create_image(name, desc)
292
-
293
-        # launch permission
294
-        data = self.client.describe_image_attribute(
295
-            ImageId=image_id, Attribute='launchPermission')
296
-        self.assertIn('LaunchPermissions', data)
297
-        self.assertEmpty(data['LaunchPermissions'])
298
-
299
-        def _modify_launch_permission(**kwargs):
300
-            self.client.modify_image_attribute(ImageId=image_id, **kwargs)
301
-            data = self.client.describe_image_attribute(
302
-                ImageId=image_id, Attribute='launchPermission')
303
-            self.assertIn('LaunchPermissions', data)
304
-            self.assertNotEmpty(data['LaunchPermissions'])
305
-            self.assertIn('Group', data['LaunchPermissions'][0])
306
-            self.assertEqual('all', data['LaunchPermissions'][0]['Group'])
307
-            data = self.client.describe_images(ImageIds=[image_id])
308
-            self.assertTrue(data['Images'][0]['Public'])
309
-
310
-            self.client.reset_image_attribute(
311
-                ImageId=image_id, Attribute='launchPermission')
312
-            data = self.client.describe_image_attribute(
313
-                ImageId=image_id, Attribute='launchPermission')
314
-            self.assertEmpty(data['LaunchPermissions'])
315
-            data = self.client.describe_images(ImageIds=[image_id])
316
-            self.assertFalse(data['Images'][0]['Public'])
317
-
318
-        _modify_launch_permission(Attribute='launchPermission',
319
-                                  OperationType='add', UserGroups=['all'])
320
-        _modify_launch_permission(LaunchPermission={'Add': [{'Group': 'all'}]})
321
-
322
-        data = self.client.deregister_image(ImageId=image_id)
323
-        self.cancelResourceCleanUp(image_clean)
324
-
325
-
326
-class ImageRegisterTest(base.EC2TestCase):
327
-
328
-    valid_image_state = set(('available', 'pending', 'failed'))
329
-
330
-    @classmethod
331
-    @base.safe_setup
332
-    def setUpClass(cls):
333
-        super(ImageRegisterTest, cls).setUpClass()
334
-        cls.image_location = CONF.aws.ami_image_location
335
-        if not cls.image_location:
336
-            raise cls.skipException('Image materials are not ready in S3')
337
-
338
-    @decorators.idempotent_id('3e25269d-c8a2-4438-ab25-c343cb53db79')
339
-    def test_register_get_deregister_ami_image(self):
340
-        image_name = data_utils.rand_name("ami-name")
341
-        data = self.client.register_image(
342
-            Name=image_name, ImageLocation=self.image_location)
343
-        image_id = data['ImageId']
344
-        image_clean = self.addResourceCleanUp(self.client.deregister_image,
345
-                                              ImageId=image_id)
346
-        self.assertEqual(image_id[0:3], "ami")
347
-
348
-        data = self.client.describe_images(ImageIds=[image_id])
349
-        self.assertEqual(1, len(data['Images']))
350
-        image = data['Images'][0]
351
-        self.assertEqual(image_name, image['Name'])
352
-        self.assertEqual(image_id, image['ImageId'])
353
-        self.assertIn(image['State'], self.valid_image_state)
354
-
355
-        self.get_image_waiter().wait_available(image_id)
356
-
357
-        self.client.deregister_image(ImageId=image_id)
358
-        self.cancelResourceCleanUp(image_clean)
359
-        self.get_image_waiter().wait_delete(image_id)

+ 0
- 365
ec2api/tests/functional/api/test_instance_attributes.py View File

@@ -1,365 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-import time
17
-
18
-from oslo_log import log
19
-from tempest.lib.common.utils import data_utils
20
-from tempest.lib import decorators
21
-import testtools
22
-
23
-from ec2api.tests.functional import base
24
-from ec2api.tests.functional import config
25
-
26
-CONF = config.CONF
27
-LOG = log.getLogger(__name__)
28
-
29
-
30
-class InstanceAttributeTest(base.EC2TestCase):
31
-
32
-    @decorators.idempotent_id('485107d8-f65f-4441-9558-2ff783e52e22')
33
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
34
-    def test_describe_instance_attributes(self):
35
-        instance_id = self.run_instance(ImageId=CONF.aws.ebs_image_id)
36
-
37
-        data = self.client.describe_instance_attribute(
38
-            InstanceId=instance_id, Attribute='blockDeviceMapping')
39
-        bdms = data.get('BlockDeviceMappings', [])
40
-        self.assertNotEmpty(bdms)
41
-        self.assertEqual(1, len(bdms))
42
-        self.assertIn('DeviceName', bdms[0])
43
-        self.assertIn('Ebs', bdms[0])
44
-
45
-        data = self.client.describe_instance_attribute(
46
-            InstanceId=instance_id, Attribute='disableApiTermination')
47
-        self.assertIn('DisableApiTermination', data)
48
-        self.assertIn('Value', data['DisableApiTermination'])
49
-        self.assertFalse(data['DisableApiTermination']['Value'])
50
-
51
-        data = self.client.describe_instance_attribute(
52
-            InstanceId=instance_id, Attribute='groupSet')
53
-        self.assertIn('Groups', data)
54
-        self.assertNotEmpty(data['Groups'], data)
55
-        self.assertTrue('GroupId' in data['Groups'][0]
56
-                        or 'GroupName' in data['Groups'][0])
57
-        self.assertTrue(data['Groups'][0].get('GroupId')
58
-                        or data['Groups'][0].get('GroupName'))
59
-
60
-        data = self.client.describe_instance_attribute(
61
-            InstanceId=instance_id, Attribute='instanceType')
62
-        self.assertIn('InstanceType', data)
63
-        self.assertIn('Value', data['InstanceType'])
64
-        self.assertEqual(CONF.aws.instance_type, data['InstanceType']['Value'])
65
-
66
-        data = self.client.describe_instance_attribute(
67
-            InstanceId=instance_id, Attribute='kernel')
68
-        self.assertIn('KernelId', data)
69
-
70
-        data = self.client.describe_instance_attribute(
71
-            InstanceId=instance_id, Attribute='ramdisk')
72
-        self.assertIn('RamdiskId', data)
73
-
74
-        data = self.client.describe_instance_attribute(
75
-            InstanceId=instance_id, Attribute='rootDeviceName')
76
-        self.assertIn('RootDeviceName', data)
77
-        self.assertIn('Value', data['RootDeviceName'])
78
-        self.assertTrue(data['RootDeviceName']['Value'])
79
-
80
-        self.client.terminate_instances(InstanceIds=[instance_id])
81
-        self.get_instance_waiter().wait_delete(instance_id)
82
-
83
-    @decorators.idempotent_id('391f6645-d014-42c7-a727-f3a6e7a13a4c')
84
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
85
-    def test_disable_api_termination_attribute(self):
86
-        instance_id = self.run_instance(DisableApiTermination=True)
87
-        res_clean = self.addResourceCleanUp(
88
-            self.client.modify_instance_attribute,
89
-            InstanceId=instance_id,
90
-            DisableApiTermination={'Value': False})
91
-
92
-        data = self.client.describe_instance_attribute(
93
-            InstanceId=instance_id, Attribute='disableApiTermination')
94
-        self.assertIn('DisableApiTermination', data)
95
-        self.assertIn('Value', data['DisableApiTermination'])
96
-        self.assertTrue(data['DisableApiTermination']['Value'])
97
-
98
-        data = self.client.modify_instance_attribute(InstanceId=instance_id,
99
-            Attribute='disableApiTermination', Value='False')
100
-        data = self.client.describe_instance_attribute(
101
-            InstanceId=instance_id, Attribute='disableApiTermination')
102
-        self.assertFalse(data['DisableApiTermination']['Value'])
103
-
104
-        data = self.client.modify_instance_attribute(InstanceId=instance_id,
105
-            Attribute='disableApiTermination', Value='True')
106
-        data = self.client.describe_instance_attribute(
107
-            InstanceId=instance_id, Attribute='disableApiTermination')
108
-        self.assertTrue(data['DisableApiTermination']['Value'])
109
-
110
-        self.assertRaises('OperationNotPermitted',
111
-                          self.client.terminate_instances,
112
-                          InstanceIds=[instance_id])
113
-
114
-        data = self.client.modify_instance_attribute(InstanceId=instance_id,
115
-            DisableApiTermination={'Value': False})
116
-        data = self.client.describe_instance_attribute(
117
-            InstanceId=instance_id, Attribute='disableApiTermination')
118
-        self.assertFalse(data['DisableApiTermination']['Value'])
119
-
120
-        self.client.terminate_instances(InstanceIds=[instance_id])
121
-        self.cancelResourceCleanUp(res_clean)
122
-        self.get_instance_waiter().wait_delete(instance_id)
123
-
124
-    @decorators.idempotent_id('50671a21-99bf-4514-acb0-97617f92e868')
125
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
126
-    def test_instance_attributes_negative(self):
127
-        instance_id = self.run_instance()
128
-
129
-        self.assertRaises('InvalidParameterValue',
130
-            self.client.describe_instance_attribute,
131
-            InstanceId=instance_id, Attribute='fake_attribute')
132
-        self.assertRaises('InvalidInstanceID.NotFound',
133
-            self.client.describe_instance_attribute,
134
-            InstanceId='i-0', Attribute='disableApiTermination')
135
-        if base.TesterStateHolder().get_ec2_enabled():
136
-            self.assertRaises('InvalidParameterCombination',
137
-                self.client.describe_instance_attribute,
138
-                InstanceId=instance_id, Attribute='sourceDestCheck')
139
-
140
-        self.assertRaises('InvalidParameterValue',
141
-            self.client.modify_instance_attribute,
142
-            InstanceId=instance_id, Attribute='fake_attribute')
143
-        self.assertRaises('MissingParameter',
144
-            self.client.modify_instance_attribute,
145
-            InstanceId=instance_id, Attribute='disableApiTermination')
146
-        self.assertRaises('InvalidParameterCombination',
147
-            self.client.modify_instance_attribute,
148
-            InstanceId=instance_id)
149
-        self.assertRaises('InvalidParameterCombination',
150
-            self.client.modify_instance_attribute,
151
-            InstanceId=instance_id, Attribute='disableApiTermination',
152
-            Value='True', DisableApiTermination={'Value': False})
153
-
154
-        ex_str = ('InvalidParameterCombination'
155
-                  if base.TesterStateHolder().get_ec2_enabled() else
156
-                  'InvalidGroup.NotFound')
157
-        self.assertRaises(ex_str,
158
-            self.client.modify_instance_attribute,
159
-            InstanceId=instance_id, Groups=['sg-0'])
160
-        if base.TesterStateHolder().get_ec2_enabled():
161
-            self.assertRaises('InvalidParameterCombination',
162
-                self.client.modify_instance_attribute,
163
-                InstanceId=instance_id, Attribute='sourceDestCheck',
164
-                Value='False')
165
-
166
-        self.assertRaises('InvalidParameterValue',
167
-            self.client.reset_instance_attribute,
168
-            InstanceId=instance_id, Attribute='fake_attribute')
169
-        self.assertRaises('InvalidParameterValue',
170
-            self.client.reset_instance_attribute,
171
-            InstanceId=instance_id, Attribute='disableApiTermination')
172
-        self.assertRaises('InvalidParameterValue',
173
-            self.client.reset_instance_attribute,
174
-            InstanceId='i-0', Attribute='disableApiTermination')
175
-        self.assertRaises('InvalidParameterValue',
176
-            self.client.reset_instance_attribute,
177
-            InstanceId=instance_id, Attribute='groupSet')
178
-        self.assertRaises('InvalidParameterValue',
179
-            self.client.reset_instance_attribute,
180
-            InstanceId=instance_id, Attribute='instanceType')
181
-
182
-        if base.TesterStateHolder().get_ec2_enabled():
183
-            self.assertRaises('InvalidParameterCombination',
184
-                self.client.reset_instance_attribute,
185
-                InstanceId=instance_id, Attribute='sourceDestCheck')
186
-
187
-        self.assertRaises('IncorrectInstanceState',
188
-            self.client.modify_instance_attribute,
189
-            InstanceId=instance_id, Attribute='instanceType',
190
-            Value=CONF.aws.instance_type)
191
-        self.assertRaises('IncorrectInstanceState',
192
-            self.client.modify_instance_attribute,
193
-            InstanceId=instance_id,
194
-            InstanceType={'Value': CONF.aws.instance_type})
195
-
196
-        self.client.terminate_instances(InstanceIds=[instance_id])
197
-        self.get_instance_waiter().wait_delete(instance_id)
198
-
199
-    @base.skip_without_vpc()
200
-    @decorators.idempotent_id('6fd2c8eb-f7f9-420d-a8ae-5d5af3a49a35')
201
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
202
-    def test_attributes_for_multiple_interfaces_negative(self):
203
-        vpc_id, subnet_id = self.create_vpc_and_subnet('10.30.0.0/24')
204
-
205
-        name = data_utils.rand_name('sgName')
206
-        desc = data_utils.rand_name('sgDesc')
207
-        data = self.client.create_security_group(VpcId=vpc_id, GroupName=name,
208
-                                                 Description=desc)
209
-        group_id = data['GroupId']
210
-        self.addResourceCleanUp(self.client.delete_security_group,
211
-                                GroupId=group_id)
212
-        time.sleep(2)
213
-        data = self.client.create_network_interface(SubnetId=subnet_id,
214
-            Groups=[group_id])
215
-        ni_id2 = data['NetworkInterface']['NetworkInterfaceId']
216
-        self.addResourceCleanUp(self.client.delete_network_interface,
217
-                                NetworkInterfaceId=ni_id2)
218
-        self.get_network_interface_waiter().wait_available(ni_id2)
219
-
220
-        instance_id = self.run_instance(SubnetId=subnet_id)
221
-
222
-        kwargs = {
223
-            'DeviceIndex': 2,
224
-            'InstanceId': instance_id,
225
-            'NetworkInterfaceId': ni_id2
226
-        }
227
-        data = self.client.attach_network_interface(*[], **kwargs)
228
-
229
-        self.assertRaises('InvalidInstanceID',
230
-            self.client.describe_instance_attribute,
231
-            InstanceId=instance_id, Attribute='groupSet')
232
-        self.assertRaises('InvalidInstanceID',
233
-            self.client.modify_instance_attribute,
234
-            InstanceId=instance_id, Groups=['sg-0'])
235
-
236
-        self.assertRaises('InvalidInstanceID',
237
-            self.client.describe_instance_attribute,
238
-            InstanceId=instance_id, Attribute='sourceDestCheck')
239
-        self.assertRaises('InvalidInstanceID',
240
-            self.client.modify_instance_attribute,
241
-            InstanceId=instance_id, SourceDestCheck={'Value': False})
242
-        self.assertRaises('InvalidInstanceID',
243
-            self.client.reset_instance_attribute,
244
-            InstanceId=instance_id, Attribute='sourceDestCheck')
245
-
246
-        self.client.terminate_instances(InstanceIds=[instance_id])
247
-        self.get_instance_waiter().wait_delete(instance_id)
248
-
249
-    @base.skip_without_vpc()
250
-    @decorators.idempotent_id('da26cc0d-6c2d-4638-97f1-1abfae8f00b5')
251
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
252
-    def test_group_set_attribute(self):
253
-        vpc_id, subnet_id = self.create_vpc_and_subnet('10.30.0.0/24')
254
-
255
-        instance_id = self.run_instance(SubnetId=subnet_id)
256
-
257
-        data = self.client.describe_instance_attribute(
258
-            InstanceId=instance_id, Attribute='groupSet')
259
-        self.assertIn('Groups', data)
260
-        self.assertEqual(1, len(data['Groups']))
261
-        default_group_id = data['Groups'][0]['GroupId']
262
-
263
-        name = data_utils.rand_name('sgName')
264
-        desc = data_utils.rand_name('sgDesc')
265
-        data = self.client.create_security_group(VpcId=vpc_id, GroupName=name,
266
-                                                 Description=desc)
267
-        group_id = data['GroupId']
268
-        self.addResourceCleanUp(self.client.delete_security_group,
269
-                                GroupId=group_id)
270
-        time.sleep(2)
271
-
272
-        try:
273
-            data = self.client.modify_instance_attribute(
274
-                InstanceId=instance_id, Groups=[group_id])
275
-            data = self.client.describe_instance_attribute(
276
-                InstanceId=instance_id, Attribute='groupSet')
277
-            self.assertIn('Groups', data)
278
-            self.assertEqual(1, len(data['Groups']))
279
-            self.assertNotEqual(default_group_id, data['Groups'][0]['GroupId'])
280
-
281
-            self.assertRaises('DependencyViolation',
282
-                self.client.delete_security_group,
283
-                GroupId=group_id)
284
-        finally:
285
-            self.client.modify_instance_attribute(InstanceId=instance_id,
286
-                Groups=[default_group_id])
287
-
288
-        data = self.client.describe_instance_attribute(
289
-            InstanceId=instance_id, Attribute='groupSet')
290
-        self.assertIn('Groups', data)
291
-        self.assertEqual(1, len(data['Groups']))
292
-        self.assertEqual(default_group_id, data['Groups'][0]['GroupId'])
293
-
294
-        self.client.terminate_instances(InstanceIds=[instance_id])
295
-        self.get_instance_waiter().wait_delete(instance_id)
296
-
297
-    @base.skip_without_vpc()
298
-    @decorators.idempotent_id('8e7b37b5-1f2d-4c38-b51e-dcd0e726edb3')
299
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
300
-    def test_source_dest_check_attribute(self):
301
-        vpc_id, subnet_id = self.create_vpc_and_subnet('10.30.0.0/24')
302
-
303
-        instance_id = self.run_instance(SubnetId=subnet_id)
304
-
305
-        def do_check(value):
306
-            data = self.client.describe_instance_attribute(
307
-                InstanceId=instance_id, Attribute='sourceDestCheck')
308
-            self.assertIn('SourceDestCheck', data)
309
-            self.assertEqual(value, data['SourceDestCheck'].get('Value'))
310
-
311
-        do_check(True)
312
-
313
-        self.client.modify_instance_attribute(
314
-            InstanceId=instance_id, Attribute='sourceDestCheck',
315
-            Value='False')
316
-        do_check(False)
317
-
318
-        self.client.reset_instance_attribute(
319
-            InstanceId=instance_id, Attribute='sourceDestCheck')
320
-        do_check(True)
321
-
322
-        self.client.modify_instance_attribute(
323
-            InstanceId=instance_id, Attribute='sourceDestCheck',
324
-            Value='False')
325
-        do_check(False)
326
-
327
-        self.client.terminate_instances(InstanceIds=[instance_id])
328
-        self.get_instance_waiter().wait_delete(instance_id)
329
-
330
-    @decorators.idempotent_id('a2640ab1-6aaa-4626-9f23-4aba52e3b88a')
331
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
332
-    @testtools.skipUnless(CONF.aws.instance_type_alt,
333
-                          "Alternative instance type is not defined")
334
-    @testtools.skipUnless(CONF.aws.instance_type_alt != CONF.aws.instance_type,
335
-                          "Alternative instance type is not defined")
336
-    def test_instance_type_attribute(self):
337
-        instance_id = self.run_instance(ImageId=CONF.aws.ebs_image_id)
338
-
339
-        self.client.stop_instances(InstanceIds=[instance_id])
340
-        self.get_instance_waiter().wait_available(instance_id,
341
-                                                  final_set=('stopped'))
342
-        instance = self.get_instance(instance_id)
343
-        self.assertEqual(CONF.aws.instance_type, instance['InstanceType'])
344
-
345
-        self.client.modify_instance_attribute(
346
-            InstanceId=instance_id, Attribute='instanceType',
347
-            Value=CONF.aws.instance_type)
348
-        instance = self.get_instance(instance_id)
349
-        self.assertEqual(CONF.aws.instance_type, instance['InstanceType'])
350
-
351
-        self.client.modify_instance_attribute(
352
-            InstanceId=instance_id,
353
-            InstanceType={'Value': CONF.aws.instance_type_alt})
354
-        instance = self.get_instance(instance_id)
355
-        self.assertEqual(CONF.aws.instance_type_alt, instance['InstanceType'])
356
-
357
-        self.client.start_instances(InstanceIds=[instance_id])
358
-        self.get_instance_waiter().wait_available(instance_id,
359
-                                                  final_set=('running'))
360
-
361
-        instance = self.get_instance(instance_id)
362
-        self.assertEqual(CONF.aws.instance_type_alt, instance['InstanceType'])
363
-
364
-        self.client.terminate_instances(InstanceIds=[instance_id])
365
-        self.get_instance_waiter().wait_delete(instance_id)

+ 0
- 252
ec2api/tests/functional/api/test_instances.py View File

@@ -1,252 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-from oslo_log import log
17
-from tempest.lib.common.utils import data_utils
18
-from tempest.lib import decorators
19
-import testtools
20
-
21
-from ec2api.tests.functional import base
22
-from ec2api.tests.functional import config
23
-
24
-CONF = config.CONF
25
-LOG = log.getLogger(__name__)
26
-
27
-
28
-class InstanceTest(base.EC2TestCase):
29
-
30
-    @classmethod
31
-    @base.safe_setup
32
-    def setUpClass(cls):
33
-        super(InstanceTest, cls).setUpClass()
34
-        if not CONF.aws.image_id:
35
-            raise cls.skipException('aws image_id does not provided')
36
-        cls.zone = CONF.aws.aws_zone
37
-
38
-    @decorators.idempotent_id('5604e461-c36a-4fea-84bc-eddfe702ae4f')
39
-    def test_create_delete_instance(self):
40
-        instance_type = CONF.aws.instance_type
41
-        image_id = CONF.aws.image_id
42
-        data = self.client.run_instances(
43
-            ImageId=image_id, InstanceType=instance_type,
44
-            Placement={'AvailabilityZone': self.zone}, MinCount=1, MaxCount=1)
45
-        instance_id = data['Instances'][0]['InstanceId']
46
-        res_clean = self.addResourceCleanUp(self.client.terminate_instances,
47
-                                            InstanceIds=[instance_id])
48
-        self.assertEqual(1, len(data['Instances']))
49
-        self.get_instance_waiter().wait_available(instance_id,
50
-                                                  final_set=('running'))
51
-
52
-        data = self.client.describe_instances(InstanceIds=[instance_id])
53
-        reservations = data.get('Reservations', [])
54
-        self.assertNotEmpty(reservations)
55
-        instances = reservations[0].get('Instances', [])
56
-        self.assertEqual(1, len(instances))
57
-        self.assertEqual(1, len(instances[0]['SecurityGroups']))
58
-        groups = reservations[0].get('Groups', [])
59
-        if base.TesterStateHolder().get_ec2_enabled():
60
-            self.assertEqual(1, len(groups))
61
-            self.assertEqual(groups[0]['GroupName'],
62
-                             instances[0]['SecurityGroups'][0]['GroupName'])
63
-        else:
64
-            self.assertEqual(0, len(groups))
65
-
66
-        self.client.terminate_instances(InstanceIds=[instance_id])
67
-        self.cancelResourceCleanUp(res_clean)
68
-        self.get_instance_waiter().wait_delete(instance_id)
69
-
70
-        # NOTE(andrey-mp): There is difference between Openstack and Amazon.
71
-        # Amazon returns instance in 'terminated' state some time after
72
-        # instance deletion. But Openstack doesn't return such instance.
73
-
74
-    @decorators.idempotent_id('40b273e5-3d43-4529-99b0-da5dd7e6764e')
75
-    def test_create_idempotent_instance(self):
76
-        client_token = data_utils.rand_name('t')
77
-        instance_type = CONF.aws.instance_type
78
-        image_id = CONF.aws.image_id
79
-        data = self.client.run_instances(
80
-            ImageId=image_id, InstanceType=instance_type,
81
-            Placement={'AvailabilityZone': self.zone}, MinCount=1, MaxCount=1,
82
-            ClientToken=client_token)
83
-        instance_id = data['Instances'][0]['InstanceId']
84
-        res_clean = self.addResourceCleanUp(self.client.terminate_instances,
85
-                                            InstanceIds=[instance_id])
86
-        self.assertEqual(1, len(data['Instances']))
87
-        reservation_id = data['ReservationId']
88
-        self.get_instance_waiter().wait_available(instance_id,
89
-                                                  final_set=('running'))
90
-
91
-        data = self.client.run_instances(
92
-            ImageId=image_id, InstanceType=instance_type,
93
-            Placement={'AvailabilityZone': self.zone}, MinCount=1, MaxCount=1,
94
-            ClientToken=client_token)
95
-
96
-        # NOTE(andrey-mp): if idempotent run will fail this will terminate
97
-        # second instance
98
-        self.addResourceCleanUp(self.client.terminate_instances,
99
-            InstanceIds=[data['Instances'][0]['InstanceId']])
100
-
101
-        self.assertEqual(1, len(data['Instances']))
102
-        self.assertEqual(reservation_id, data['ReservationId'])
103
-        self.assertEqual(instance_id, data['Instances'][0]['InstanceId'])
104
-
105
-        self.client.terminate_instances(InstanceIds=[instance_id])
106
-        self.cancelResourceCleanUp(res_clean)
107
-        self.get_instance_waiter().wait_delete(instance_id)
108
-
109
-    @decorators.idempotent_id('4c3c709a-72e2-4c87-bab2-e3a16fc5d1fe')
110
-    def test_describe_instances_filter(self):
111
-        instance_type = CONF.aws.instance_type
112
-        image_id = CONF.aws.image_id
113
-        data = self.client.run_instances(
114
-            ImageId=image_id, InstanceType=instance_type,
115
-            Placement={'AvailabilityZone': self.zone}, MinCount=1, MaxCount=1)
116
-        instance_id = data['Instances'][0]['InstanceId']
117
-        res_clean = self.addResourceCleanUp(self.client.terminate_instances,
118
-                                            InstanceIds=[instance_id])
119
-        self.get_instance_waiter().wait_available(instance_id,
120
-                                                  final_set=('running'))
121
-
122
-        # NOTE(andrey-mp): by real id
123
-        data = self.client.describe_instances(InstanceIds=[instance_id])
124
-        self._assert_instance(data, instance_id)
125
-        instances = data['Reservations'][0]['Instances']
126
-        private_dns = instances[0]['PrivateDnsName']
127
-        private_ip = instances[0]['PrivateIpAddress']
128
-
129
-        # NOTE(andrey-mp): by fake id
130
-        self.assertRaises('InvalidInstanceID.NotFound',
131
-                          self.client.describe_instances,
132
-                          InstanceIds=['i-0'])
133
-
134
-        # NOTE(andrey-mp): by private ip
135
-        data = self.client.describe_instances(
136
-            Filters=[{'Name': 'private-ip-address', 'Values': ['1.2.3.4']}])
137
-        self.assertEqual(0, len(data['Reservations']))
138
-
139
-        data = self.client.describe_instances(
140
-            Filters=[{'Name': 'private-ip-address', 'Values': [private_ip]}])
141
-        self._assert_instance(data, instance_id)
142
-
143
-        # NOTE(andrey-mp): by private dns
144
-        data = self.client.describe_instances(
145
-            Filters=[{'Name': 'private-dns-name', 'Values': ['fake.com']}])
146
-        self.assertEqual(0, len(data['Reservations']))
147
-
148
-        data = self.client.describe_instances(
149
-            Filters=[{'Name': 'private-dns-name', 'Values': [private_dns]}])
150
-        self._assert_instance(data, instance_id)
151
-
152
-        self.client.terminate_instances(InstanceIds=[instance_id])
153
-        self.cancelResourceCleanUp(res_clean)
154
-        self.get_instance_waiter().wait_delete(instance_id)
155
-
156
-    def _assert_instance(self, data, instance_id):
157
-        reservations = data.get('Reservations', [])
158
-        self.assertNotEmpty(reservations)
159
-        instances = reservations[0].get('Instances', [])
160
-        self.assertNotEmpty(instances)
161
-        self.assertEqual(instance_id, instances[0]['InstanceId'])
162
-
163
-    @decorators.idempotent_id('d40bf881-4220-46a9-b04a-fca9054c9731')
164
-    def test_get_password_data_and_console_output(self):
165
-        instance_type = CONF.aws.instance_type
166
-        image_id = CONF.aws.image_id
167
-        data = self.client.run_instances(
168
-            ImageId=image_id, InstanceType=instance_type,
169
-            Placement={'AvailabilityZone': self.zone}, MinCount=1, MaxCount=1)
170
-        instance_id = data['Instances'][0]['InstanceId']
171
-        res_clean = self.addResourceCleanUp(self.client.terminate_instances,
172
-                                            InstanceIds=[instance_id])
173
-        self.get_instance_waiter().wait_available(instance_id,
174
-                                                  final_set=('running'))
175
-
176
-        data = self.client.get_password_data(InstanceId=instance_id)
177
-        self.assertEqual(instance_id, data['InstanceId'])
178
-        self.assertIsNotNone(data['Timestamp'])
179
-        self.assertIn('PasswordData', data)
180
-
181
-        def _wait_for_output(*args, **kwargs):
182
-            data = self.client.get_console_output(*args, **kwargs)
183
-            self.assertIn('Output', data)
184
-
185
-        waiter = base.EC2Waiter(_wait_for_output)
186
-        waiter.wait_no_exception(InstanceId=instance_id)
187
-
188
-        data = self.client.get_console_output(InstanceId=instance_id)
189
-        self.assertEqual(instance_id, data['InstanceId'])
190
-        self.assertIsNotNone(data['Timestamp'])
191
-        self.assertIn('Output', data)
192
-
193
-        self.client.terminate_instances(InstanceIds=[instance_id])
194
-        self.cancelResourceCleanUp(res_clean)
195
-        self.get_instance_waiter().wait_delete(instance_id)
196
-
197
-    @decorators.idempotent_id('5947ccaa-a519-46f4-9d58-ceb79042266a')
198
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
199
-    def test_stop_instance(self):
200
-        instance_type = CONF.aws.instance_type
201
-        image_id = CONF.aws.ebs_image_id
202
-        data = self.client.run_instances(
203
-            ImageId=image_id, InstanceType=instance_type,
204
-            Placement={'AvailabilityZone': self.zone}, MinCount=1, MaxCount=1)
205
-        instance_id = data['Instances'][0]['InstanceId']
206
-        res_clean = self.addResourceCleanUp(self.client.terminate_instances,
207
-                                            InstanceIds=[instance_id])
208
-        self.get_instance_waiter().wait_available(instance_id,
209
-                                                  final_set=('running'))
210
-
211
-        data = self.client.stop_instances(InstanceIds=[instance_id])
212
-        if CONF.aws.run_incompatible_tests:
213
-            instances = data['StoppingInstances']
214
-            self.assertEqual(1, len(instances))
215
-            instance = instances[0]
216
-            self.assertEqual(instance_id, instance['InstanceId'])
217
-            self.assertEqual('running', instance['PreviousState']['Name'])
218
-            self.assertEqual('stopping', instance['CurrentState']['Name'])
219
-
220
-        self.get_instance_waiter().wait_available(instance_id,
221
-                                                  final_set=('stopped'))
222
-
223
-        self.client.terminate_instances(InstanceIds=[instance_id])
224
-        self.cancelResourceCleanUp(res_clean)
225
-        self.get_instance_waiter().wait_delete(instance_id)
226
-
227
-    @decorators.idempotent_id('0f29affb-eae5-42be-9b52-d28a17ba7107')
228
-    @testtools.skipUnless(CONF.aws.run_incompatible_tests,
229
-        "Openstack doesn't assign public ip automatically for new instance")
230
-    def test_public_ip_is_assigned(self):
231
-        """Is public IP assigned to launched instnace?"""
232
-        instance_type = CONF.aws.instance_type
233
-        image_id = CONF.aws.image_id
234
-        data = self.client.run_instances(
235
-            ImageId=image_id, InstanceType=instance_type,
236
-            Placement={'AvailabilityZone': self.zone}, MinCount=1, MaxCount=1)
237
-        self.assertEqual(1, len(data['Instances']))
238
-        instance_id = data['Instances'][0]['InstanceId']
239
-        res_clean = self.addResourceCleanUp(self.client.terminate_instances,
240
-                                            InstanceIds=[instance_id])
241
-        self.get_instance_waiter().wait_available(instance_id,
242
-                                                  final_set=('running'))
243
-
244
-        instance = self.get_instance(instance_id)
245
-        self.assertIsNotNone(instance.get('PublicIpAddress'))
246
-        self.assertIsNotNone(instance.get('PrivateIpAddress'))
247
-        self.assertNotEqual(instance.get('PublicIpAddress'),
248
-                            instance.get('PrivateIpAddress'))
249
-
250
-        self.client.terminate_instances(InstanceIds=[instance_id])
251
-        self.cancelResourceCleanUp(res_clean)
252
-        self.get_instance_waiter().wait_delete(instance_id)

+ 0
- 92
ec2api/tests/functional/api/test_instances_ebs.py View File

@@ -1,92 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-from oslo_log import log
17
-from tempest.lib import decorators
18
-import testtools
19
-
20
-from ec2api.tests.functional import base
21
-from ec2api.tests.functional import config
22
-
23
-CONF = config.CONF
24
-LOG = log.getLogger(__name__)
25
-
26
-
27
-class InstanceWithEBSTest(base.EC2TestCase):
28
-
29
-    @decorators.idempotent_id('a5cad848-bed2-4dcb-8ba0-987bb7e9c487')
30
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
31
-    def test_create_get_delete_ebs_instance(self):
32
-        """Launch EBS-backed instance, check results, and terminate it."""
33
-        instance_id = self.run_instance(ImageId=CONF.aws.ebs_image_id)
34
-        instance = self.get_instance(instance_id)
35
-
36
-        self.assertEqual('ebs', instance.get('RootDeviceType'))
37
-        self.assertIsNotNone(instance.get('RootDeviceName'))
38
-        bdms = instance.get('BlockDeviceMappings')
39
-        self.assertIsNotNone(bdms)
40
-        rdn = instance['RootDeviceName']
41
-        bdt = [bdt for bdt in bdms if bdt['DeviceName'] == rdn]
42
-        self.assertEqual(1, len(bdt))
43
-        ebs = bdt[0]['Ebs']
44
-        self.assertIsNotNone(ebs)
45
-        volume_id = ebs.get('VolumeId')
46
-        self.assertIsNotNone(volume_id)
47
-        self.assertEqual('attached', ebs.get('Status'))
48
-        if CONF.aws.run_incompatible_tests:
49
-            self.assertTrue(ebs.get('AttachTime'))
50
-        self.assertTrue(ebs.get('DeleteOnTermination'))
51
-
52
-        data = self.client.describe_volumes(VolumeIds=[volume_id])
53
-        self.assertEqual(1, len(data['Volumes']))
54
-
55
-        data = self.client.terminate_instances(InstanceIds=[instance_id])
56
-        self.get_instance_waiter().wait_delete(instance_id)
57
-
58
-    @decorators.idempotent_id('b6226b7b-d965-4c3a-b2a8-48add794c194')
59
-    @testtools.skipUnless(CONF.aws.ebs_image_id, "EBS image id is not defined")
60
-    def test_create_root_volume_snapshot(self):
61
-        """Create snapshot of root volume of EBS-backed instance."""
62
-        instance_id = self.run_instance(ImageId=CONF.aws.ebs_image_id)
63
-
64
-        bdt = self.get_instance_bdm(instance_id, None)
65
-        self.assertIsNotNone(bdt)
66
-        volume_id = bdt['Ebs'].get('VolumeId')
67
-        self.assertIsNotNone(volume_id)
68
-
69
-        self.client.stop_instances(InstanceIds=[instance_id])
70
-        self.get_instance_waiter().wait_available(instance_id,
71
-                                                  final_set=('stopped'))
72
-
73
-        data = self.client.describe_volumes(VolumeIds=[volume_id])
74
-        self.assertEqual(1, len(data['Volumes']))
75
-
76
-        kwargs = {
77
-            'VolumeId': data['Volumes'][0]['VolumeId'],
78
-            'Description': 'Description'
79
-        }
80
-        data = self.client.create_snapshot(*[], **kwargs)
81
-        snapshot_id = data['SnapshotId']
82
-        res_clean_s = self.addResourceCleanUp(self.client.delete_snapshot,
83
-                                              SnapshotId=snapshot_id)
84
-        self.get_snapshot_waiter().wait_available(snapshot_id,
85
-                                                  final_set=('completed'))
86
-
87
-        data = self.client.delete_snapshot(SnapshotId=snapshot_id)
88
-        self.cancelResourceCleanUp(res_clean_s)
89
-        self.get_snapshot_waiter().wait_delete(snapshot_id)
90
-
91
-        data = self.client.terminate_instances(InstanceIds=[instance_id])
92
-        self.get_instance_waiter().wait_delete(instance_id)

+ 0
- 282
ec2api/tests/functional/api/test_instances_vpc.py View File

@@ -1,282 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-from oslo_log import log
17
-from tempest.lib import decorators
18
-import testtools
19
-
20
-from ec2api.tests.functional import base
21
-from ec2api.tests.functional import config
22
-
23
-CONF = config.CONF
24
-LOG = log.getLogger(__name__)
25
-
26
-
27
-class InstanceInVPCTest(base.EC2TestCase):
28
-
29
-    VPC_CIDR = '10.16.0.0/20'
30
-    vpc_id = None
31
-    SUBNET_CIDR = '10.16.0.0/24'
32
-    subnet_id = None
33
-
34
-    @classmethod
35
-    @base.safe_setup
36
-    def setUpClass(cls):
37
-        super(InstanceInVPCTest, cls).setUpClass()
38
-        if not base.TesterStateHolder().get_vpc_enabled():
39
-            raise cls.skipException('VPC is disabled')
40
-
41
-        data = cls.client.create_vpc(CidrBlock=cls.VPC_CIDR)
42
-        cls.vpc_id = data['Vpc']['VpcId']
43
-        cls.addResourceCleanUpStatic(cls.client.delete_vpc, VpcId=cls.vpc_id)
44
-        cls.get_vpc_waiter().wait_available(cls.vpc_id)
45
-
46
-        aws_zone = CONF.aws.aws_zone
47
-        data = cls.client.create_subnet(VpcId=cls.vpc_id,
48
-                                             CidrBlock=cls.SUBNET_CIDR,
49
-                                             AvailabilityZone=aws_zone)
50
-        cls.subnet_id = data['Subnet']['SubnetId']
51
-        cls.addResourceCleanUpStatic(cls.client.delete_subnet,
52
-                                     SubnetId=cls.subnet_id)
53
-        cls.get_subnet_waiter().wait_available(cls.subnet_id)
54
-
55
-    @decorators.idempotent_id('af8bd493-4a68-49e7-a3d1-326251b8d16e')
56
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
57
-    def test_create_delete_instance(self):
58
-        instance_id = self.run_instance(SubnetId=self.subnet_id)
59
-
60
-        data = self.client.describe_instances(InstanceIds=[instance_id])
61
-        reservations = data.get('Reservations', [])
62
-        self.assertNotEmpty(reservations)
63
-        instances = reservations[0].get('Instances', [])
64
-        self.assertNotEmpty(instances)
65
-        instance = instances[0]
66
-        self.assertEqual(self.vpc_id, instance['VpcId'])
67
-        self.assertEqual(self.subnet_id, instance['SubnetId'])
68
-        self.assertTrue(instance['SourceDestCheck'])
69
-        self.assertEqual(1, len(instance['NetworkInterfaces']))
70
-        ni = instance['NetworkInterfaces'][0]
71
-        self.assertEqual(1, len(ni['Groups']))
72
-        self.assertIsNotNone(ni['MacAddress'])
73
-        self.assertIsNotNone(ni['PrivateIpAddress'])
74
-        self.assertTrue(ni['SourceDestCheck'])
75
-        self.assertEqual('in-use', ni['Status'])
76
-        self.assertEqual(self.vpc_id, ni['VpcId'])
77
-        self.assertEqual(self.subnet_id, ni['SubnetId'])
78
-
79
-        self.client.terminate_instances(InstanceIds=[instance_id])
80
-        self.get_instance_waiter().wait_delete(instance_id)
81
-
82
-        # NOTE(andrey-mp): There is difference between Openstack and Amazon.
83
-        # Amazon returns instance in 'terminated' state some time after
84
-        # instance deletion. But Openstack doesn't return such instance.
85
-
86
-    @decorators.idempotent_id('17ba6206-3044-4e51-9e9b-f5d5728cc047')
87
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
88
-    def test_describe_instances_filter(self):
89
-        instance_id = self.run_instance(SubnetId=self.subnet_id)
90
-
91
-        data = self.client.describe_instances(InstanceIds=[instance_id])
92
-        self.assert_instance(data, instance_id)
93
-        instances = data['Reservations'][0]['Instances']
94
-        private_dns = instances[0]['PrivateDnsName']
95
-        private_ip = instances[0]['PrivateIpAddress']
96
-
97
-        # NOTE(andrey-mp): by private ip
98
-        data = self.client.describe_instances(
99
-            Filters=[{'Name': 'private-ip-address', 'Values': ['1.2.3.4']}])
100
-        self.assertEqual(0, len(data['Reservations']))
101
-
102
-        data = self.client.describe_instances(
103
-            Filters=[{'Name': 'private-ip-address', 'Values': [private_ip]}])
104
-        self.assert_instance(data, instance_id)
105
-
106
-        # NOTE(andrey-mp): by private dns
107
-        data = self.client.describe_instances(
108
-            Filters=[{'Name': 'private-dns-name', 'Values': ['fake.com']}])
109
-        self.assertEqual(0, len(data['Reservations']))
110
-
111
-        data = self.client.describe_instances(
112
-            Filters=[{'Name': 'private-dns-name', 'Values': [private_dns]}])
113
-        self.assert_instance(data, instance_id)
114
-
115
-        # NOTE(andrey-mp): by subnet id
116
-        data = self.client.describe_instances(
117
-            Filters=[{'Name': 'subnet-id', 'Values': ['subnet-0']}])
118
-        self.assertEqual(0, len(data['Reservations']))
119
-
120
-        data = self.client.describe_instances(
121
-            Filters=[{'Name': 'subnet-id', 'Values': [self.subnet_id]}])
122
-        self.assert_instance(data, instance_id)
123
-
124
-        # NOTE(andrey-mp): by vpc id
125
-        data = self.client.describe_instances(
126
-            Filters=[{'Name': 'vpc-id', 'Values': ['vpc-0']}])
127
-        self.assertEqual(0, len(data['Reservations']))
128
-
129
-        data = self.client.describe_instances(
130
-            Filters=[{'Name': 'vpc-id', 'Values': [self.vpc_id]}])
131
-        self.assert_instance(data, instance_id)
132
-
133
-        self.client.terminate_instances(InstanceIds=[instance_id])
134
-        self.get_instance_waiter().wait_delete(instance_id)
135
-
136
-    def assert_instance(self, data, instance_id):
137
-        reservations = data.get('Reservations', [])
138
-        self.assertNotEmpty(reservations)
139
-        instances = reservations[0].get('Instances', [])
140
-        self.assertNotEmpty(instances)
141
-        self.assertEqual(instance_id, instances[0]['InstanceId'])
142
-
143
-    @decorators.idempotent_id('60ceda8b-85ae-47a7-807b-c4a4dd05a13b')
144
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
145
-    def test_create_instance_with_two_interfaces(self):
146
-        kwargs = {
147
-            'SubnetId': self.subnet_id,
148
-        }
149
-        data = self.client.create_network_interface(*[], **kwargs)
150
-        ni_id1 = data['NetworkInterface']['NetworkInterfaceId']
151
-        clean_ni1 = self.addResourceCleanUp(
152
-            self.client.delete_network_interface, NetworkInterfaceId=ni_id1)
153
-        self.get_network_interface_waiter().wait_available(ni_id1)
154
-
155
-        kwargs = {
156
-            'SubnetId': self.subnet_id,
157
-        }
158
-        data = self.client.create_network_interface(*[], **kwargs)
159
-        ni_id2 = data['NetworkInterface']['NetworkInterfaceId']
160
-        clean_ni2 = self.addResourceCleanUp(
161
-            self.client.delete_network_interface, NetworkInterfaceId=ni_id2)
162
-        self.get_network_interface_waiter().wait_available(ni_id2)
163
-
164
-        instance_id = self.run_instance(
165
-            NetworkInterfaces=[{'NetworkInterfaceId': ni_id1,
166
-                                'DeviceIndex': 0},
167
-                               {'NetworkInterfaceId': ni_id2,
168
-                                'DeviceIndex': 2}])
169
-
170
-        instance = self.get_instance(instance_id)
171
-        nis = instance.get('NetworkInterfaces', [])
172
-        self.assertEqual(2, len(nis))
173
-
174
-        self.client.terminate_instances(InstanceIds=[instance_id])
175
-        self.get_instance_waiter().wait_delete(instance_id)
176
-
177
-        self.get_network_interface_waiter().wait_available(ni_id1)
178
-        self.get_network_interface_waiter().wait_available(ni_id2)
179
-
180
-        self.client.delete_network_interface(
181
-            NetworkInterfaceId=ni_id2)
182
-        self.cancelResourceCleanUp(clean_ni2)
183
-        self.get_network_interface_waiter().wait_delete(ni_id2)
184
-
185
-        self.client.delete_network_interface(
186
-            NetworkInterfaceId=ni_id1)
187
-        self.cancelResourceCleanUp(clean_ni1)
188
-        self.get_network_interface_waiter().wait_delete(ni_id1)
189
-
190
-    @decorators.idempotent_id('a7dc520a-e828-4347-91e1-385c4e0e6070')
191
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
192
-    def test_create_instance_with_private_ip(self):
193
-        ip = '10.16.0.12'
194
-
195
-        instance_id = self.run_instance(SubnetId=self.subnet_id,
196
-                                        PrivateIpAddress=ip)
197
-
198
-        instance = self.get_instance(instance_id)
199
-        self.assertEqual(ip, instance['PrivateIpAddress'])
200
-
201
-        self.client.terminate_instances(InstanceIds=[instance_id])
202
-        self.get_instance_waiter().wait_delete(instance_id)
203
-
204
-    @decorators.idempotent_id('582ac8ed-58e7-4f27-bd65-35b999241c63')
205
-    @testtools.skipUnless(CONF.aws.image_id, "image id is not defined")
206
-    def test_create_instance_with_invalid_params(self):
207
-        def _rollback(fn_data):
208
-            self.client.terminate_instances(
209
-                InstanceIds=[fn_data['Instances'][0]['InstanceId']])
210
-
211
-        kwargs = {
212
-            'ImageId': CONF.aws.image_id,
213
-            'InstanceType': CONF.aws.instance_type,
214
-            'MinCount': 1,
215
-            'MaxCount': 1,
216
-            'PrivateIpAddress': '10.16.1.2'
217
-        }
218
-        ex_str = ('InvalidParameterCombination'
219
-                  if base.TesterStateHolder().get_ec2_enabled() else
220
-                  'InvalidParameterValue')
221
-        self.assertRaises(ex_str,
222
-            self.client.run_instances, rollback_fn=_rollback,
223
-            **kwargs)
224
-
225
-        kwargs = {
226
-            'ImageId': CONF.aws.image_id,
227
-            'InstanceType': CONF.aws.instance_type,
228
-            'MinCount': 1,
229
-            'MaxCount': 1,
230
-            'SubnetId': self.subnet_id,
231
-            'PrivateIpAddress': '10.16.1.12'
232
-        }
233
-        self.assertRaises('InvalidParameterValue',
234
-            self.client.run_instances, rollback_fn=_rollback,
235
-            **kwargs)
236
-
237
-        kwargs = {
238
-            'SubnetId': self.subnet_id,
239
-        }
240
-        data = self.client.create_network_interface(*[], **kwargs)
241
-        ni_id1 = data['NetworkInterface']['NetworkInterfaceId']
242
-        self.addResourceCleanUp(self.client.delete_network_interface,
243
-                                NetworkInterfaceId=ni_id1)
244
-        self.get_network_interface_waiter().wait_available(ni_id1)
245
-
246
-        kwargs = {
247
-            'SubnetId': self.subnet_id,
248
-        }
249
-        data = self.client.create_network_interface(*[], **kwargs)
250
-        ni_id2 = data['NetworkInterface']['NetworkInterfaceId']
251
-        self.addResourceCleanUp(self.client.delete_network_interface,
252
-                                NetworkInterfaceId=ni_id2)
253
-        self.get_network_interface_waiter().wait_available(ni_id2)
254
-
255
-        # NOTE(andrey-mp): A network interface may not specify a network
256
-        # interface ID and delete on termination as true
257
-        kwargs = {
258
-            'ImageId': CONF.aws.image_id,
259
-            'InstanceType': CONF.aws.instance_type,
260
-            'MinCount': 1,
261
-            'MaxCount': 1,
262
-            'NetworkInterfaces': [{'NetworkInterfaceId': ni_id1,
263
-                                   'DeviceIndex': 0,
264
-                                   'DeleteOnTermination': True}]
265
-        }
266
-        self.assertRaises('InvalidParameterCombination',
267
-            self.client.run_instances, rollback_fn=_rollback,
268
-            **kwargs)
269
-
270
-        if CONF.aws.run_incompatible_tests:
271
-            # NOTE(andrey-mp): Each network interface requires a device index.
272
-            kwargs = {
273
-                'ImageId': CONF.aws.image_id,
274
-                'InstanceType': CONF.aws.instance_type,
275
-                'MinCount': 1,
276
-                'MaxCount': 1,
277
-                'NetworkInterfaces': [{'NetworkInterfaceId': ni_id1},
278
-                                      {'NetworkInterfaceId': ni_id2}]
279
-            }
280
-            self.assertRaises('InvalidParameterValue',
281
-                self.client.run_instances, rollback_fn=_rollback,
282
-                **kwargs)

+ 0
- 223
ec2api/tests/functional/api/test_internet_gateways.py View File

@@ -1,223 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-import time
17
-
18
-from oslo_log import log
19
-from tempest.lib import decorators
20
-import testtools
21
-
22
-from ec2api.tests.functional import base
23
-from ec2api.tests.functional import config
24
-
25
-CONF = config.CONF
26
-LOG = log.getLogger(__name__)
27
-
28
-
29
-class InternetGatewayTest(base.EC2TestCase):
30
-
31
-    VPC_CIDR = '10.4.0.0/20'
32
-    VPC_CIDR_ALT = '10.5.0.0/20'
33
-    vpc_id = None
34
-    vpc_id_alt = None
35
-
36
-    @classmethod
37
-    @base.safe_setup
38
-    def setUpClass(cls):
39
-        super(InternetGatewayTest, cls).setUpClass()
40
-        if not base.TesterStateHolder().get_vpc_enabled():
41
-            raise cls.skipException('VPC is disabled')
42
-
43
-        data = cls.client.create_vpc(CidrBlock=cls.VPC_CIDR)
44
-        cls.vpc_id = data['Vpc']['VpcId']
45
-        cls.get_vpc_waiter().wait_available(cls.vpc_id)
46
-        cls.addResourceCleanUpStatic(cls.client.delete_vpc, VpcId=cls.vpc_id)
47
-
48
-        data = cls.client.create_vpc(CidrBlock=cls.VPC_CIDR_ALT)
49
-        cls.vpc_id_alt = data['Vpc']['VpcId']
50
-        cls.get_vpc_waiter().wait_available(cls.vpc_id_alt)
51
-        cls.addResourceCleanUpStatic(cls.client.delete_vpc,
52
-                                     VpcId=cls.vpc_id_alt)
53
-
54
-    @decorators.idempotent_id('f2d40306-4b18-4e17-90a5-371db0ddc7cb')
55
-    def test_create_attach_internet_gateway(self):
56
-        data = self.client.create_internet_gateway()
57
-        gw_id = data['InternetGateway']['InternetGatewayId']
58
-        res_clean = self.addResourceCleanUp(
59
-            self.client.delete_internet_gateway, InternetGatewayId=gw_id)
60
-        self.assertEmpty(data['InternetGateway'].get('Attachments', []))
61
-
62
-        data = self.client.attach_internet_gateway(VpcId=self.vpc_id,
63
-                                                   InternetGatewayId=gw_id)
64
-
65
-        data = self.client.detach_internet_gateway(VpcId=self.vpc_id,
66
-                                                   InternetGatewayId=gw_id)
67
-
68
-        data = self.client.delete_internet_gateway(InternetGatewayId=gw_id)
69
-        self.cancelResourceCleanUp(res_clean)
70
-
71
-        self.assertRaises('InvalidInternetGatewayID.NotFound',
72
-                          self.client.describe_internet_gateways,
73
-                          InternetGatewayIds=[gw_id])
74
-
75
-    @decorators.idempotent_id('f092b63d-9460-4d8f-ba8a-bcd380666033')
76
-    def test_delete_attached_internet_gateway(self):
77
-        data = self.client.create_internet_gateway()
78
-        gw_id = data['InternetGateway']['InternetGatewayId']
79
-        res_clean = self.addResourceCleanUp(
80
-            self.client.delete_internet_gateway, InternetGatewayId=gw_id)
81
-        self.assertEmpty(data['InternetGateway'].get('Attachments', []))
82
-
83
-        data = self.client.attach_internet_gateway(VpcId=self.vpc_id,
84
-                                                   InternetGatewayId=gw_id)
85
-
86
-        self.assertRaises('DependencyViolation',
87
-                          self.client.delete_internet_gateway,
88
-                          InternetGatewayId=gw_id)
89
-
90
-        data = self.client.detach_internet_gateway(VpcId=self.vpc_id,
91
-                                                   InternetGatewayId=gw_id)
92
-
93
-        data = self.client.delete_internet_gateway(InternetGatewayId=gw_id)
94
-        self.cancelResourceCleanUp(res_clean)
95
-
96
-    @decorators.idempotent_id('89700013-5753-4608-8245-4fc99fbb67ea')
97
-    @testtools.skipUnless(CONF.aws.run_incompatible_tests,
98
-        "Another error code returned - InvalidParameterValue")
99
-    def test_attach_detach_invalid_internet_gateway(self):
100
-        gw_id = "gw-1"
101
-        self.assertRaises('InvalidInternetGatewayID.NotFound',
102
-                          self.client.attach_internet_gateway,
103
-                          VpcId=self.vpc_id, InternetGatewayId=gw_id)
104
-
105
-        self.assertRaises('InvalidInternetGatewayID.NotFound',
106
-                          self.client.detach_internet_gateway,
107
-                          VpcId=self.vpc_id, InternetGatewayId=gw_id)
108
-
109
-    @decorators.idempotent_id('e3e4d8c4-8f62-43e8-a24d-bfd292b4144c')
110
-    def test_double_attach_internet_gateway(self):
111
-        data = self.client.create_internet_gateway()
112
-        gw_id = data['InternetGateway']['InternetGatewayId']
113
-        res_clean = self.addResourceCleanUp(
114
-            self.client.delete_internet_gateway, InternetGatewayId=gw_id)
115
-        self.assertEmpty(data['InternetGateway'].get('Attachments', []))
116
-
117
-        data = self.client.attach_internet_gateway(VpcId=self.vpc_id,
118
-                                                   InternetGatewayId=gw_id)
119
-
120
-        self.assertRaises('Resource.AlreadyAssociated',
121
-                          self.client.attach_internet_gateway,
122
-                          VpcId=self.vpc_id, InternetGatewayId=gw_id)
123
-
124
-        data = self.client.detach_internet_gateway(VpcId=self.vpc_id,
125
-                                                   InternetGatewayId=gw_id)
126
-
127
-        data = self.client.delete_internet_gateway(InternetGatewayId=gw_id)
128
-        self.cancelResourceCleanUp(res_clean)
129
-
130
-    @decorators.idempotent_id('d8f3a488-a4ba-4ed5-998c-3dc6f43d6d9e')
131
-    def test_attach_one_internet_gateway_to_two_vpcs(self):
132
-        data = self.client.create_internet_gateway()
133
-        gw_id = data['InternetGateway']['InternetGatewayId']
134
-        res_clean = self.addResourceCleanUp(
135
-            self.client.delete_internet_gateway, InternetGatewayId=gw_id)
136
-        self.assertEmpty(data['InternetGateway'].get('Attachments', []))
137
-
138
-        data = self.client.attach_internet_gateway(VpcId=self.vpc_id,
139
-                                                   InternetGatewayId=gw_id)
140
-
141
-        self.assertRaises('Resource.AlreadyAssociated',
142
-                          self.client.attach_internet_gateway,
143
-                          VpcId=self.vpc_id_alt, InternetGatewayId=gw_id)
144
-
145
-        data = self.client.detach_internet_gateway(VpcId=self.vpc_id,
146
-                                                   InternetGatewayId=gw_id)
147
-
148
-        data = self.client.delete_internet_gateway(InternetGatewayId=gw_id)
149
-        self.cancelResourceCleanUp(res_clean)
150
-
151
-    @decorators.idempotent_id('b86f338c-613e-4cd7-9742-07c86864b0da')
152
-    def test_describe_internet_gateways_base(self):
153
-        data = self.client.create_internet_gateway()
154
-        gw_id = data['InternetGateway']['InternetGatewayId']
155
-        res_clean = self.addResourceCleanUp(
156
-            self.client.delete_internet_gateway, InternetGatewayId=gw_id)
157
-        self.assertEmpty(data['InternetGateway'].get('Attachments', []))
158
-
159
-        data = self.client.attach_internet_gateway(VpcId=self.vpc_id,
160
-                                                   InternetGatewayId=gw_id)
161
-        self.addResourceCleanUp(self.client.detach_internet_gateway,
162
-                                VpcId=self.vpc_id,
163
-                                InternetGatewayId=gw_id)
164
-
165
-        time.sleep(2)
166
-        # NOTE(andrey-mp): by real id
167
-        data = self.client.describe_internet_gateways(
168
-            InternetGatewayIds=[gw_id])
169
-        self.assertEqual(1, len(data['InternetGateways']))
170
-
171
-        # NOTE(andrey-mp): by fake id
172
-        self.assertRaises('InvalidInternetGatewayID.NotFound',
173
-                          self.client.describe_internet_gateways,
174
-                          InternetGatewayIds=['igw-0'])
175
-
176
-        data = self.client.detach_internet_gateway(VpcId=self.vpc_id,
177
-                                                       InternetGatewayId=gw_id)
178
-
179
-        data = self.client.delete_internet_gateway(InternetGatewayId=gw_id)
180
-        self.cancelResourceCleanUp(res_clean)
181
-
182
-    @decorators.idempotent_id('3f141c56-9ee6-46bf-9c14-0d922ed8a482')
183
-    def test_describe_internet_gateways_filters(self):
184
-        # NOTE(andrey-mp): by filter real vpc-id before creation
185
-        data = self.client.describe_internet_gateways(
186
-            Filters=[{'Name': 'attachment.vpc-id', 'Values': [self.vpc_id]}])
187
-        self.assertEqual(0, len(data['InternetGateways']))
188
-
189
-        data = self.client.create_internet_gateway()
190
-        gw_id = data['InternetGateway']['InternetGatewayId']
191
-        res_clean = self.addResourceCleanUp(
192
-            self.client.delete_internet_gateway, InternetGatewayId=gw_id)
193
-        self.assertEmpty(data['InternetGateway'].get('Attachments', []))
194
-
195
-        data = self.client.attach_internet_gateway(VpcId=self.vpc_id,
196
-                                                   InternetGatewayId=gw_id)
197
-        self.addResourceCleanUp(self.client.detach_internet_gateway,
198
-                                VpcId=self.vpc_id,
199
-                                InternetGatewayId=gw_id)
200
-
201
-        time.sleep(2)
202
-        # NOTE(andrey-mp): by filter real vpc-id
203
-        data = self.client.describe_internet_gateways(
204
-            Filters=[{'Name': 'attachment.vpc-id', 'Values': [self.vpc_id]}])
205
-        self.assertEqual(1, len(data['InternetGateways']))
206
-        self.assertEqual(gw_id,
207
-                         data['InternetGateways'][0]['InternetGatewayId'])
208
-
209
-        # NOTE(andrey-mp): by filter fake vpc-id
210
-        data = self.client.describe_internet_gateways(
211
-            Filters=[{'Name': 'attachment.vpc-id', 'Values': ['vpc-0']}])
212
-        self.assertEqual(0, len(data['InternetGateways']))
213
-
214
-        # NOTE(andrey-mp): by fake filter
215
-        self.assertRaises('InvalidParameterValue',
216
-                          self.client.describe_internet_gateways,
217
-                          Filters=[{'Name': 'fake', 'Values': ['fake']}])
218
-
219
-        data = self.client.detach_internet_gateway(VpcId=self.vpc_id,
220
-                                                   InternetGatewayId=gw_id)
221
-
222
-        data = self.client.delete_internet_gateway(InternetGatewayId=gw_id)
223
-        self.cancelResourceCleanUp(res_clean)

+ 0
- 149
ec2api/tests/functional/api/test_key_pairs.py View File

@@ -1,149 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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.
15
-
16
-from tempest.lib import decorators
17
-import testtools
18
-
19
-from ec2api.tests.functional import base
20
-from ec2api.tests.functional import config
21
-
22
-CONF = config.CONF
23
-
24
-
25
-class KeyPairTest(base.EC2TestCase):
26
-
27
-    @decorators.idempotent_id('15cfd866-d6bb-473a-9b8a-6420900a5ca3')
28
-    def test_create_delete_key_pair(self):
29
-        keyName = 'Test key'
30
-        data = self.client.create_key_pair(KeyName=keyName)
31
-        res_clean = self.addResourceCleanUp(self.client.delete_key_pair,
32
-                                            KeyName=keyName)
33
-
34
-        self.assertEqual(keyName, data['KeyName'])
35
-        self.assertIsNotNone(data.get('KeyFingerprint'))
36
-        self.assertGreater(len(data['KeyFingerprint']), 0)
37
-        self.assertGreater(len(data.get('KeyMaterial')), 0)
38
-
39
-        data = self.client.delete_key_pair(KeyName=keyName)
40
-        self.cancelResourceCleanUp(res_clean)
41
-
42
-    @decorators.idempotent_id('05478a51-1505-42a8-8c7d-4fd7e32c467e')
43
-    def test_create_duplicate_key_pair(self):
44
-        keyName = 'Test key'
45
-        self.client.create_key_pair(KeyName=keyName)
46
-        res_clean = self.addResourceCleanUp(self.client.delete_key_pair,
47
-                                            KeyName=keyName)
48
-
49
-        self.assertRaises('InvalidKeyPair.Duplicate',
50
-                          self.client.create_key_pair,
51
-                          KeyName=keyName)
52
-
53
-        self.client.delete_key_pair(KeyName=keyName)
54
-        self.cancelResourceCleanUp(res_clean)
55
-
56
-    @decorators.idempotent_id('43d87b6e-6667-4d19-8c0b-e73901105bb7')
57
-    def test_describe_key_pairs(self):
58
-        keyName = 'Test key'
59
-        data = self.client.create_key_pair(KeyName=keyName)
60
-        res_clean = self.addResourceCleanUp(self.client.delete_key_pair,
61
-                                            KeyName=keyName)
62
-        self.assertIsNotNone(data.get('KeyFingerprint'))
63
-        self.assertGreater(len(data['KeyFingerprint']), 0)
64
-        fingerprint = data.get('KeyFingerprint')
65
-
66
-        data = self.client.describe_key_pairs(KeyNames=[keyName])
67
-        self.assertEqual(1, len(data.get('KeyPairs')))
68
-        data = data['KeyPairs'][0]
69
-        self.assertEqual(keyName, data['KeyName'])
70
-        self.assertIsNotNone(data.get('KeyFingerprint'))
71
-        self.assertGreater(len(data['KeyFingerprint']), 0)
72
-        self.assertIsNone(data.get('KeyMaterial'))
73
-
74
-        data = self.client.describe_key_pairs(
75
-            Filters=[{'Name': 'key-name', 'Values': [keyName]}])
76
-        self.assertEqual(1, len(data.get('KeyPairs')))
77
-        self.assertEqual(keyName, data['KeyPairs'][0]['KeyName'])
78
-
79
-        data = self.client.describe_key_pairs(
80
-            Filters=[{'Name': 'fingerprint', 'Values': [fingerprint]}])
81
-        self.assertEqual(1, len(data.get('KeyPairs')))
82
-        self.assertEqual(keyName, data['KeyPairs'][0]['KeyName'])
83
-
84
-        self.assertRaises('InvalidKeyPair.NotFound',
85
-                          self.client.describe_key_pairs,
86
-                          KeyNames=['fake key'])
87
-
88
-        data = self.client.delete_key_pair(KeyName=keyName)
89
-        self.cancelResourceCleanUp(res_clean)
90
-
91
-        self.assertRaises('InvalidKeyPair.NotFound',
92
-                          self.client.describe_key_pairs,
93
-                          KeyNames=[keyName])
94
-
95
-        # NOTE(andrey-mp): Amazon allows to delete absent key and returns 200
96
-        self.client.delete_key_pair(KeyName=keyName)
97
-
98
-    @decorators.idempotent_id('0e51eec5-3f61-4d8a-89c9-8d098f381682')
99
-    def test_import_empty_key_pair(self):
100
-        keyName = 'Test key'
101
-        publicKey = ''
102
-
103
-        def _rollback(fn_data):
104
-            self.client.delete_key_pair(KeyName=keyName)
105
-
106
-        self.assertRaises('MissingParameter',
107
-                          self.client.import_key_pair,
108
-                          rollback_fn=_rollback,
109
-                          KeyName=keyName, PublicKeyMaterial=publicKey)
110
-
111
-    @decorators.idempotent_id('478c17e6-b7ca-4115-bee2-be279bdd0f65')
112
-    @testtools.skipUnless(CONF.aws.run_incompatible_tests,
113
-                          "Different error code")
114
-    def test_import_invalid_key_pair(self):
115
-        keyName = 'Test key'
116
-        publicKey = 'ssh-rsa JUNK test@ubuntu'
117
-
118
-        def _rollback():
119
-            self.client.delete_key_pair(KeyName=keyName)
120
-
121
-        self.assertRaises('InvalidKey.Format',
122
-                          self.client.import_key_pair,
123
-                          rollback_fn=_rollback,
124
-                          KeyName=keyName, PublicKeyMaterial=publicKey)
125
-
126
-    @decorators.idempotent_id('eda525d6-144b-4840-b6ba-e18d93e3589f')
127
-    def test_import_key_pair(self):
128
-        keyName = 'Test key'
129
-        publicKey = ("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCs"
130
-                     "Ne3/1ILNCqFyfYWDeTKLD6jEXC2OQHLmietMWW+/vd"
131
-                     "aZq7KZEwO0jhglaFjU1mpqq4Gz5RX156sCTNM9vRbw"
132
-                     "KAxfsdF9laBYVsex3m3Wmui3uYrKyumsoJn2g9GNnG1P"
133
-                     "I1mrVjZ61i0GY3khna+wzlTpCCmy5HNlrmbj3XLqBUpip"
134
-                     "TOXmsnr4sChzC53KCd8LXuwc1i/CZPvF+3XipvAgFSE53pCt"
135
-                     "LOeB1kYMOBaiUPLQTWXR3JpckqFIQwhIH0zoHlJvZE8hh90"
136
-                     "XcPojYN56tI0OlrGqojbediJYD0rUsJu4weZpbn8vilb3JuDY+jws"
137
-                     "snSA8wzBx3A/8y9Pp1B test@ubuntu")
138
-        data = self.client.import_key_pair(KeyName=keyName,
139
-                                           PublicKeyMaterial=publicKey)
140
-        res_clean = self.addResourceCleanUp(self.client.delete_key_pair,
141
-                                            KeyName=keyName)
142
-
143
-        self.assertEqual(keyName, data['KeyName'])
144
-        self.assertIsNotNone(data.get('KeyFingerprint'))
145
-        self.assertGreater(len(data['KeyFingerprint']), 0)
146
-        self.assertIsNone(data.get('KeyMaterial'))
147
-
148
-        self.client.delete_key_pair(KeyName=keyName)
149
-        self.cancelResourceCleanUp(res_clean)

+ 0
- 582
ec2api/tests/functional/api/test_network_interfaces.py View File

@@ -1,582 +0,0 @@
1
-# Copyright 2014 OpenStack Foundation
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