blob: b4949c83876728b7c78b7e89d7aac37b7aa116f4 [file] [log] [blame]
Attila Fazekasa23f5002012-10-23 19:32:45 +02001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
ZhiQiang Fan39f97222013-09-20 04:49:44 +08003# Copyright 2012 OpenStack Foundation
Attila Fazekasa23f5002012-10-23 19:32:45 +02004# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
Matthew Treinish481466b2012-12-20 17:16:01 -050018from tempest import clients
Chris Yeoh01cb2792013-02-09 22:25:37 +103019from tempest.test import attr
Giulio Fidente83181a92013-10-01 06:02:24 +020020from tempest.test import skip_because
Sean Dague09761f62013-05-13 15:20:40 -040021from tempest.thirdparty.boto.test import BotoTestCase
Attila Fazekasa23f5002012-10-23 19:32:45 +020022
23
Attila Fazekasa23f5002012-10-23 19:32:45 +020024class EC2NetworkTest(BotoTestCase):
25
26 @classmethod
27 def setUpClass(cls):
28 super(EC2NetworkTest, cls).setUpClass()
Matthew Treinish481466b2012-12-20 17:16:01 -050029 cls.os = clients.Manager()
Attila Fazekasa23f5002012-10-23 19:32:45 +020030 cls.client = cls.os.ec2api_client
31
Giulio Fidente83181a92013-10-01 06:02:24 +020032 # Note(afazekas): these tests for things duable without an instance
33 @skip_because(bug="1080406")
Attila Fazekasa23f5002012-10-23 19:32:45 +020034 @attr(type='smoke')
35 def test_disassociate_not_associated_floating_ip(self):
Sean Dague64ef48d2013-01-03 17:54:36 -050036 # EC2 disassociate not associated floating ip
Attila Fazekasa23f5002012-10-23 19:32:45 +020037 ec2_codes = self.ec2_error_code
38 address = self.client.allocate_address()
39 public_ip = address.public_ip
40 rcuk = self.addResourceCleanUp(self.client.release_address, public_ip)
41 addresses_get = self.client.get_all_addresses(addresses=(public_ip,))
42 self.assertEqual(len(addresses_get), 1)
43 self.assertEqual(addresses_get[0].public_ip, public_ip)
44 self.assertBotoError(ec2_codes.client.InvalidAssociationID.NotFound,
45 address.disassociate)
46 self.client.release_address(public_ip)
47 self.cancelResourceCleanUp(rcuk)
Attila Fazekasfa756cb2013-02-12 10:52:42 +010048 self.assertAddressReleasedWait(address)