From ee710390d277784ddac3d70c9e11e427f46f363d Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Fri, 27 Feb 2026 15:56:29 -0500 Subject: [PATCH] rgw/tests: add os-specific java 1.7 install commands to keycloak task 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 --- qa/suites/rgw/sts/tasks/1-keycloak.yaml | 9 -------- qa/tasks/keycloak.py | 30 +++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/qa/suites/rgw/sts/tasks/1-keycloak.yaml b/qa/suites/rgw/sts/tasks/1-keycloak.yaml index 4436f254f41..31263752941 100644 --- a/qa/suites/rgw/sts/tasks/1-keycloak.yaml +++ b/qa/suites/rgw/sts/tasks/1-keycloak.yaml @@ -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 diff --git a/qa/tasks/keycloak.py b/qa/tasks/keycloak.py index 1d89a27a5e1..8b1fb4e8a2c 100644 --- a/qa/tasks/keycloak.py +++ b/qa/tasks/keycloak.py @@ -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): """ -- 2.47.3