]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: java s3-tests change setting of JAVA_HOME 68208/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 1 Apr 2026 16:29:01 +0000 (12:29 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 3 Apr 2026 23:26:41 +0000 (19:26 -0400)
Previously s3tests_java.py set JAVA_HOME using the `alternatives`
command. That had issues in that `alternatives` is not present on all
Ubuntu systems, and some installations of Java don't update
alternatives. So instead we look for a "java-8" jvm in /usr/lib/jvm/
and set JAVA_HOME to the first one we find.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
qa/tasks/s3tests_java.py

index a58aa6cf0b4b274c69a0cbe77f41e3c750e2c638..03ba946e7820ac65859fdb2ef2a4b3e7137203bf 100644 (file)
@@ -284,7 +284,7 @@ class S3tests_java(Task):
             args = ['cd',
                     '{tdir}/s3-tests-java'.format(tdir=testdir),
                     run.Raw('&&'),
-                    run.Raw('JAVA_HOME=$(alternatives --list | grep jre_1.8.0 | head -n 1 | awk \'{print $3}\')'),
+                    run.Raw('JAVA_HOME=$(ls -d /usr/lib/jvm/* | grep java-8 | head -n 1)'),
                     '/opt/gradle/gradle/bin/gradle', 'clean', 'test',
                     '--rerun-tasks', '--no-build-cache',
                     ]