summaryrefslogtreecommitdiff
path: root/scripts/tests/IceSSL/configuration.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tests/IceSSL/configuration.py')
-rw-r--r--scripts/tests/IceSSL/configuration.py38
1 files changed, 31 insertions, 7 deletions
diff --git a/scripts/tests/IceSSL/configuration.py b/scripts/tests/IceSSL/configuration.py
index afae1ad32d9..94e86e5733b 100644
--- a/scripts/tests/IceSSL/configuration.py
+++ b/scripts/tests/IceSSL/configuration.py
@@ -22,7 +22,7 @@ class ConfigurationTestCase(ClientServerTestCase):
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 platform.hasOpenSSL():
+ elif current.config.openssl or platform.hasOpenSSL():
#
# Create copies of the CA certificates named after the subject
# hash. This is used by the tests to find the CA certificates in
@@ -30,7 +30,8 @@ class ConfigurationTestCase(ClientServerTestCase):
#
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))
+ out = run("{openssl} x509 -subject_hash -noout -in {pem}".format(pem=pem, openssl=self.getOpenSSLCommand()))
+ shutil.copyfile(pem, "{dir}/{out}.0".format(dir=certsPath, out=out))
def teardownServerSide(self, current, success):
# Nothing to do if we're not running this test with the C++ mapping
@@ -40,10 +41,32 @@ class ConfigurationTestCase(ClientServerTestCase):
certsPath = os.path.abspath(os.path.join(self.getPath(), "..", "certs"))
if isinstance(platform, Darwin) and current.config.buildPlatform == "macosx":
os.system("rm -rf {0} {1}".format(os.path.join(certsPath, "keychain"), os.path.join(certsPath, "Find.keychain")))
- elif platform.hasOpenSSL():
+ elif current.config.openssl or platform.hasOpenSSL():
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))
+ out = run("{openssl} x509 -subject_hash -noout -in {pem}".format(pem=pem, openssl=self.getOpenSSLCommand()))
+ os.remove("{dir}/{out}.0".format(out=out, dir=certsPath))
+
+ def getOpenSSLCommand(self):
+ if isinstance(platform, Windows):
+ return os.path.join(self.getPath(), "..", "..", "..", "msbuild", "packages", "openssl.v140.1.0.2.1",
+ "build", "native", "bin", "Win32", "Release", "openssl.exe")
+ else:
+ return "openssl"
+
+class IceSSLConfigurationClient(Client):
+
+ def getExe(self, current):
+ if isinstance(platform, Windows) and current.config.openssl:
+ return "clientopenssl"
+ return Client.getExe(self, current)
+
+class IceSSLConfigurationServer(Server):
+
+ def getExe(self, current):
+ if isinstance(platform, Windows) and current.config.openssl:
+ return "serveropenssl"
+ return Server.getExe(self, current)
# Filter-out the deprecated property warnings
outfilters = [ lambda x: re.sub("-! .* warning: deprecated property: IceSSL.KeyFile\n", "", x) ]
@@ -53,7 +76,8 @@ outfilters = [ lambda x: re.sub("-! .* warning: deprecated property: IceSSL.KeyF
#
options=lambda current: { "protocol": ["ssl", "wss"] } if current.config.uwp else {}
+
TestSuite(__name__, [
- ConfigurationTestCase(client=Client(outfilters=outfilters, args=['"{testdir}"']),
- server=Server(outfilters=outfilters, args=['"{testdir}"']))
-], multihost=False, options=options)
+ ConfigurationTestCase(client=IceSSLConfigurationClient(outfilters=outfilters, args=['"{testdir}"']),
+ server=IceSSLConfigurationServer(outfilters=outfilters, args=['"{testdir}"']))
+], multihost=False, options=options) \ No newline at end of file