diff --git a/.travis.yml b/.travis.yml index 1764383a..d3411d6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/.travis/build.sh b/.travis/build.sh index 3fc80b21..9ec6c1dd 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -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 diff --git a/testsuite/hydra-test/src/test/java/io/strimzi/testsuite/oauth/HydraAuthenticationTest.java b/testsuite/hydra-test/src/test/java/io/strimzi/testsuite/oauth/HydraAuthenticationTest.java index ab8dca8f..c2466562 100644 --- a/testsuite/hydra-test/src/test/java/io/strimzi/testsuite/oauth/HydraAuthenticationTest.java +++ b/testsuite/hydra-test/src/test/java/io/strimzi/testsuite/oauth/HydraAuthenticationTest.java @@ -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); diff --git a/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakAuthenticationTest.java b/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakAuthenticationTest.java index 4229a19d..f45282f9 100644 --- a/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakAuthenticationTest.java +++ b/testsuite/keycloak-auth-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakAuthenticationTest.java @@ -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); diff --git a/testsuite/keycloak-authz-kraft-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakKRaftAuthorizationTests.java b/testsuite/keycloak-authz-kraft-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakKRaftAuthorizationTests.java index 3135ca71..1f3cb655 100644 --- a/testsuite/keycloak-authz-kraft-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakKRaftAuthorizationTests.java +++ b/testsuite/keycloak-authz-kraft-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakKRaftAuthorizationTests.java @@ -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() diff --git a/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/Common.java b/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/Common.java index 32426d75..7c924120 100644 --- a/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/Common.java +++ b/testsuite/keycloak-authz-tests/src/main/java/io/strimzi/testsuite/oauth/authz/Common.java @@ -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 result = adminClient.describeAcls(new AclBindingFilter(ResourcePatternFilter.ANY, new AccessControlEntryFilter("User:alice", null, AclOperation.IDEMPOTENT_WRITE, AclPermissionType.ALLOW))).values().get(); @@ -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 getProducer(final String name) { diff --git a/testsuite/keycloak-authz-tests/src/test/java/io/strimzi/testsuite/oauth/authz/KeycloakAuthorizationTests.java b/testsuite/keycloak-authz-tests/src/test/java/io/strimzi/testsuite/oauth/authz/KeycloakAuthorizationTests.java index 36907e06..3592aff3 100644 --- a/testsuite/keycloak-authz-tests/src/test/java/io/strimzi/testsuite/oauth/authz/KeycloakAuthorizationTests.java +++ b/testsuite/keycloak-authz-tests/src/test/java/io/strimzi/testsuite/oauth/authz/KeycloakAuthorizationTests.java @@ -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() diff --git a/testsuite/keycloak-authz-zk-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakZKAuthorizationTests.java b/testsuite/keycloak-authz-zk-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakZKAuthorizationTests.java index a5733e09..fd56297e 100644 --- a/testsuite/keycloak-authz-zk-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakZKAuthorizationTests.java +++ b/testsuite/keycloak-authz-zk-tests/src/test/java/io/strimzi/testsuite/oauth/authz/kraft/KeycloakZKAuthorizationTests.java @@ -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() diff --git a/testsuite/keycloak-errors-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakErrorsTest.java b/testsuite/keycloak-errors-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakErrorsTest.java index 61ca5842..f37fced9 100644 --- a/testsuite/keycloak-errors-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakErrorsTest.java +++ b/testsuite/keycloak-errors-tests/src/test/java/io/strimzi/testsuite/oauth/auth/KeycloakErrorsTest.java @@ -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); diff --git a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/MockOAuthTests.java b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/MockOAuthTests.java index ac2a0c2c..2bf4b5ee 100644 --- a/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/MockOAuthTests.java +++ b/testsuite/mockoauth-tests/src/test/java/io/strimzi/testsuite/oauth/MockOAuthTests.java @@ -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; }