ivan-zhu | 566fc3d | 2013-12-17 16:03:50 +0800 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
| 2 | # 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 | |
| 16 | from tempest.api.compute import base |
| 17 | from tempest.test import attr |
| 18 | |
| 19 | |
ivan-zhu | 0e06292 | 2013-12-17 16:14:12 +0800 | [diff] [blame] | 20 | class CertificatesV3TestJSON(base.BaseV3ComputeTest): |
ivan-zhu | 566fc3d | 2013-12-17 16:03:50 +0800 | [diff] [blame] | 21 | _interface = 'json' |
| 22 | |
| 23 | @attr(type='gate') |
| 24 | def test_create_and_get_root_certificate(self): |
| 25 | # create certificates |
| 26 | resp, create_body = self.certificates_client.create_certificate() |
ivan-zhu | 0e06292 | 2013-12-17 16:14:12 +0800 | [diff] [blame] | 27 | self.assertEqual(201, resp.status) |
ivan-zhu | 566fc3d | 2013-12-17 16:03:50 +0800 | [diff] [blame] | 28 | self.assertIn('data', create_body) |
| 29 | self.assertIn('private_key', create_body) |
| 30 | # get the root certificate |
| 31 | resp, body = self.certificates_client.get_certificate('root') |
| 32 | self.assertEqual(200, resp.status) |
| 33 | self.assertIn('data', body) |
| 34 | self.assertIn('private_key', body) |