diff options
author | Jim Hahn <jrh3@att.com> | 2021-03-19 12:00:30 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-03-19 12:00:51 -0400 |
commit | baee9c938ce5caaa20879c494cce9beb01f3a8e0 (patch) | |
tree | 4a0bfb955a8f6b602a687bda8e7f7d6879a64c0b /main | |
parent | 87e6b80d8c1a285c950fa840fd68fc123343ff5f (diff) |
Delete keystores from distribution
The Keystore is no longer needed in the tarball, as it is supplied
externally by the CSITs and Helm charts. Deleted that file.
Also modified the junits to use utils-test to generates keystores at
runtime, thus deleted the junit keystore file, too.
Issue-ID: POLICY-3143
Change-Id: I9daf6da10f2027880c260bd6f529bf6c6e7c2e91
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main')
3 files changed, 10 insertions, 11 deletions
diff --git a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java index 4e2fa574..ef4d1f5b 100644 --- a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java +++ b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Intel. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. - * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.junit.Test; import org.onap.policy.common.endpoints.report.HealthCheckReport; import org.onap.policy.common.utils.network.NetworkUtil; +import org.onap.policy.common.utils.security.SelfSignedKeyStore; import org.onap.policy.distribution.main.PolicyDistributionException; import org.onap.policy.distribution.main.parameters.CommonTestData; import org.onap.policy.distribution.main.startstop.Main; @@ -53,7 +54,6 @@ public class TestHttpsDistributionRestServer { private static final String ALIVE = "alive"; private static final String SELF = NetworkUtil.getHostname(); private static final String NAME = "Policy SSD"; - private static String KEYSTORE = System.getProperty("user.dir") + "/src/test/resources/ssl/policy-keystore"; private int port; @@ -68,10 +68,10 @@ public class TestHttpsDistributionRestServer { }).doesNotThrowAnyException(); } - private Main startDistributionService() throws IOException { + private Main startDistributionService() throws IOException, InterruptedException { final Properties systemProps = System.getProperties(); - systemProps.put("javax.net.ssl.keyStore", KEYSTORE); - systemProps.put("javax.net.ssl.keyStorePassword", "Pol1cy_0nap"); + systemProps.put("javax.net.ssl.keyStore", new SelfSignedKeyStore().getKeystoreName()); + systemProps.put("javax.net.ssl.keyStorePassword", SelfSignedKeyStore.KEYSTORE_PASSWORD); System.setProperties(systemProps); port = CommonTestData.makeConfigFile("parameters/DistributionConfigParameters_Https.json"); diff --git a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java index 94d82477..9520afb6 100644 --- a/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java +++ b/main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Intel. All rights reserved. * Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,6 +39,7 @@ import javax.ws.rs.core.MediaType; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.junit.Test; import org.onap.policy.common.utils.network.NetworkUtil; +import org.onap.policy.common.utils.security.SelfSignedKeyStore; import org.onap.policy.distribution.main.PolicyDistributionException; import org.onap.policy.distribution.main.parameters.CommonTestData; import org.onap.policy.distribution.main.startstop.Main; @@ -50,8 +51,6 @@ import org.onap.policy.distribution.main.startstop.Main; */ public class TestHttpsStatisticDistributionRestServer { - private static String KEYSTORE = System.getProperty("user.dir") + "/src/test/resources/ssl/policy-keystore"; - private int port; @Test @@ -64,10 +63,10 @@ public class TestHttpsStatisticDistributionRestServer { }).doesNotThrowAnyException(); } - private Main startDistributionService() throws IOException { + private Main startDistributionService() throws IOException, InterruptedException { final Properties systemProps = System.getProperties(); - systemProps.put("javax.net.ssl.keyStore", KEYSTORE); - systemProps.put("javax.net.ssl.keyStorePassword", "Pol1cy_0nap"); + systemProps.put("javax.net.ssl.keyStore", new SelfSignedKeyStore().getKeystoreName()); + systemProps.put("javax.net.ssl.keyStorePassword", SelfSignedKeyStore.KEYSTORE_PASSWORD); System.setProperties(systemProps); port = CommonTestData.makeConfigFile("parameters/DistributionConfigParameters_Https.json"); diff --git a/main/src/test/resources/ssl/policy-keystore b/main/src/test/resources/ssl/policy-keystore Binary files differdeleted file mode 100644 index b95e0103..00000000 --- a/main/src/test/resources/ssl/policy-keystore +++ /dev/null |