Commit | Line | Data |
---|---|---|
946bf6a7 JR |
1 | #!/bin/bash |
2 | # shellcheck disable=SC2103 | |
3 | # | |
4 | # Copyright (C) 2022 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com> | |
363515a5 | 5 | # Copyright (C) 2023 Michael Jeanson <mjeanson@efficios.com> |
946bf6a7 JR |
6 | # |
7 | # This program is free software: you can redistribute it and/or modify | |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation, either version 3 of the License, or | |
10 | # (at your option) any later version. | |
11 | # | |
12 | # This program is distributed in the hope that it will be useful, | |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public License | |
18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | set -eux | |
21 | ||
22 | BASEDIR_64="$WORKSPACE/deps-64/build" | |
23 | BASEDIR_32="$WORKSPACE/deps-32/build" | |
363515a5 MJ |
24 | PREFIX="/build" |
25 | ||
946bf6a7 JR |
26 | export CPPFLAGS="-I$BASEDIR_64/include" |
27 | export LDFLAGS="-L$BASEDIR_64/lib" | |
28 | export CFLAGS="-g -O0" | |
29 | export CXXFLAGS="-g -O0" | |
30 | export PKG_CONFIG_PATH="$BASEDIR_64/lib/pkgconfig" | |
31 | export LD_LIBRARY_PATH="$BASEDIR_64/lib:$BASEDIR_32/lib" | |
32 | export PATH="$PATH:$BASEDIR_64/bin" | |
363515a5 | 33 | |
946bf6a7 JR |
34 | export BABELTRACE_PLUGIN_PATH="$BASEDIR_64/lib/babeltrace2/plugins/" |
35 | export LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="$BASEDIR_64/lib/babeltrace2/plugin-providers/" | |
363515a5 | 36 | |
946bf6a7 JR |
37 | export JAVA_HOME="/usr/lib/jvm/default-java" |
38 | DEPS_JAVA="$WORKSPACE/deps-64/build/share/java" | |
39 | export CLASSPATH="$DEPS_JAVA/lttng-ust-agent-all.jar:/usr/share/java/log4j-api.jar:/usr/share/java/log4j-core.jar:/usr/share/java/log4j-1.2.jar" | |
363515a5 | 40 | |
946bf6a7 JR |
41 | export PYTHON2="python2" |
42 | export PYTHON3="python3" | |
363515a5 MJ |
43 | |
44 | if command -v $PYTHON2 >/dev/null 2>&1; then | |
45 | P2_VERSION=$($PYTHON2 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') | |
46 | DEPS_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages" | |
47 | ||
48 | PYTHON_TEST_ARG="--enable-test-python-agent-all" | |
49 | else | |
50 | PYTHON_TEST_ARG="--enable-test-python3-agent" | |
51 | fi | |
52 | ||
53 | P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') | |
946bf6a7 | 54 | DEPS_PYTHON3="$WORKSPACE/deps-64/build/lib/python$P3_VERSION/site-packages" |
363515a5 MJ |
55 | |
56 | # Most build configs require access to the babeltrace 2 python bindings. | |
57 | # This also makes the lttngust python agent available for `agents` builds. | |
58 | export PYTHONPATH="${DEPS_PYTHON2:-}${DEPS_PYTHON2:+:}$DEPS_PYTHON3" | |
59 | ||
946bf6a7 JR |
60 | export LTTNG_CONSUMERD32_BIN="$BASEDIR_32/lib/lttng/libexec/lttng-consumerd" |
61 | export LTTNG_CONSUMERD32_LIBDIR="$BASEDIR_32/lib" | |
62 | export LTTNG_CONSUMERD64_BIN="$BASEDIR_64/lib/lttng/libexec/lttng-consumerd" | |
63 | export LTTNG_CONSUMERD64_LIBDIR="$BASEDIR_64/lib/" | |
64 | ||
65 | # Stable 2.12 and 2.13 still look for "babeltrace" | |
66 | ln -s "$BASEDIR_64/bin/babeltrace2" "$BASEDIR_64/bin/babeltrace" | |
67 | ||
68 | echo "# Setup endpoint | |
69 | host_base = obj.internal.efficios.com | |
70 | host_bucket = obj.internal.efficios.com | |
71 | bucket_location = us-east-1 | |
72 | use_https = True | |
73 | ||
74 | # Setup access keys | |
75 | access_key = jenkins | |
76 | secret_key = echo123456 | |
77 | ||
78 | # Enable S3 v4 signature APIs | |
79 | signature_v2 = False" > "$WORKSPACE/.s3cfg" | |
80 | ||
81 | ||
82 | mkdir artefact | |
83 | pushd artefact | |
84 | s3cmd -c "$WORKSPACE/.s3cfg" get "s3://jenkins/32-64-bit-integration/$ARTIFACT_ID" | |
85 | tar -xvf "$ARTIFACT_ID" | |
86 | popd | |
87 | ||
88 | cp -r artefact/sources/* ./ | |
89 | cp -r artefact/deps/* ./ | |
90 | ||
91 | pushd src/lttng-modules | |
92 | make -j"$(nproc)" V=1 | |
93 | make modules_install | |
94 | depmod -a | |
95 | popd | |
96 | ||
97 | pushd src/lttng-tools | |
98 | ||
99 | ./bootstrap | |
363515a5 | 100 | ./configure --prefix="$PREFIX" --enable-test-java-agent-all $PYTHON_TEST_ARG |
946bf6a7 JR |
101 | popd |
102 | ||
103 | # Deativate health test, simply because there is little value for this integration testing | |
104 | # and because de ld_preloaded object is for both lttng-sessiond/consumer leading to difficult ld_preloading | |
105 | # Deactivate clock plugin test since the app must load the correct biness so and the sessiond its bitness so, | |
106 | # this is simply not feasible from outside the script. There is little value for this test in this testing context. | |
107 | pushd src/lttng-tools/tests/regression | |
108 | sed -i '/tools\/health\/test_thread_ok/d' Makefile.am | |
109 | sed -i '/ust\/clock-override\/test_clock_override/d' Makefile.am | |
110 | popd | |
111 | ||
112 | pushd src/lttng-tools/ | |
113 | make -j"$(nproc)" V=1 | |
114 | popd | |
115 | ||
116 | case "$TEST_TYPE" in | |
117 | "canary") | |
118 | ;; | |
119 | "32bit-sessiond") | |
120 | pushd src/lttng-tools/src/bin/lttng-sessiond | |
121 | rm lttng-sessiond | |
122 | ln -s "$BASEDIR_32/bin/lttng-sessiond" lttng-sessiond | |
123 | popd | |
124 | ||
125 | cp -rv "$WORKSPACE/artefact/testing-overlay/sessiond/"* ./ | |
126 | ;; | |
127 | "32bit-relayd") | |
128 | pushd src/lttng-tools/src/bin/lttng-relayd | |
129 | rm lttng-relayd | |
130 | ln -s "$BASEDIR_32/bin/lttng-relayd" lttng-relayd | |
131 | popd | |
132 | ;; | |
133 | "32bit-cli") | |
134 | pushd src/lttng-tools/src/bin/lttng | |
135 | rm lttng | |
136 | ln -s "$BASEDIR_32/bin/lttng" lttng | |
137 | popd | |
138 | ;; | |
139 | *) | |
140 | exit 1 | |
141 | esac | |
142 | failed_test=0 | |
143 | pushd src/lttng-tools/tests | |
144 | make --keep-going check || failed_test=1 | |
145 | popd | |
146 | ||
147 | exit $failed_test |