[ "$res" -ne "0" ]
}
+mktemp_compat() {
+ case "$platform" in
+ macos*)
+ # On MacOSX, mktemp doesn't respect TMPDIR in the same way as many
+ # other systems. Use the final positional argument to force the
+ # tempfile or tempdir to be created inside $TMPDIR, which must
+ # already exist.
+ if [ -n "${TMPDIR}" ] ; then
+ mktemp "${@}" "${TMPDIR}/tmp.XXXXXXXXXX"
+ else
+ mktemp "${@}"
+ fi
+ ;;
+ *)
+ mktemp "${@}"
+ ;;
+ esac
+}
+
print_header() {
set +x
LTTNG_TOOLS_GEN_COMPILE_COMMANDS="${LTTNG_TOOLS_GEN_COMPILE_COMMANDS:-no}"
LTTNG_TOOLS_RUN_TESTS="${LTTNG_TOOLS_RUN_TESTS:-yes}"
LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION="${LTTNG_TOOLS_RUN_TESTS_LONG_REGRESSION:-no}"
+LTTNG_TOOLS_RUN_UST_JAVA_TESTS="${LTTNG_TOOLS_RUN_UST_JAVA_TESTS:-yes}"
LTTNG_TOOLS_CLANG_TIDY="${LTTNG_TOOLS_CLANG_TIDY:-no}"
SRCDIR="$WORKSPACE/src/lttng-tools"
$MAKE -j"$($NPROC)" V=1
$MAKE modules_install V=1
depmod
+
+ if [[ -f /etc/products.d/SLES.prod ]] ; then
+ echo 'allow_unsupported_modules 1' > /etc/modprobe.d/10-unsupported-modules.conf
+ fi
fi
# Print build env details
print_header "Build environment details"
+print_hardware || true
print_os || true
print_tooling || true
agents)
print_header "Conf: Java and Python agents"
- export JAVA_HOME="/usr/lib/jvm/default-java"
+ if [[ -z "${JAVA_HOME:-}" ]] ; then
+ export JAVA_HOME="/usr/lib/jvm/default-java"
+ fi
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"
+ if [[ -f /etc/products.d/SLES.prod ]] ; then
+ export JAVA_HOME="/usr/${LIBDIR_ARCH}/jvm/java-1.8.0-openjdk-1.8.0"
+ export PATH="/usr/${LIBDIR_ARCH}/jvm/java-1.8.0-openjdk-1.8.0/bin:/usr/${LIBDIR_ARCH}/jvm/jre-1.8.0-openjdk/bin:${PATH}"
+ SLES_VERSION="$(grep -E '</version>' /etc/products.d/SLES.prod | grep -E -o '[0-9]+\.[0-9]+')"
+ if vergte "${SLES_VERSION}" "15.4" ; then
+ export CLASSPATH="${DEPS_JAVA}/lttng-ust-agent-all.jar:/usr/share/java/log4j/log4j-api.jar:/usr/share/java/log4j/log4j-core.jar:/usr/share/java/log4j12/log4j-12.jar"
+ fi
+ fi
+
CONF_OPTS+=("--enable-python-bindings" "--enable-test-java-agent-all")
print_header "Conf: Relayd only"
CONF_OPTS+=("--disable-bin-lttng" "--disable-bin-lttng-consumerd" "--disable-bin-lttng-crash" "--disable-bin-lttng-sessiond" "--disable-extras" "--disable-man-pages" "--without-lttng-ust")
+
+ # A config option for lib-lttng-ctl was added in 2.14
+ if vergte "$PACKAGE_VERSION" "2.14"; then
+ CONF_OPTS+=("--disable-lib-lttng-ctl")
+ fi
;;
debug-rcu)
print_header "Build: Out of tree"
# Create and enter a temporary build directory
- builddir=$(mktemp -d)
+ builddir=$(mktemp_compat -d)
cd "$builddir"
"$SRCDIR/configure" "${CONF_OPTS[@]}" || failed_configure
$MAKE dist
# Create and enter a temporary build directory
- builddir=$(mktemp -d)
+ builddir=$(mktemp_compat -d)
cd "$builddir"
# Extract the distribution tar in the build directory,
print_header "Build: Distribution Out of tree"
# Create and enter a temporary build directory
- builddir=$(mktemp -d)
+ builddir=$(mktemp_compat -d)
cd "$builddir"
# Run configure out of tree and generate the tar file
"$SRCDIR/configure" "${DIST_CONF_OPTS[@]}" || failed_configure
$MAKE dist
- dist_srcdir="$(mktemp -d)"
+ dist_srcdir="$(mktemp_compat -d)"
cd "$dist_srcdir"
# Extract the distribution tar in the new source directory,
$TAR xvf "$builddir"/*.tar.* --strip 1
# Create and enter a second temporary build directory
- builddir="$(mktemp -d)"
+ builddir="$(mktemp_compat -d)"
cd "$builddir"
# Run configure from the extracted distribution tar,
make --keep-going check || exit_status=1
- # Copy tap logs for the jenkins tap parser before cleaning the build dir
+ # Copy tap logs for the jenkins tap parser before cleaning the build dir
rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*' tests/ "$TAPDIR"
# Copy the test suites top-level log which includes all tests failures
prove --merge -v --exec '' - < long_regression --archive "$TAPDIR/long_regression/" || exit_status=1
cd ..
fi
+
+ if [ "$LTTNG_TOOLS_RUN_UST_JAVA_TESTS" = "yes" ] && [ "$LTTNG_TOOLS_MAKE_INSTALL" = "yes" ] && [ "$conf" = "agents" ] ; then
+ print_header "Run lttng-ust-java-tests"
+ # Git Source
+ LTTNG_UST_JAVA_TESTS_GIT_SOURCE="${LTTNG_UST_JAVA_TESTS_GIT_SOURCE:-https://github.com/lttng/lttng-ust-java-tests.git}"
+ LTTNG_UST_JAVA_TESTS_GIT_BRANCH="${LTTNG_UST_JAVA_TESTS_GIT_BRANCH:-master}"
+
+ OWD="$(pwd)"
+ cd ..
+ git clone -b "${LTTNG_UST_JAVA_TESTS_GIT_BRANCH}" "${LTTNG_UST_JAVA_TESTS_GIT_SOURCE}" lttng-ust-java-tests
+ cd lttng-ust-java-tests
+
+ LTTNG_UST_JAVA_TESTS_ENV=(
+ # Some ci nodes (eg. SLES12) don't have maven distributed by their
+ # package manager. As a result, the maven binary is deployed in
+ # '/opt/apache/maven/bin'.
+ PATH="${WORKSPACE}/build/bin/:$PATH:/opt/apache/maven/bin/"
+ LD_LIBRARY_PATH="${WORKSPACE}/build/${LIBDIR}/:${WORKSPACE}/build/${LIBDIR_ARCH}:$LD_LIBRARY_PATH"
+ LTTNG_UST_DEBUG=1
+ LTTNG_CONSUMERD32_BIN="${WORKSPACE}/build/${LIBDIR_ARCH}/lttng/libexec/lttng-consumerd"
+ LTTNG_CONSUMERD64_BIN="${WORKSPACE}/build/${LIBDIR_ARCH}/lttng/libexec/lttng-consumerd"
+ LTTNG_SESSION_CONFIG_XSD_PATH="${WORKSPACE}/build/share/xml/lttng"
+ BABELTRACE_PLUGIN_PATH="${WORKSPACE}/deps/build/${LIBDIR_ARCH}/babeltrace2/plugins"
+ LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="${WORKSPACE}/deps/build/${LIBDIR_ARCH}/babeltrace2/plugin-providers"
+ )
+ LTTNG_UST_JAVA_TESTS_MAVEN_OPTS=(
+ "-Dmaven.test.failure.ignore=true"
+ "-Dcommon-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-common.jar"
+ "-Djul-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-jul.jar"
+ "-Dlog4j-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j.jar"
+ "-Dlog4j2-jar-location=${WORKSPACE}/deps/build/share/java/lttng-ust-agent-log4j2.jar"
+ "-DargLine=-Djava.library.path=${WORKSPACE}/deps/build/${LIBDIR_ARCH}"
+ '-Dgroups=!domain:log4j2'
+ )
+
+ env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn -version
+
+ if [[ -n "${LTTNG_TOOLS_UST_JAVA_TESTS_LOG4J_API_VERSION:-}" ]] ; then
+ env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn versions:use-dep-version -Dincludes=org.apache.logging.log4j:'*' -DdepVersion="${LTTNG_TOOLS_UST_JAVA_TESTS_LOG4J_API_VERSION}"
+ fi
+
+ mkdir -p "${WORKSPACE}/log"
+ env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" lttng-sessiond -b -vvv 1>"${WORKSPACE}/log/lttng-ust-java-tests-lttng-sessiond.log" 2>&1
+ env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn "${LTTNG_UST_JAVA_TESTS_MAVEN_OPTS[@]}" clean compile dependency:build-classpath dependency:tree verify || exit_status=1
+ killall lttng-sessiond
+
+ cd "${OWD}"
+ fi
fi
if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ "$conf" =~ (no-ust|relayd-only) ]]; then