blob: 321a0a1a089c1426f2920b130ca0c572a3b297c9 [file] [log] [blame]
ivan-zhud57f3cf2013-11-06 16:59:52 +08001# 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
16from tempest.api.compute import base
Yuiko Takadae9999d62014-03-06 09:22:54 +000017from tempest import test
ivan-zhud57f3cf2013-11-06 16:59:52 +080018
19
Ken'ichi Ohmichi9f5adf82014-12-12 04:01:32 +000020class CertificatesV2TestJSON(base.BaseComputeTest):
Ghanshyam1fa93552014-05-07 18:09:49 +090021
Ken'ichi Ohmichi9f5adf82014-12-12 04:01:32 +000022 _api_version = 2
ivan-zhud57f3cf2013-11-06 16:59:52 +080023
Yuiko Takadae9999d62014-03-06 09:22:54 +000024 @test.attr(type='gate')
Eiichi Aikawaa30e5192014-03-31 14:58:12 +090025 def test_create_root_certificate(self):
ivan-zhud57f3cf2013-11-06 16:59:52 +080026 # create certificates
David Kranz5cf4ba42015-02-10 14:00:50 -050027 body = self.certificates_client.create_certificate()
Eiichi Aikawaa30e5192014-03-31 14:58:12 +090028 self.assertIn('data', body)
29 self.assertIn('private_key', body)
30
31 @test.attr(type='gate')
32 def test_get_root_certificate(self):
ivan-zhud57f3cf2013-11-06 16:59:52 +080033 # get the root certificate
David Kranz5cf4ba42015-02-10 14:00:50 -050034 body = self.certificates_client.get_certificate('root')
ivan-zhud57f3cf2013-11-06 16:59:52 +080035 self.assertIn('data', body)
36 self.assertIn('private_key', body)