dwalleck | 5d73443 | 2012-10-04 01:11:47 -0500 | [diff] [blame] | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 |
| 2 | |
| 3 | # Copyright 2012 OpenStack, LLC |
| 4 | # 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 | |
| 18 | import nose |
| 19 | import unittest2 as unittest |
| 20 | |
Matthew Treinish | 481466b | 2012-12-20 17:16:01 -0500 | [diff] [blame] | 21 | from tempest import clients |
dwalleck | 5d73443 | 2012-10-04 01:11:47 -0500 | [diff] [blame] | 22 | import tempest.config |
| 23 | from tempest import exceptions |
harika-vakadi | 2daed0a | 2013-01-01 20:51:39 +0530 | [diff] [blame] | 24 | from tempest.tests.identity.base import DataGenerator |
dwalleck | 5d73443 | 2012-10-04 01:11:47 -0500 | [diff] [blame] | 25 | |
| 26 | |
| 27 | class BaseObjectTest(unittest.TestCase): |
| 28 | |
| 29 | @classmethod |
| 30 | def setUpClass(cls): |
Matthew Treinish | 481466b | 2012-12-20 17:16:01 -0500 | [diff] [blame] | 31 | cls.os = clients.Manager() |
dwalleck | 5d73443 | 2012-10-04 01:11:47 -0500 | [diff] [blame] | 32 | cls.object_client = cls.os.object_client |
| 33 | cls.container_client = cls.os.container_client |
| 34 | cls.account_client = cls.os.account_client |
| 35 | cls.config = cls.os.config |
harika-vakadi | 1a9ad61 | 2012-12-14 19:12:08 +0530 | [diff] [blame] | 36 | cls.custom_object_client = cls.os.custom_object_client |
harika-vakadi | 2daed0a | 2013-01-01 20:51:39 +0530 | [diff] [blame] | 37 | cls.os_admin = clients.IdentityManager() |
| 38 | cls.token_client = cls.os_admin.token_client |
| 39 | cls.admin_client = cls.os_admin.admin_client |
| 40 | cls.custom_account_client = cls.os.custom_account_client |
| 41 | cls.os_alt = clients.AltManager() |
| 42 | cls.object_client_alt = cls.os_alt.object_client |
| 43 | cls.container_client_alt = cls.os_alt.container_client |
| 44 | cls.admin_client_alt = cls.os_alt.admin_client |
| 45 | |
| 46 | cls.data = DataGenerator(cls.admin_client) |
dwalleck | 5d73443 | 2012-10-04 01:11:47 -0500 | [diff] [blame] | 47 | |
| 48 | try: |
| 49 | cls.account_client.list_account_containers() |
| 50 | except exceptions.EndpointNotFound: |
| 51 | enabled = False |
| 52 | skip_msg = "No OpenStack Object Storage API endpoint" |
| 53 | raise nose.SkipTest(skip_msg) |