diff --git a/magnum/tests/functional/api/v1/test_cluster.py b/magnum/tests/functional/api/v1/test_cluster.py index 9c94362..2a356a0 100644 --- a/magnum/tests/functional/api/v1/test_cluster.py +++ b/magnum/tests/functional/api/v1/test_cluster.py @@ -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) diff --git a/magnum/tests/functional/common/datagen.py b/magnum/tests/functional/common/datagen.py index 14a03c8..4b15301 100644 --- a/magnum/tests/functional/common/datagen.py +++ b/magnum/tests/functional/common/datagen.py @@ -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 diff --git a/magnum/tests/functional/tempest_tests/config.py b/magnum/tests/functional/tempest_tests/config.py index 61f89c1..3601fd5 100644 --- a/magnum/tests/functional/tempest_tests/config.py +++ b/magnum/tests/functional/tempest_tests/config.py @@ -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",