blob: af6aa8bcc361ce383a81bffa62a0ea50e8eefb69 [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")
29 @test.attr(type='smoke')
Attila Fazekasa23f5002012-10-23 19:32:45 +020030 def test_create_and_get_delete_bucket(self):
Sean Dague64ef48d2013-01-03 17:54:36 -050031 # S3 Create, get and delete bucket
Masayuki Igawa259c1132013-10-31 17:48:44 +090032 bucket_name = data_utils.rand_name("s3bucket-")
Attila Fazekasa23f5002012-10-23 19:32:45 +020033 cleanup_key = self.addResourceCleanUp(self.client.delete_bucket,
34 bucket_name)
35 bucket = self.client.create_bucket(bucket_name)
36 self.assertTrue(bucket.name == bucket_name)
37 bucket = self.client.get_bucket(bucket_name)
38 self.assertTrue(bucket.name == bucket_name)
39 self.client.delete_bucket(bucket_name)
40 self.assertBotoError(self.s3_error_code.client.NoSuchBucket,
41 self.client.get_bucket, bucket_name)
42 self.cancelResourceCleanUp(cleanup_key)