@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'
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(
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):
"""