Repository: incubator-slider Updated Branches: refs/heads/feature/SLIDER-280_Restart_AM_fun_tests 71021f0a9 -> 278d5e4c7
SLIDER-369 keep accumulo ssl tests from erroring when jks files already exist Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/b336c576 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/b336c576 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/b336c576 Branch: refs/heads/feature/SLIDER-280_Restart_AM_fun_tests Commit: b336c576f53136ed6175dcb94402abcfb0942885 Parents: 0c4fb57 Author: Billie Rinaldi <[email protected]> Authored: Thu Aug 28 08:33:54 2014 -0700 Committer: Billie Rinaldi <[email protected]> Committed: Thu Aug 28 08:33:54 2014 -0700 ---------------------------------------------------------------------- .../funtest/accumulo/AccumuloSSLTestBase.groovy | 28 ++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b336c576/app-packages/accumulo/src/test/groovy/org/apache/slider/funtest/accumulo/AccumuloSSLTestBase.groovy ---------------------------------------------------------------------- diff --git a/app-packages/accumulo/src/test/groovy/org/apache/slider/funtest/accumulo/AccumuloSSLTestBase.groovy b/app-packages/accumulo/src/test/groovy/org/apache/slider/funtest/accumulo/AccumuloSSLTestBase.groovy index 2818a3a..8a1b0d2 100644 --- a/app-packages/accumulo/src/test/groovy/org/apache/slider/funtest/accumulo/AccumuloSSLTestBase.groovy +++ b/app-packages/accumulo/src/test/groovy/org/apache/slider/funtest/accumulo/AccumuloSSLTestBase.groovy @@ -59,9 +59,11 @@ class AccumuloSSLTestBase extends AccumuloBasicIT { System.out.println("provider after "+provider) File rootKeyStoreFile = new File(TEST_APP_PKG_DIR, "root.jks") - CertUtil.createRootKeyPair(rootKeyStoreFile.toString(), - Property.INSTANCE_SECRET.toString(), trustStoreFile.toString(), - Property.RPC_SSL_TRUSTSTORE_PASSWORD.toString(), provider); + if (!rootKeyStoreFile.exists() && !trustStoreFile.exists()) { + CertUtil.createRootKeyPair(rootKeyStoreFile.toString(), + Property.INSTANCE_SECRET.toString(), trustStoreFile.toString(), + Property.RPC_SSL_TRUSTSTORE_PASSWORD.toString(), provider); + } AgentUploads agentUploads = new AgentUploads(SLIDER_CONFIG) agentUploads.uploader.copyIfOutOfDate(trustStoreFile, new Path(certDir, @@ -69,18 +71,22 @@ class AccumuloSSLTestBase extends AccumuloBasicIT { for (node in getNodeList(conf)) { File keyStoreFile = new File(TEST_APP_PKG_DIR, node + ".jks") - CertUtil.createServerKeyPair(keyStoreFile.toString(), - Property.RPC_SSL_KEYSTORE_PASSWORD.toString(), - rootKeyStoreFile.toString(), Property.INSTANCE_SECRET.toString(), - provider, node); + if (!keyStoreFile.exists()) { + CertUtil.createServerKeyPair(keyStoreFile.toString(), + Property.RPC_SSL_KEYSTORE_PASSWORD.toString(), + rootKeyStoreFile.toString(), Property.INSTANCE_SECRET.toString(), + provider, node); + } agentUploads.uploader.copyIfOutOfDate(keyStoreFile, new Path(certDir, node + ".jks"), false) } - CertUtil.createServerKeyPair(clientKeyStoreFile.toString(), - Property.RPC_SSL_KEYSTORE_PASSWORD.toString(), - rootKeyStoreFile.toString(), Property.INSTANCE_SECRET.toString(), - provider, InetAddress.getLocalHost().getHostName()); + if (!clientKeyStoreFile.exists()) { + CertUtil.createServerKeyPair(clientKeyStoreFile.toString(), + Property.RPC_SSL_KEYSTORE_PASSWORD.toString(), + rootKeyStoreFile.toString(), Property.INSTANCE_SECRET.toString(), + provider, InetAddress.getLocalHost().getHostName()); + } } def getNodeList(Configuration conf) {
