dcache icon indicating copy to clipboard operation
dcache copied to clipboard

Fix java version check

Open LukasMansour opened this issue 3 years ago • 18 comments

Motivation: Solves the problem that #6382 is reporting, which is being caused by non-uniformity between 'java -version' outputs from different systems and versions.

Modification: Change the java version detection method to use awk to get everything after the 'version ' part of the 'java -version' output. Then use some RegEx to ensure that it starts with 11-19. The used RegEx is: ^1[1-9](.*)?$. Tested against following cases:

# Passed:
11-jdk
17.0.0
17-jdk
17.0
18.0
17-Oracle
17_312.0afa
17mycustomversion
13java
17openjdk
13-openjdk
17
11
# Failed:
1.8.0_312
1.8.0-312
1.8.0 312
1
1.0
10.0
1.1.0

Result: The java version check hopefully works as expected.

Signed-off-by: Lukas Mansour [email protected]

LukasMansour avatar Mar 04 '22 11:03 LukasMansour

Can one of the admins verify this patch?

dcache-ci avatar Mar 04 '22 11:03 dcache-ci

Can one of the admins verify this patch?

dcache-ci avatar Mar 04 '22 11:03 dcache-ci

Can one of the admins verify this patch?

dcache-ci avatar Mar 04 '22 11:03 dcache-ci

Can one of the admins verify this patch?

dcache-ci avatar Mar 04 '22 11:03 dcache-ci

Can one of the admins verify this patch?

dcache-ci avatar Mar 04 '22 11:03 dcache-ci

Can one of the admins verify this patch?

dcache-ci avatar Mar 04 '22 11:03 dcache-ci

ok to test

kofemann avatar Mar 04 '22 12:03 kofemann

retest this please

kofemann avatar Mar 07 '22 13:03 kofemann

retest this please

kofemann avatar Mar 21 '22 14:03 kofemann

retest this please

kofemann avatar Mar 26 '22 16:03 kofemann

retest this please

kofemann avatar Mar 26 '22 19:03 kofemann

retest this please

kofemann avatar Mar 28 '22 08:03 kofemann

retest this please

kofemann avatar Mar 28 '22 21:03 kofemann

retest this please

kofemann avatar Mar 29 '22 14:03 kofemann

retest this please

kofemann avatar Mar 30 '22 14:03 kofemann

I guess the error

bin/populate: 59: /scratch/jenkins/jenkins/workspace/dCache-master-debian/packages/system-test/target/dcache/share/lib/loadConfig.sh: Syntax error: "(" unexpected (expecting "then")

is the result of this change. Can you check debian build?

kofemann avatar Mar 30 '22 16:03 kofemann

Finally got to work on fixing this PR, took a while, the issue was caused by the =~ only being supported by the Bourne-Again Shell and not just shell (not sure on this, but probably). Issue now solved by just using grep, probably the safer solution.

LukasMansour avatar Jul 26 '22 11:07 LukasMansour

ok to test

kofemann avatar Jul 27 '22 08:07 kofemann

ok to test

kofemann avatar Aug 30 '22 08:08 kofemann

Thanks, @LukasMansour

kofemann avatar Aug 30 '22 08:08 kofemann

Thanks, @LukasMansour

No problem, please note Closes: #6382

LukasMansour avatar Aug 30 '22 09:08 LukasMansour