Skip to content

Commit e09ce78

Browse files
authored
Support platform specific java.security file (#6149)
related: automation/issues/78 Signed-off-by: Lan Xia <[email protected]>
1 parent 1de5079 commit e09ce78

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

buildenv/jenkins/openjdk_tests

+10-2
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,20 @@ def runTest() {
464464
}
465465
}
466466
if (params.TEST_FLAG == "OpenJCEPlus") {
467-
def javaSecurityFile = "${env.WORKSPACE}/aqa-tests/config/openjceplus/jdk${params.JDK_VERSION}/java.security"
467+
def workdir = "${env.WORKSPACE}"
468+
if (PLATFORM.contains("windows")) {
469+
workdir = env.WORKSPACE.replaceAll("\\\\", "/")
470+
}
471+
def javaSecurityFile = "${workdir}/aqa-tests/config/openjceplus/jdk${params.JDK_VERSION}/${params.PLATFORM}/java.security"
472+
if (!fileExists(javaSecurityFile)) {
473+
javaSecurityFile = "${workdir}/aqa-tests/config/openjceplus/jdk/${params.PLATFORM}/java.security"
474+
}
468475
if (!fileExists(javaSecurityFile)) {
469-
javaSecurityFile = "${env.WORKSPACE}/aqa-tests/config/openjceplus/jdk/java.security"
476+
javaSecurityFile = "${workdir}/aqa-tests/config/openjceplus/jdk/java.security"
470477
}
471478
echo "Set -Djava.security.properties=${javaSecurityFile} in EXTRA_OPTIONS"
472479
env.EXTRA_OPTIONS += " -Djava.security.properties=${javaSecurityFile}"
480+
sh "cat ${javaSecurityFile}"
473481
}
474482
jenkinsfile = load "${WORKSPACE}/aqa-tests/buildenv/jenkins/JenkinsfileBase"
475483
if (LABEL.contains('ci.agent.dynamic') && CLOUD_PROVIDER.equals('azure')) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add OpenJCEPlus to the top of the provider list. This file should be kept in sync with
2+
# the out of the box security provider list except for placing OpenJCEPlus at the highest
3+
# priority.
4+
security.provider.1=com.ibm.crypto.plus.provider.OpenJCEPlus
5+
security.provider.2=SUN
6+
security.provider.3=SunRsaSign
7+
security.provider.4=SunEC
8+
security.provider.5=SunJSSE
9+
security.provider.6=SunJCE
10+
security.provider.7=SunJGSS
11+
security.provider.8=SunSASL
12+
security.provider.9=XMLDSig
13+
security.provider.10=SunPCSC
14+
security.provider.11=JdkLDAP
15+
security.provider.12=JdkSASL
16+
security.provider.13=SunPKCS11
17+
security.provider.14=SunMSCAPI

0 commit comments

Comments
 (0)