jjb/ansible: Test lttng-ust-java-agents on slesbuilds
authorKienan Stewart <kstewart@efficios.com>
Wed, 10 Jan 2024 14:00:57 +0000 (09:00 -0500)
committerKienan Stewart <kstewart@efficios.com>
Fri, 2 Feb 2024 14:07:03 +0000 (09:07 -0500)
Change-Id: Ie3b77a9ed6276a73bc3446825c5017c67066aff2
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
automation/ansible/roles/common-node/tasks/setup-Suse.yml
automation/ansible/roles/common-node/vars/SLES-12.yml [new file with mode: 0644]
automation/ansible/roles/common-node/vars/Suse.yml
jobs/lttng-tools.yaml
scripts/lttng-tools/build.sh

index b1c3cd5e2531248b3b5b7385cc73f172c36541f7..c94f6fb0901225be194bf4917a6d564ab6025701 100644 (file)
@@ -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 (file)
index 0000000..eddf09e
--- /dev/null
@@ -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
index 4e13642b318c042b6dff2c2949e79848a438bce1..25ab51cc4afc3a2d985811b1f563e08316654216 100644 (file)
@@ -18,6 +18,7 @@ common_node_packages:
   - libopenssl-devel
 #  - libtap-harness-archive-perl
   - libtool
+  - maven
   - openssh
   - psmisc
 #  - python-virtualenv
index d205830045bf2270df908371f4c86d83e76999ef..335859cb3f268addd12f0bf6d3513941f16b52dc 100644 (file)
               ;;
           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
index ceec4bb153233cbd1411f0f94e49f7a22cc0c43b..387832f4ba7fc152bf4248b0eeca03fb3e860570 100755 (executable)
@@ -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
This page took 0.028295 seconds and 4 git commands to generate.