From: Kienan Stewart Date: Wed, 10 Jan 2024 14:00:57 +0000 (-0500) Subject: jjb/ansible: Test lttng-ust-java-agents on slesbuilds X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4a9fa8bac1c3a78c004b457e37eea25fe303a53c;p=lttng-ci.git jjb/ansible: Test lttng-ust-java-agents on slesbuilds Change-Id: Ie3b77a9ed6276a73bc3446825c5017c67066aff2 Signed-off-by: Kienan Stewart --- diff --git a/automation/ansible/roles/common-node/tasks/setup-Suse.yml b/automation/ansible/roles/common-node/tasks/setup-Suse.yml index b1c3cd5..c94f6fb 100644 --- a/automation/ansible/roles/common-node/tasks/setup-Suse.yml +++ b/automation/ansible/roles/common-node/tasks/setup-Suse.yml @@ -4,3 +4,27 @@ - name: Ensure common_node packages are installed. zypper: "name={{ common_node_packages }} type=package state=present update_cache=yes" + +- name: Install maven from upstream binary + when: ansible_distribution_major_version == "12" + block: + - name: Create directory in /opt + ansible.builtin.file: + path: '/opt/apache' + state: 'directory' + - name: Download release + ansible.builtin.get_url: + url: 'https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz' + checksum: 'sha512:https://downloads.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz.sha512' + dest: '/opt/apache' + - name: Unarchive release + ansible.builtin.unarchive: + dest: '/opt/apache/' + src: '/opt/apache/apache-maven-3.9.6-bin.tar.gz' + remote_src: true + creates: '/opt/apache/apache-maven-3.9.6' + - name: Link /opt/apache/maven to latest version + ansible.builtin.file: + dest: '/opt/apache/maven' + state: 'link' + src: '/opt/apache/apache-maven-3.9.6' diff --git a/automation/ansible/roles/common-node/vars/SLES-12.yml b/automation/ansible/roles/common-node/vars/SLES-12.yml new file mode 100644 index 0000000..eddf09e --- /dev/null +++ b/automation/ansible/roles/common-node/vars/SLES-12.yml @@ -0,0 +1,27 @@ +--- +common_node_patterns: + - base + - Minimal + - Basis-Devel + +common_node_packages: + - autoconf + - automake + - bison + - curl + - flex + - gettext-runtime + - git-core + - java-11-openjdk-devel + - java-11-openjdk-headless +# - jq + - libopenssl-devel +# - libtap-harness-archive-perl + - libtool +# - maven + - openssh + - psmisc +# - python-virtualenv + - sudo + - tree + - vim diff --git a/automation/ansible/roles/common-node/vars/Suse.yml b/automation/ansible/roles/common-node/vars/Suse.yml index 4e13642..25ab51c 100644 --- a/automation/ansible/roles/common-node/vars/Suse.yml +++ b/automation/ansible/roles/common-node/vars/Suse.yml @@ -18,6 +18,7 @@ common_node_packages: - libopenssl-devel # - libtap-harness-archive-perl - libtool + - maven - openssh - psmisc # - python-virtualenv diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml index d205830..335859c 100644 --- a/jobs/lttng-tools.yaml +++ b/jobs/lttng-tools.yaml @@ -155,7 +155,7 @@ ;; esac # Run java tests only on 'linuxbuild' jobs - if [ "{buildtype}" = "linuxbuild" ]; then + if [ "{buildtype}" = "linuxbuild" ] || [ "{buildtype}" = "slesbuild" ]; then echo "LTTNG_TOOLS_RUN_UST_JAVA_TESTS=yes" >> env.properties else echo "LTTNG_TOOLS_RUN_UST_JAVA_TESTS=no" >> env.properties diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index ceec4bb..387832f 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -322,7 +322,9 @@ no-ust) 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" CONF_OPTS+=("--enable-python-bindings" "--enable-test-java-agent-all") @@ -551,14 +553,17 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only) cd lttng-ust-java-tests LTTNG_UST_JAVA_TESTS_ENV=( - PATH="${WORKSPACE}/build/bin/:$PATH" - LD_LIBRARY_PATH="${WORKSPACE}/build/lib:$LD_LIBRARY_PATH" + # 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/lib/lttng/libexec/lttng-consumerd" - LTTNG_CONSUMERD64_BIN="${WORKSPACE}/build/lib/lttng/libexec/lttng-consumerd" + 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/lib/babeltrace2/plugins" - LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="${WORKSPACE}/deps/build/lib/babeltrace2/plugin-providers" + 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" @@ -566,10 +571,11 @@ if [ "$LTTNG_TOOLS_RUN_TESTS" = "yes" ] && [[ ! "$conf" =~ (no-ust|relayd-only) "-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/lib" + "-DargLine=-Djava.library.path=${WORKSPACE}/deps/build/${LIBDIR_ARCH}" '-Dgroups=!domain:log4j2' ) env "${LTTNG_UST_JAVA_TESTS_ENV[@]}" mvn -version + 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 verify || exit_status=1 killall lttng-sessiond