|
1 | 1 | #!/bin/sh |
2 | | -# shellcheck disable=SC2155,SC2153,SC2038,SC1091,SC2116,SC2086 |
| 2 | +# shellcheck disable=SC2155,SC2153,SC2038,SC1091,SC2116,SC2086,SC2006 |
3 | 3 | # ******************************************************************************** |
4 | 4 | # Copyright (c) 2017, 2024 Contributors to the Eclipse Foundation |
5 | 5 | # |
|
12 | 12 | # |
13 | 13 | # SPDX-License-Identifier: Apache-2.0 |
14 | 14 | # ******************************************************************************** |
15 | | -# shellcheck disable=SC2006 |
16 | 15 | # |
17 | 16 | # dotests.sh |
18 | 17 | # Designed for running via a proxy machine for the Temurin Solaris tests |
|
24 | 23 | # ./dotests.sh sanity openjdk |
25 | 24 | # |
26 | 25 |
|
27 | | -if [ `uname -m` = i86pc ]; then ADOPTARCH=x64; else ADOPTARCH=sparcv9; fi |
28 | 26 | # Check for Xvfb on display :5 |
29 | | -XVFB5=`ps -fu vagrant | grep 'Xvfb :5' | grep -v grep | wc -l` |
30 | | - echo XVFB5 = $XVFB5 |
| 27 | +XVFB5=`ps -fu vagrant | awk '/Xvfb :5/ && !/awk/ {c=c+1} END {print c+0}'` |
| 28 | +echo "XVFB5 = $XVFB5" |
| 29 | + |
31 | 30 | if [ $XVFB5 != 1 ]; then |
32 | 31 | echo WARNING: Xvfb was not started - attempting to start ... |
33 | 32 | nohup /usr/X11/bin/Xvfb :5 -screen 0 1024x768x24 & |
34 | 33 | sleep 2 |
35 | | - XVFB5=`ps -fu vagrant | grep 'Xvfb :5' | grep -v grep | wc -l` |
| 34 | + XVFB5=`ps -fu vagrant | awk '/Xvfb :5/ && !/awk/ {c=c+1} END {print c+0}'` |
36 | 35 | echo XVFB5 = $XVFB5 |
37 | 36 | [ $XVFB5 != 1 ] && echo Still failed to start Xvfb - manual intervention required && exit 1 |
38 | 37 | fi |
|
50 | 49 | echo "ERROR: dotests.sh : UPSTREAM_JOBLINK not defined and build_artifacts/filenames.txt does not exist" - cannot progress |
51 | 50 | exit 1 |
52 | 51 | fi |
53 | | - JDK_TARBALL_NAME=`pwd`/build_artifacts/`cat build_artifacts/filenames.txt | grep "OpenJDK8U-jdk_.*tar.gz$"` |
| 52 | + JDK_TARBALL_NAME=`pwd`/build_artifacts/`grep "OpenJDK8U-jdk_.*tar.gz$" ./build_artifacts/filenames.txt` |
54 | 53 | else |
55 | 54 | # Linter can go do one if it objects to the backticks - "$(" is not understood by Solaris' bourne shell (SC2006) |
56 | 55 | JDK_TARBALL_NAME=`curl -s "${UPSTREAM_JOBLINK}/artifact/workspace/target/filenames.txt" | grep "OpenJDK8U-jdk_.*tar.gz$"` |
57 | 56 | [ -z "$JDK_TARBALL_NAME" ] && echo "Could not retrieve filenames.txt from $UPSTREAM_JOBLINK" && exit 1 |
58 | 57 | echo Downloading and extracting JDK tarball ... |
59 | 58 | curl -O "${UPSTREAM_JOBLINK}/artifact/workspace/target/$JDK_TARBALL_NAME" || exit 1 |
60 | 59 | fi |
61 | | - cd aqa-tests |
| 60 | + cd aqa-tests || exit 1 |
62 | 61 | gzip -cd "$JDK_TARBALL_NAME" | tar xpf - |
63 | 62 | echo Downloading and extracting JRE tarball ... Required for special.openjdk jdk_math_jre_0 target |
64 | 63 | JRE_TARBALL_NAME="`echo $JDK_TARBALL_NAME | sed s/jdk/jre/`" |
65 | | - if [ "$1" = "special" -a "$2" = "openjdk" ]; then |
66 | | - if [ ! -z "${UPSTREAM_JOBLINK}" ]; then |
67 | | - curl -O "${UPSTREAM_JOBLINK}/artifact/workspace/target/$JRE_TARBALL_NAME" || exit 1 |
| 64 | + if [ "$1" = "special" ]; then |
| 65 | + if [ "$2" = "openjdk" ]; then |
| 66 | + if [ "${UPSTREAM_JOBLINK}" != "" ]; then |
| 67 | + curl -O "${UPSTREAM_JOBLINK}/artifact/workspace/target/$JRE_TARBALL_NAME" || exit 1 |
| 68 | + fi |
| 69 | + gzip -cd "$JRE_TARBALL_NAME" | tar xpf - |
68 | 70 | fi |
69 | | - gzip -cd "$JRE_TARBALL_NAME" | tar xpf - |
70 | 71 | fi |
71 | 72 | fi |
72 | 73 | PWD=`pwd` |
73 | | -TEST_JDK_HOME=`ls -1d $PWD/jdk8u* | grep -v jre` |
74 | | -JRE_IMAGE=`ls -1d $PWD/jdk8u* | grep jre` |
| 74 | +TEST_JDK_HOME="" |
| 75 | +JRE_IMAGE="" |
| 76 | +for FILE in "$PWD"/jdk8u*; do |
| 77 | + [ "`echo "$FILE" | grep -v jre`" ] && TEST_JDK_HOME="$FILE" |
| 78 | + [ "`echo "$FILE" | grep jre`" ] && JRE_IMAGE="$FILE" |
| 79 | +done |
75 | 80 | env |
76 | 81 | # TODO: Check if this actually exists |
77 | | -[ -z "$TEST_JDK_HOME" ] && echo Could not resolve TEST_JDK_HOME - aborting && exit 1 |
| 82 | +[ -z "$TEST_JDK_HOME" ] && echo "Could not resolve TEST_JDK_HOME - aborting" && exit 1 |
78 | 83 | echo TEST_JDK_HOME=$TEST_JDK_HOME |
79 | 84 | "$TEST_JDK_HOME/bin/java" -version || exit 1 |
80 | 85 | BUILD_LIST=$2 |
81 | 86 | if [ "$BUILD_LIST" = "system" ]; then |
82 | | - mkdir -p `pwd`/systemtest_prereqs/mauve # systemtest_preqeqs not created til compile phase |
83 | | - curl -o `pwd`/systemtest_prereqs/mauve/mauve.jar \ |
| 87 | + mkdir -p "`pwd`/systemtest_prereqs/mauve" # systemtest_preqeqs not created til compile phase |
| 88 | + curl -o "`pwd`/systemtest_prereqs/mauve/mauve.jar" \ |
84 | 89 | https://ci.adoptium.net/job/systemtest.getDependency/lastSuccessfulBuild/artifact/systemtest_prereqs/mauve/mauve.jar |
85 | 90 | fi |
86 | 91 | GET_SH_PARAMS="" |
87 | 92 | if [ "$1" = "smoke" ]; then |
| 93 | + # shellcheck disable=SC2121 |
88 | 94 | set extended functional |
89 | 95 | GET_SH_PARAMS="--vendor_repos https://github.com/adoptium/temurin-build --vendor_branches master --vendor_dirs /test/functional" |
90 | 96 | BUILD_LIST=functional/buildAndPackage |
|
93 | 99 | PATH=/usr/local/bin:/opt/csw/bin:`echo $PATH | sed 's,/usr/xpg4/bin,,g'` |
94 | 100 | export TEST_JDK_HOME BUILD_LIST PATH JRE_IMAGE |
95 | 101 | [ "$3" != "usecache" ] && ./get.sh ${GET_SH_PARAMS} |
96 | | -cd TKG |
| 102 | +cd TKG || exit 1 |
97 | 103 | (echo VENDOR OPTIONS = $VENDOR_TEST_REPOS / $VENDOR_TEST_DIRS / $VENDOR_TEST_BRANCHES) |
98 | 104 | gmake compile |
99 | | -echo SXAEC: Running gmake _$1.$2 from `pwd` |
| 105 | +echo SXAEC: Running gmake _$1.$2 from "`pwd`" |
100 | 106 | DISPLAY=:5; export DISPLAY |
101 | 107 | gmake _$1.$2 2>&1 | tee $1.$2.$$.log |
0 commit comments