]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/tests: add os-specific java 1.7 install commands to keycloak task 67578/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Fri, 27 Feb 2026 20:56:29 +0000 (15:56 -0500)
committerJ. Eric Ivancich <ivancich@redhat.com>
Sat, 28 Feb 2026 01:25:43 +0000 (20:25 -0500)
Add commands to keycloak task specific for rocky, rhel, centos, and
ubuntu. Also, clean-up installed package(s) after test is run.

This is necessary as rocky can't install the same package(s) that the
other os types currently can.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
qa/suites/rgw/sts/tasks/1-keycloak.yaml
qa/tasks/keycloak.py

index 4436f254f416d20c2c59fa22741eb424b61d11db..31263752941bb7f43df156b041b877b6d7f5e638 100644 (file)
@@ -3,12 +3,3 @@ tasks:
 - keycloak:
     client.0:
       keycloak_version: 11.0.0
-
-overrides:
-  install:
-    ceph:
-      extra_system_packages:
-        rpm:
-        - java-17-openjdk-headless
-        deb:
-        - openjdk-17-jdk-headless
index 1d89a27a5e18857f759c196870194ac1e3eca75a..8b1fb4e8a2ccdb48dc187c3214cabc16bb8d4501 100644 (file)
@@ -39,15 +39,31 @@ def toxvenv_sh(ctx, remote, args, **kwargs):
 @contextlib.contextmanager
 def install_packages(ctx, config):
     """
+    Install a version of Java 1.7 appropriate to the os_type
     Downloading the two required tar files
     1. Keycloak
     2. Wildfly (Application Server)
     """
     assert isinstance(config, dict)
-    log.info('Installing packages for Keycloak...')
+    log.info('Installing packages for Keycloak and Java 1.7...')
+
+    os_type = teuthology.get_distro(ctx)
+    os_version = teuthology.get_distro_version(ctx)
 
     for (client, _) in config.items():
         (remote,) = ctx.cluster.only(client).remotes.keys()
+
+        if os_type in ['rocky']:
+            toxvenv_sh(ctx, remote, ['sudo', 'dnf', 'install', '-y', 'adoptium-temurin-java-repository'])
+            toxvenv_sh(ctx, remote, ['sudo', 'dnf', 'config-manager', '--set-enabled', 'adoptium-temurin-java-repository'])
+            toxvenv_sh(ctx, remote, ['sudo', 'dnf', 'install', '-y', 'temurin-17-jdk'])
+        elif os_type in ['centos', 'rhel']:
+            toxvenv_sh(ctx, remote, ['sudo', 'dnf', 'install', '-y', 'java-17-openjdk-headless'])
+        elif os_type in ['ubuntu']:
+            toxvenv_sh(ctx, remote, ['sudo', 'apt', 'install', '-y', 'openjdk-17-jdk-headless'])
+        else:
+            raise RuntimeError(f'unsupported distro {os_type} for keycloak')
+
         test_dir=teuthology.get_testdir(ctx)
         current_version = get_keycloak_version(config)
         link1 = 'https://downloads.jboss.org/keycloak/'+current_version+'/keycloak-'+current_version+'.tar.gz'
@@ -65,7 +81,7 @@ def install_packages(ctx, config):
     try:
         yield
     finally:
-        log.info('Removing packaged dependencies of Keycloak...')
+        log.info('Removing packaged dependencies of Keycloak and Java 1.7...')
         for client in config:
             current_version = get_keycloak_version(config)
             ctx.cluster.only(client).run(
@@ -76,6 +92,16 @@ def install_packages(ctx, config):
                 args=['rm', '-rf', '{tdir}'.format(tdir=get_keycloak_dir(ctx,config))],
             )
 
+            if os_type in ['rocky']:
+                toxvenv_sh(ctx, remote, ['sudo', 'dnf', 'remove', '-y', 'temurin-17-jdk'])
+                toxvenv_sh(ctx, remote, ['sudo', 'dnf', 'remove', '-y', 'adoptium-temurin-java-repository'])
+            elif os_type in ['centos', 'rhel']:
+                toxvenv_sh(ctx, remote, ['sudo', 'dnf', 'remove', '-y', 'java-17-openjdk-headless'])
+            elif os_type in ['ubuntu']:
+                toxvenv_sh(ctx, remote, ['sudo', 'apt', 'remove', '-y', 'openjdk-17-jdk-headless'])
+            else:
+                raise RuntimeError(f'unsupported distro {os_type} for keycloak')
+
 @contextlib.contextmanager
 def download_conf(ctx, config):
     """