blob: a75fb7b269f8f0321a98ece9cdd2a0dfec939c7d [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2012 OpenStack Foundation
Attila Fazekasa23f5002012-10-23 19:32:45 +02002# 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
Masayuki Igawa224a8272014-02-17 15:07:43 +090016from tempest import test
17from tempest.thirdparty.boto import test as boto_test
Attila Fazekasa23f5002012-10-23 19:32:45 +020018
19
Masayuki Igawa224a8272014-02-17 15:07:43 +090020class EC2NetworkTest(boto_test.BotoTestCase):
Attila Fazekasa23f5002012-10-23 19:32:45 +020021
22 @classmethod
Andrea Frittoli29fea352014-09-15 13:31:14 +010023 def resource_setup(cls):
24 super(EC2NetworkTest, cls).resource_setup()
Attila Fazekasa23f5002012-10-23 19:32:45 +020025 cls.client = cls.os.ec2api_client
26
Giulio Fidente83181a92013-10-01 06:02:24 +020027 # Note(afazekas): these tests for things duable without an instance
Masayuki Igawa224a8272014-02-17 15:07:43 +090028 @test.skip_because(bug="1080406")
Attila Fazekasa23f5002012-10-23 19:32:45 +020029 def test_disassociate_not_associated_floating_ip(self):
Sean Dague64ef48d2013-01-03 17:54:36 -050030 # EC2 disassociate not associated floating ip
Attila Fazekasa23f5002012-10-23 19:32:45 +020031 ec2_codes = self.ec2_error_code
32 address = self.client.allocate_address()
33 public_ip = address.public_ip
34 rcuk = self.addResourceCleanUp(self.client.release_address, public_ip)
35 addresses_get = self.client.get_all_addresses(addresses=(public_ip,))
36 self.assertEqual(len(addresses_get), 1)
37 self.assertEqual(addresses_get[0].public_ip, public_ip)
38 self.assertBotoError(ec2_codes.client.InvalidAssociationID.NotFound,
39 address.disassociate)
40 self.client.release_address(public_ip)
41 self.cancelResourceCleanUp(rcuk)
Attila Fazekasfa756cb2013-02-12 10:52:42 +010042 self.assertAddressReleasedWait(address)