Simplify test_create_list_sign_delete_clusters() tempest test
The test needs a valid CSR which was created in the devstack post_test_hook in a static way (always the same CSR). This commit simplifies the process and just adds the CSR to the test itself so that the CSR string can be used to check the CSR. That way there is no need to provide a file with the CSR content and point the tempest configuration via the "csr_location" parameter to that file. So the "csr_location" parameter is now deprecated for removal. Also remove the unused "invalid.csr" which was also created in the post_test_hook. Change-Id: I907130576cfb59267643b4639681331acfcfa07f
This commit is contained in:
parent
7001074e4c
commit
54fc369b8a
@ -162,7 +162,23 @@ class ClusterTest(base.BaseTempestTest):
|
||||
self.assertIn('-----END CERTIFICATE-----', cert_model.pem)
|
||||
|
||||
# test ca sign
|
||||
cert_data_model = datagen.cert_data(cluster_model.uuid)
|
||||
|
||||
csr_sample = """-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIByjCCATMCAQAwgYkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh
|
||||
MRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgSW5jMR8w
|
||||
HQYDVQQLExZJbmZvcm1hdGlvbiBUZWNobm9sb2d5MRcwFQYDVQQDEw53d3cuZ29v
|
||||
Z2xlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApZtYJCHJ4VpVXHfV
|
||||
IlstQTlO4qC03hjX+ZkPyvdYd1Q4+qbAeTwXmCUKYHThVRd5aXSqlPzyIBwieMZr
|
||||
WFlRQddZ1IzXAlVRDWwAo60KecqeAXnnUK+5fXoTI/UgWshre8tJ+x/TMHaQKR/J
|
||||
cIWPhqaQhsJuzZbvAdGA80BLxdMCAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4GBAIhl
|
||||
4PvFq+e7ipARgI5ZM+GZx6mpCz44DTo0JkwfRDf+BtrsaC0q68eTf2XhYOsq4fkH
|
||||
Q0uA0aVog3f5iJxCa3Hp5gxbJQ6zV6kJ0TEsuaaOhEko9sdpCoPOnRBm2i/XRD2D
|
||||
6iNh8f8z0ShGsFqjDgFHyF3o+lUyj+UC6H1QW7bn
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
"""
|
||||
|
||||
cert_data_model = datagen.cert_data(cluster_model.uuid,
|
||||
csr_data=csr_sample)
|
||||
resp, cert_model = self.cert_client.post_cert(cert_data_model)
|
||||
self.LOG.debug("cert resp: %s" % resp)
|
||||
self.assertEqual(201, resp.status)
|
||||
|
@ -10,7 +10,6 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import os
|
||||
import random
|
||||
import socket
|
||||
import string
|
||||
@ -323,18 +322,11 @@ def bay_node_count_patch_data(node_count=2):
|
||||
return baypatch_model.BayPatchCollection.from_dict(data)
|
||||
|
||||
|
||||
def cert_data(bay_uuid, csr_data=None):
|
||||
if csr_data is None:
|
||||
csr_data = config.Config.csr_location
|
||||
def cert_data(bay_uuid, csr_data):
|
||||
data = {
|
||||
"bay_uuid": bay_uuid
|
||||
"bay_uuid": bay_uuid,
|
||||
"csr": csr_data,
|
||||
}
|
||||
if csr_data is not None and os.path.isfile(csr_data):
|
||||
with open(csr_data, 'r') as f:
|
||||
data['csr'] = f.read()
|
||||
else:
|
||||
data['csr'] = csr_data
|
||||
|
||||
model = cert_model.CertEntity.from_dict(data)
|
||||
|
||||
return model
|
||||
|
@ -54,7 +54,9 @@ MagnumGroup = [
|
||||
|
||||
cfg.StrOpt("csr_location",
|
||||
default="/opt/stack/new/magnum/default.csr",
|
||||
help="CSR location for certificates."),
|
||||
deprecated_for_removal=True,
|
||||
help="CSR location for certificates. This option is no "
|
||||
"longer used for anything."),
|
||||
|
||||
cfg.StrOpt("dns_nameserver",
|
||||
default="8.8.8.8",
|
||||
|
Loading…
Reference in New Issue
Block a user