Malini Kamalambal | 6e7b3b8 | 2014-02-06 06:49:04 -0500 | [diff] [blame] | 1 | # Copyright (c) 2014 Rackspace, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 12 | # implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | import logging |
| 17 | |
| 18 | from tempest.api.queuing import base |
| 19 | from tempest.common.utils import data_utils |
| 20 | from tempest import test |
| 21 | |
| 22 | |
| 23 | LOG = logging.getLogger(__name__) |
| 24 | |
| 25 | |
| 26 | class TestQueues(base.BaseQueuingTest): |
| 27 | |
| 28 | @test.attr(type='smoke') |
| 29 | def test_create_queue(self): |
| 30 | # Create Queue |
| 31 | queue_name = data_utils.rand_name('test-') |
| 32 | resp, body = self.create_queue(queue_name) |
| 33 | |
| 34 | self.addCleanup(self.client.delete_queue, queue_name) |
| 35 | |
| 36 | self.assertEqual('201', resp['status']) |
| 37 | self.assertEqual('', body) |
Jorge Chai | 4f5896e | 2014-02-17 14:34:54 -0500 | [diff] [blame^] | 38 | |
| 39 | |
| 40 | class TestManageQueue(base.BaseQueuingTest): |
| 41 | _interface = 'json' |
| 42 | |
| 43 | @classmethod |
| 44 | def setUpClass(cls): |
| 45 | super(TestManageQueue, cls).setUpClass() |
| 46 | cls.queue_name = data_utils.rand_name('Queues-Test') |
| 47 | # Create Queue |
| 48 | cls.client.create_queue(cls.queue_name) |
| 49 | |
| 50 | @test.attr(type='smoke') |
| 51 | def test_delete_queue(self): |
| 52 | # Delete Queue |
| 53 | resp, body = self.delete_queue(self.queue_name) |
| 54 | self.assertEqual('204', resp['status']) |
| 55 | self.assertEqual('', body) |
| 56 | |
| 57 | @classmethod |
| 58 | def tearDownClass(cls): |
| 59 | cls.client.delete_queue(cls.queue_name) |
| 60 | super(TestManageQueue, cls).tearDownClass() |