| ivan-zhu | d57f3cf | 2013-11-06 16:59:52 +0800 | [diff] [blame^] | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 | 
|  | 2 |  | 
|  | 3 | # Copyright 2012 OpenStack Foundation | 
|  | 4 | # All Rights Reserved. | 
|  | 5 | # | 
|  | 6 | #    Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 7 | #    not use this file except in compliance with the License. You may obtain | 
|  | 8 | #    a copy of the License at | 
|  | 9 | # | 
|  | 10 | #         http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 11 | # | 
|  | 12 | #    Unless required by applicable law or agreed to in writing, software | 
|  | 13 | #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 14 | #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | 
|  | 15 | #    License for the specific language governing permissions and limitations | 
|  | 16 | #    under the License. | 
|  | 17 |  | 
|  | 18 | from tempest.api.compute import base | 
|  | 19 | from tempest.test import attr | 
|  | 20 |  | 
|  | 21 |  | 
|  | 22 | class CertificatesTestJSON(base.BaseV2ComputeTest): | 
|  | 23 | _interface = 'json' | 
|  | 24 |  | 
|  | 25 | @attr(type='gate') | 
|  | 26 | def test_create_and_get_root_certificate(self): | 
|  | 27 | # create certificates | 
|  | 28 | resp, create_body = self.certificates_client.create_certificate() | 
|  | 29 | self.assertEqual(200, resp.status) | 
|  | 30 | self.assertIn('data', create_body) | 
|  | 31 | self.assertIn('private_key', create_body) | 
|  | 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' |