|
1 | 1 | #!/bin/bash |
| 2 | +SCRIPT_SOURCE="${BASH_SOURCE[0]}" |
| 3 | +while [ -h "$SCRIPT_SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink |
| 4 | + SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" && pwd )" |
| 5 | + SCRIPT_SOURCE="$(readlink "$SCRIPT_SOURCE")" |
| 6 | + # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located |
| 7 | + [[ $SCRIPT_SOURCE != /* ]] && SCRIPT_SOURCE="$SCRIPT_DIR/$SCRIPT_SOURCE" |
| 8 | +done |
| 9 | +readonly SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" && pwd )" |
| 10 | + |
2 | 11 | set -exo pipefail |
3 | 12 |
|
4 | | -if [ "0$JDK_MAJOR" -eq 8 ]; then |
5 | | - echo "!skipped! older wildfly needed for jdk8" |
| 13 | +if [ "0$JDK_MAJOR" -lt 21 ]; then |
| 14 | + echo "!skipped! older wildfly needed for jdk21 and up" |
6 | 15 | exit |
7 | 16 | fi |
8 | 17 | if [ "x$OS_NAME" == "xrhel" -a "0$OS_VERSION_MAJOR" -le "7" ]; then |
9 | 18 | echo "!skipped! rhel7 and older are to old " |
10 | 19 | exit |
11 | 20 | fi |
12 | 21 |
|
13 | | -MVOPTS="--batch-mode" |
14 | | -if [ "x$EX_MVN" == "x" ] ; then |
15 | | - EX_MVN=mvn |
16 | | -fi |
17 | | - |
18 | | -DISABLE_testNoExplicitEnabledProtocols="true" |
19 | | -DISABLE_testMultipleEnabledProtocolsWithClientProtocolWithinEnabledRange="true" |
20 | | -DISABLE_testCipherSuiteConverter="true" |
21 | | -DISABLE_testAvailableProtocolsWithTLS13CipherSuites="true" |
22 | | - |
23 | | -function addIgnoreImport() { |
24 | | - if ! grep -e "import org.junit.Ignore" "${1}" ; then #do not create duplicated imports |
25 | | - sed "s/import org.junit.Test;/import org.junit.Test;import org.junit.Ignore;/" -i "${1}" |
26 | | - fi |
27 | | -} |
28 | | - |
29 | | -ignoredTests=0 |
30 | | -function ignoreMethod() { |
31 | | - local file=$(find -type f | grep "${2}.java$") |
32 | | - grep -e "${1}[(]" "${file}" #check |
33 | | - # do not inject ignore import if nothing will be sed |
34 | | - addIgnoreImport "${file}" |
35 | | - sed "s/${1}[(]/@Ignore ${1}(/g" -i "${file}" |
36 | | - grep -e "@Ignore ${1}[(]" "${file}" #check |
37 | | - let ignoredTests=$ignoredTests+1 |
38 | | -} |
39 | | - |
40 | | - |
41 | | -# for generating patches |
42 | | -#GIT=git |
43 | | -GIT=echo |
44 | | - |
45 | | -NATIVES_VERSION=2.2.2.Final |
46 | | -VERSION=2.2.5.Final |
47 | | -rm -rf wildfly-openssl |
48 | | -mkdir wildfly-openssl |
49 | | -pushd wildfly-openssl |
50 | | - wget https://github.com/wildfly-security/wildfly-openssl-natives/archive/refs/tags/${NATIVES_VERSION}.tar.gz |
51 | | - tar -xf ${NATIVES_VERSION}.tar.gz |
52 | | - pushd wildfly-openssl-natives-${NATIVES_VERSION} |
53 | | - $EX_MVN $MVOPTS clean install |
54 | | - popd |
55 | | - wget https://github.com/wildfly-security/wildfly-openssl/archive/refs/tags/${VERSION}.tar.gz |
56 | | - tar -xf ${VERSION}.tar.gz |
57 | | - # generally the testsuite is poorly designed. see SSLTestUtils.java |
58 | | - # it reuses still same port, and do not release it in finally clausule, |
59 | | - # so although it uses setReuseAddress, any first fail will kill all subsequent tests |
60 | | - # as the port seems to survive junit's vm |
61 | | - pushd wildfly-openssl-${VERSION} |
62 | | - $GIT init |
63 | | - $GIT add * |
64 | | - $GIT commit . -m "initial commit" |
65 | | - if [ "$DISABLE_testNoExplicitEnabledProtocols" = "true" ] ; then |
66 | | - # this test fails with different crypto policies |
67 | | - ignoreMethod "public void testNoExplicitEnabledProtocols" "BasicOpenSSLEngineTest" |
68 | | - fi |
69 | | - if [ "$DISABLE_testMultipleEnabledProtocolsWithClientProtocolWithinEnabledRange" = "true" ] ; then |
70 | | - # tls v 1.0 is being removed |
71 | | - ignoreMethod "public void testMultipleEnabledProtocolsWithClientProtocolWithinEnabledRange" "BasicOpenSSLEngineLegacyProtocolsTest" |
72 | | - fi |
73 | | - if [ "$DISABLE_testCipherSuiteConverter" = "true" ] ; then |
74 | | - # this test fails with different crypto policies and there is no JNI at all. However to find wy it fials is interesting TODO. |
75 | | - ignoreMethod "public void testCipherSuiteConverter" "SslCiphersTest" |
76 | | - fi |
77 | | - if [ "$DISABLE_testAvailableProtocolsWithTLS13CipherSuites" = "true" ] ; then |
78 | | - # tls 1.3 |
79 | | - ignoreMethod "public void testAvailableProtocolsWithTLS13CipherSuites" "SslCiphersTest" |
80 | | - fi |
81 | | - if [ $ignoredTests -gt 0 ] ; then |
82 | | - $GIT commit . -m "disbaled $ignoredTests tests" |
83 | | - else |
84 | | - echo "No test ignored" |
85 | | - fi |
86 | | - # it is better to set the libssl and libcrypto on our own |
87 | | - # the wildfly-openssl search is just tragic, and the excception throwns out of it are very missleading |
88 | | - # eg "not found ssl library" may be thrown from findCryptoLibray (where findSSL have passed fine) |
89 | | - libssl=$( ls $(find /usr/lib /usr/lib64 -type l | grep libssl | grep -v -e .hmac -e .pc ) | head -n 1) ; |
90 | | - libcrypt=$( ls $(find /usr/lib /usr/lib64 -type l | grep libcrypto | grep -v -e .hmac -e .pc ) | head -n 1) ; |
91 | 22 |
|
92 | | - allEnabledSecurity=`mktemp` |
93 | | - echo 'jdk.tls.disabledAlgorithms='> "$allEnabledSecurity" |
94 | | - useAllEnabledSecurity="-Djava.security.properties=$allEnabledSecurity" |
| 23 | +export NATIVES_VERSION=2.3.0.Alpha3 |
| 24 | +export VERSION=2.3.0.Alpha2 |
| 25 | +bash "$SCRIPT_DIR/wildfly-openssl.bash" |
95 | 26 |
|
96 | | - #if problems with not freed port persists, run in loop of 2-3 mvn test, and return nonzero only if all fails |
97 | | - if [ "x$OTOOL_OS_NAME" = "xel" -a "x$OTOOL_OS_VERSION" = "x7" ] ; then |
98 | | - scl enable rh-maven36 -- mvn $MVOPTS $clean install $useAllEnabledSecurity -Dorg.wildfly.openssl.path.ssl=$libssl -Dorg.wildfly.openssl.path.crypto=$libcrypt |
99 | | - else |
100 | | - $EX_MVN $MVOPTS clean install $useAllEnabledSecurity -Dorg.wildfly.openssl.path.ssl=$libssl -Dorg.wildfly.openssl.path.crypto=$libcrypt |
101 | | - fi |
102 | | - if which update-crypto-policies 2>/dev/null 1>/dev/null ; then |
103 | | - update-crypto-policies --show |
104 | | - fi |
105 | | - popd |
106 | | -popd |
0 commit comments