Skip to content

Commit

Permalink
Enable s390x testsuite run (#225)
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Strukelj <marko.strukelj@gmail.com>
  • Loading branch information
mstruk authored Feb 21, 2024
1 parent e108c65 commit 2e0f6b3
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ jobs:
apt:
packages:
- maven
env:
- DOCKER_COMPOSE_VERSION=v2.24.5
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- export JAVA_HOME=/usr/lib/jvm/temurin-17-jdk-s390x
- export PATH=$JAVA_HOME/bin:$PATH
- os: linux
arch: ppc64le
jdk: openjdk17
Expand Down
22 changes: 21 additions & 1 deletion .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,27 @@ if [ "$arch" != 'ppc64le' ]; then
fi

# Run testsuite
if [ "$arch" != 'ppc64le' ] && [ "$arch" != 's390x' ]; then
if [ "$arch" == 's390x' ]; then
# Build s390x compatible hydra image
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/s390x-linux-gnu/jni

cd target
git clone -b 23.0.5 https://github.com/keycloak/keycloak.git
cd keycloak/quarkus/container
docker build . -t quay.io/keycloak/keycloak:23.0.5
cd ../../../.. && rm -rf target/keycloak

docker build --target hydra-import -t strimzi-oauth-testsuite/hydra-import:latest -f ./testsuite/docker/hydra-import/Dockerfile.s390x .
docker build --target oryd-hydra -t oryd/hydra:v1.8.5 -f ./testsuite/docker/hydra-import/Dockerfile.s390x .

mvn test-compile spotbugs:check -e -V -B -f testsuite
set +e
clearDockerEnv
mvn -e -V -B clean install -f testsuite -Pkafka-3_6_1
EXIT=$?
exitIfError
set -e
elif [[ "$arch" != 'ppc64le' ]]; then
mvn test-compile spotbugs:check -e -V -B -f testsuite $MAVEN_EXTRA_ARGS

set +e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class HydraAuthenticationTest {
new TestContainersWatcher(new File("docker-compose.yml"))
.withServices("hydra", "hydra-import", "hydra-jwt", "hydra-jwt-import", "zookeeper", "kafka")
.waitingFor("kafka", Wait.forLogMessage(".*started \\(kafka.server.KafkaServer\\).*", 1)
.withStartupTimeout(Duration.ofSeconds(180)));
.withStartupTimeout(Duration.ofSeconds(300)));

@Rule
public TestRule logCollector = new TestContainersLogCollector(environment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class KeycloakAuthenticationTest {
new TestContainersWatcher(new File("docker-compose.yml"))
.withServices("keycloak", "zookeeper", "kafka")
.waitingFor("kafka", Wait.forLogMessage(".*started \\(kafka.server.KafkaServer\\).*", 1)
.withStartupTimeout(Duration.ofSeconds(180)));
.withStartupTimeout(Duration.ofSeconds(300)));

@Rule
public TestRule logCollector = new TestContainersLogCollector(environment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class KeycloakKRaftAuthorizationTests {

// ensure kafka has started
.waitingFor("kafka", Wait.forLogMessage(".*started \\(kafka.server.KafkaRaftServer\\).*", 1)
.withStartupTimeout(Duration.ofSeconds(120)));
.withStartupTimeout(Duration.ofSeconds(300)));

// ensure ACLs for user 'alice' have been added
// Moved into test code: waitForACLs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,8 @@ public static String loginWithUsernamePassword(URI tokenEndpointUri, String user
public static void waitForACLs() throws Exception {

// Create admin client using user `admin:admin-password` over PLAIN listener (port 9100)
try (AdminClient adminClient = buildAdminClientForPlain(PLAIN_LISTENER, "admin")) {

TestUtil.waitForCondition(() -> {
TestUtil.waitForCondition(() -> {
try (AdminClient adminClient = buildAdminClientForPlain(PLAIN_LISTENER, "admin")) {
try {
Collection<AclBinding> result = adminClient.describeAcls(new AclBindingFilter(ResourcePatternFilter.ANY,
new AccessControlEntryFilter("User:alice", null, AclOperation.IDEMPOTENT_WRITE, AclPermissionType.ALLOW))).values().get();
Expand All @@ -188,8 +187,8 @@ public static void waitForACLs() throws Exception {
} catch (Throwable e) {
throw new RuntimeException("ACLs for User:alice could not be retrieved: ", e);
}
}, 500, 210);
}
}
}, 2000, 210);
}

Producer<String, String> getProducer(final String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class KeycloakAuthorizationTests {
.withServices("keycloak", "zookeeper", "kafka", "kafka-acls")
// ensure kafka has started
.waitingFor("kafka", Wait.forLogMessage(".*started \\(kafka.server.KafkaServer\\).*", 1)
.withStartupTimeout(Duration.ofSeconds(120)));
.withStartupTimeout(Duration.ofSeconds(300)));

// ensure ACLs for user 'alice' have been added
// Moved into test code: waitForACLs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class KeycloakZKAuthorizationTests {
.withServices("keycloak", "zookeeper", "kafka", "kafka-acls")
// ensure kafka has started
.waitingFor("kafka", Wait.forLogMessage(".*started \\(kafka.server.KafkaServer\\).*", 1)
.withStartupTimeout(Duration.ofSeconds(120)));
.withStartupTimeout(Duration.ofSeconds(300)));

// ensure ACLs for user 'alice' have been added
// Moved into test code: waitForACLs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class KeycloakErrorsTest {
new TestContainersWatcher(new File("docker-compose.yml"))
.withServices("keycloak", "zookeeper", "kafka")
.waitingFor("kafka", Wait.forLogMessage(".*started \\(kafka.server.KafkaServer\\).*", 1)
.withStartupTimeout(Duration.ofSeconds(180)));
.withStartupTimeout(Duration.ofSeconds(300)));

@Rule
public TestRule logCollector = new TestContainersLogCollector(environment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ private static TestContainersWatcher initWatcher() {
if (includeKerberosTests) {
watcher.withServices("mockoauth", "kerberos", "kafka", "zookeeper")
.waitingFor("kerberos", Wait.forLogMessage(".*commencing operation.*", 1)
.withStartupTimeout(Duration.ofSeconds(45)));
.withStartupTimeout(Duration.ofSeconds(180)));
} else {
watcher.withServices("mockoauth", "kafka", "zookeeper");
}
watcher.waitingFor("mockoauth", Wait.forLogMessage(".*Succeeded in deploying verticle.*", 1)
.withStartupTimeout(Duration.ofSeconds(180)))
.waitingFor("kafka", Wait.forLogMessage(".*started \\(kafka.server.KafkaServer\\).*", 1)
.withStartupTimeout(Duration.ofSeconds(180)));
.withStartupTimeout(Duration.ofSeconds(300)));

return watcher;
}
Expand Down

0 comments on commit 2e0f6b3

Please sign in to comment.