blob: 3a8dc89480d4cf97dc91c278597c68960eb40567 [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 Igawa259c1132013-10-31 17:48:44 +090016from tempest.common.utils import data_utils
Masayuki Igawa224a8272014-02-17 15:07:43 +090017from tempest import test
18from tempest.thirdparty.boto import test as boto_test
Attila Fazekasa23f5002012-10-23 19:32:45 +020019
20
Masayuki Igawa224a8272014-02-17 15:07:43 +090021class S3BucketsTest(boto_test.BotoTestCase):
Attila Fazekasa23f5002012-10-23 19:32:45 +020022
23 @classmethod
24 def setUpClass(cls):
25 super(S3BucketsTest, cls).setUpClass()
Attila Fazekasa23f5002012-10-23 19:32:45 +020026 cls.client = cls.os.s3_client
Attila Fazekasa23f5002012-10-23 19:32:45 +020027
Masayuki Igawa224a8272014-02-17 15:07:43 +090028 @test.skip_because(bug="1076965")
Attila Fazekasa23f5002012-10-23 19:32:45 +020029 def test_create_and_get_delete_bucket(self):
Sean Dague64ef48d2013-01-03 17:54:36 -050030 # S3 Create, get and delete bucket
Masayuki Igawa259c1132013-10-31 17:48:44 +090031 bucket_name = data_utils.rand_name("s3bucket-")
Attila Fazekasa23f5002012-10-23 19:32:45 +020032 cleanup_key = self.addResourceCleanUp(self.client.delete_bucket,
33 bucket_name)
34 bucket = self.client.create_bucket(bucket_name)
35 self.assertTrue(bucket.name == bucket_name)
36 bucket = self.client.get_bucket(bucket_name)
37 self.assertTrue(bucket.name == bucket_name)
38 self.client.delete_bucket(bucket_name)
39 self.assertBotoError(self.s3_error_code.client.NoSuchBucket,
40 self.client.get_bucket, bucket_name)
41 self.cancelResourceCleanUp(cleanup_key)