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 | |
Ken'ichi Ohmichi | 9f5adf8 | 2014-12-12 04:01:32 +0000 | [diff] [blame] | 20 | class CertificatesV2TestJSON(base.BaseComputeTest): |
Ghanshyam | 1fa9355 | 2014-05-07 18:09:49 +0900 | [diff] [blame] | 21 | |
Ken'ichi Ohmichi | 9f5adf8 | 2014-12-12 04:01:32 +0000 | [diff] [blame] | 22 | _api_version = 2 |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 23 | |
Chris Hoge | 7579c1a | 2015-02-26 14:12:15 -0800 | [diff] [blame] | 24 | @test.idempotent_id('c070a441-b08e-447e-a733-905909535b1b') |
Eiichi Aikawa | a30e519 | 2014-03-31 14:58:12 +0900 | [diff] [blame] | 25 | def test_create_root_certificate(self): |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 26 | # create certificates |
ghanshyam | c7e09bf | 2015-08-04 15:42:24 +0900 | [diff] [blame] | 27 | body = self.certificates_client.create_certificate()['certificate'] |
Eiichi Aikawa | a30e519 | 2014-03-31 14:58:12 +0900 | [diff] [blame] | 28 | self.assertIn('data', body) |
| 29 | self.assertIn('private_key', body) |
| 30 | |
Chris Hoge | 7579c1a | 2015-02-26 14:12:15 -0800 | [diff] [blame] | 31 | @test.idempotent_id('3ac273d0-92d2-4632-bdfc-afbc21d4606c') |
Eiichi Aikawa | a30e519 | 2014-03-31 14:58:12 +0900 | [diff] [blame] | 32 | def test_get_root_certificate(self): |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 33 | # get the root certificate |
ghanshyam | c7e09bf | 2015-08-04 15:42:24 +0900 | [diff] [blame] | 34 | body = (self.certificates_client.show_certificate('root') |
| 35 | ['certificate']) |
ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame] | 36 | self.assertIn('data', body) |
| 37 | self.assertIn('private_key', body) |