Delete keystores from distribution 52/119552/1
authorJim Hahn <jrh3@att.com>
Fri, 19 Mar 2021 16:00:30 +0000 (12:00 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 19 Mar 2021 16:00:51 +0000 (12:00 -0400)
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>
main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsDistributionRestServer.java
main/src/test/java/org/onap/policy/distribution/main/rest/TestHttpsStatisticDistributionRestServer.java
main/src/test/resources/ssl/policy-keystore [deleted file]
packages/policy-distribution-tarball/src/main/resources/etc/ssl/policy-keystore [deleted file]

index 4e2fa57..ef4d1f5 100644 (file)
@@ -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");
index 94d8247..9520afb 100644 (file)
@@ -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
deleted file mode 100644 (file)
index b95e010..0000000
Binary files a/main/src/test/resources/ssl/policy-keystore and /dev/null differ
diff --git a/packages/policy-distribution-tarball/src/main/resources/etc/ssl/policy-keystore b/packages/policy-distribution-tarball/src/main/resources/etc/ssl/policy-keystore
deleted file mode 100644 (file)
index b95e010..0000000
Binary files a/packages/policy-distribution-tarball/src/main/resources/etc/ssl/policy-keystore and /dev/null differ