diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-11-25 13:13:22 +0100 |
commit | dcdc32af1fced49d80a8ccd93230e15d91ab45d8 (patch) | |
tree | eb69e2555fbd54496fce8a33f4dd610e1473ff51 /cpp/test/IceSSL/configuration | |
parent | C# IceSSL/configuration log expired certificate exceptions. (diff) | |
download | ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.bz2 ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.xz ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.zip |
Refactored test scripts
Diffstat (limited to 'cpp/test/IceSSL/configuration')
-rw-r--r-- | cpp/test/IceSSL/configuration/AllTests.cpp | 2 | ||||
-rw-r--r-- | cpp/test/IceSSL/configuration/Client.cpp | 3 | ||||
-rw-r--r-- | cpp/test/IceSSL/configuration/Server.cpp | 5 | ||||
-rwxr-xr-x | cpp/test/IceSSL/configuration/run.py | 56 |
4 files changed, 6 insertions, 60 deletions
diff --git a/cpp/test/IceSSL/configuration/AllTests.cpp b/cpp/test/IceSSL/configuration/AllTests.cpp index 24047abfabf..d8cf659450f 100644 --- a/cpp/test/IceSSL/configuration/AllTests.cpp +++ b/cpp/test/IceSSL/configuration/AllTests.cpp @@ -699,7 +699,7 @@ allTests(const CommunicatorPtr& communicator, const string& testDir, bool p12) elCapitanUpdate2OrLower = (majorVersion == 15) && (minorVersion <= 2); } #endif - string factoryRef = "factory:tcp -p 12010"; + string factoryRef = "factory:" + getTestEndpoint(communicator, 0); ObjectPrxPtr base = communicator->stringToProxy(factoryRef); test(base); Test::ServerFactoryPrxPtr factory = ICE_CHECKED_CAST(Test::ServerFactoryPrx, base); diff --git a/cpp/test/IceSSL/configuration/Client.cpp b/cpp/test/IceSSL/configuration/Client.cpp index 44acba98ffb..fb42ae4efe0 100644 --- a/cpp/test/IceSSL/configuration/Client.cpp +++ b/cpp/test/IceSSL/configuration/Client.cpp @@ -71,7 +71,8 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); + Ice::InitializationData initData = getTestInitData(argc, argv); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/cpp/test/IceSSL/configuration/Server.cpp b/cpp/test/IceSSL/configuration/Server.cpp index 44c76dc5cb5..07a6fb6acd0 100644 --- a/cpp/test/IceSSL/configuration/Server.cpp +++ b/cpp/test/IceSSL/configuration/Server.cpp @@ -18,7 +18,7 @@ using namespace std; int run(int, char**, const Ice::CommunicatorPtr& communicator) { - communicator->getProperties()->setProperty("TestAdapter.Endpoints", "tcp -p 12010"); + communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0)); Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); Ice::Identity id = Ice::stringToIdentity("factory"); adapter->add(ICE_MAKE_SHARED(ServerFactoryI), id); @@ -36,7 +36,8 @@ main(int argc, char* argv[]) try { - communicator = Ice::initialize(argc, argv); + Ice::InitializationData initData = getTestInitData(argc, argv); + communicator = Ice::initialize(argc, argv, initData); status = run(argc, argv, communicator); } catch(const Ice::Exception& ex) diff --git a/cpp/test/IceSSL/configuration/run.py b/cpp/test/IceSSL/configuration/run.py deleted file mode 100755 index 8edf98af0f8..00000000000 --- a/cpp/test/IceSSL/configuration/run.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# ********************************************************************** -# -# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. -# -# This copy of Ice is licensed to you under the terms described in the -# ICE_LICENSE file included in this distribution. -# -# ********************************************************************** - -import os, sys, atexit, re - -path = [ ".", "..", "../..", "../../..", "../../../.." ] -head = os.path.dirname(sys.argv[0]) -if len(head) > 0: - path = [os.path.join(head, p) for p in path] -path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] -if len(path) == 0: - raise RuntimeError("can't find toplevel directory!") -sys.path.append(os.path.join(path[0], "scripts")) -import TestUtil - -# Filter-out the deprecated property warnings -TestUtil.clientTraceFilters = [ lambda x: re.sub("-! .* warning: deprecated property: IceSSL.KeyFile\n", "", x) ] -TestUtil.serverTraceFilters = [ lambda x: re.sub("-! .* warning: deprecated property: IceSSL.KeyFile\n", "", x) ] - -certsPath = os.path.abspath(os.path.join(os.getcwd(), "..", "certs")) -keychainPath = os.path.abspath(os.path.join(certsPath, "Find.keychain")) - -def cleanup(): - if TestUtil.isDarwin(): - os.system("rm -rf %s ../certs/keychain" % keychainPath) - elif TestUtil.isLinux(): - for c in ["cacert1.pem", "cacert2.pem"]: - pem = os.path.join(certsPath, c) - os.system("rm -f {dir}/`openssl x509 -subject_hash -noout -in {pem}`.0".format(pem=pem, dir=certsPath)) - -cleanup() -atexit.register(cleanup) - -if TestUtil.isDarwin(): - os.system("mkdir -p ../certs/keychain") - os.system("security create-keychain -p password %s" % keychainPath) - for cert in ["s_rsa_ca1.p12", "c_rsa_ca1.p12"]: - os.system("security import %s -f pkcs12 -A -P password -k %s" % (os.path.join(certsPath, cert), keychainPath)) -elif TestUtil.iceUseOpenSSL(): - # - # Create copies of the CA certificates named after the subject - # hash. This is used by the tests to find the CA certificates in - # the IceSSL.DefaultDir - # - for c in ["cacert1.pem", "cacert2.pem"]: - pem = os.path.join(certsPath, c) - os.system("cp {pem} {dir}/`openssl x509 -subject_hash -noout -in {pem}`.0".format(pem=pem, dir=certsPath)) - -TestUtil.clientServerTest(additionalClientOptions = '"%s"' % os.getcwd()) |