ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +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 |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 17 | from tempest import test |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 18 | |
| 19 | |
| 20 | class CertificatesTestJSON(base.BaseV2ComputeTest): |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 21 | |
Yuiko Takada | e9999d6 | 2014-03-06 09:22:54 +0000 | [diff] [blame] | 22 | @test.attr(type='gate') |
Eiichi Aikawa | a30e519 | 2014-03-31 14:58:12 +0900 | [diff] [blame^] | 23 | def test_create_root_certificate(self): |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 24 | # create certificates |
Eiichi Aikawa | a30e519 | 2014-03-31 14:58:12 +0900 | [diff] [blame^] | 25 | resp, body = self.certificates_client.create_certificate() |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 26 | self.assertEqual(200, resp.status) |
Eiichi Aikawa | a30e519 | 2014-03-31 14:58:12 +0900 | [diff] [blame^] | 27 | self.assertIn('data', body) |
| 28 | self.assertIn('private_key', body) |
| 29 | |
| 30 | @test.attr(type='gate') |
| 31 | def test_get_root_certificate(self): |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 32 | # get the root certificate |
| 33 | resp, body = self.certificates_client.get_certificate('root') |
| 34 | self.assertEqual(200, resp.status) |
| 35 | self.assertIn('data', body) |
| 36 | self.assertIn('private_key', body) |
| 37 | |
| 38 | |
| 39 | class CertificatesTestXML(CertificatesTestJSON): |
| 40 | _interface = 'xml' |