Repository: EnMasseProject/enmasse
Pull request #2384 (2019-02-28 13:10:48)

Add IoT tenant service to the build
This change adds the IoT tenant service to the overall build. It
also renames the tenant-service project to "iot-tenant-service", as this
will also be reflected in the container image name.

ctron: @enmasse-ci run tests testcase=**.SmokeTest
ctron: @enmasse-ci run tests testcase=**.SmokeTest
ctron: @enmasse-ci run tests

Patch:
diff --git a/.jenkins/jenkins-functions.groovy b/.jenkins/jenkins-functions.groovy
index 0df1b42be..d021908fc 100644
--- a/.jenkins/jenkins-functions.groovy
+++ b/.jenkins/jenkins-functions.groovy
@@ -1,6 +1,6 @@
 def storeArtifacts(String artifactDir) {
-    sh "./systemtests/scripts/store_kubernetes_info.sh '${artifactDir}/openshift-info/'"
-    sh "./systemtests/scripts/collect_logs.sh '/tmp/testlogs' '${artifactDir}/openshift-logs'"
+    sh "./systemtests/scripts/store_kubernetes_info.sh '${artifactDir}/openshift-info/' || true"
+    sh "./systemtests/scripts/collect_logs.sh '/tmp/testlogs' '${artifactDir}/openshift-logs' || true"
     sh "cp -rf ${HOME}/.npm/_logs ${artifactDir}/npm-logs || true"
     sh 'rm -rf /tmp/testlogs'
 }
@@ -98,7 +98,6 @@ def postAction(String coresDir, String artifactDir) {
     if (status == null) {
         currentBuild.result = 'SUCCESS'
     }
-    tearDownOpenshift()
     sh "./systemtests/scripts/check_and_clear_cores.sh ${coresDir}"
 }
 
diff --git a/.travis.yml b/.travis.yml
index a307c541b..8b194fada 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,7 +18,7 @@ cache:
   directories:
     - "$HOME/.m2"
 jdk:
-- openjdk8
+- openjdk11
 python:
   - "2.7.14"
 go:
@@ -68,7 +68,7 @@ jobs:
         - tar xzf s2i.tar.gz
       install: true
       script:
-        - ./s2i build . fabric8/s2i-java:3.0-java8 tenant-service -e MAVEN_ARGS_APPEND="-pl io.enmasse:tenant-service --also-make" -e ARTIFACT_DIR="iot/tenant-service/target"
+        - ./s2i build . fabric8/s2i-java:3.0-java8 iot-tenant-service -e MAVEN_ARGS_APPEND="-pl io.enmasse:iot-tenant-service --also-make" -e ARTIFACT_DIR="iot/iot-tenant-service/target"
 env:
   global:
     - BRANCH=${TRAVIS_BRANCH}
diff --git a/.travis/build.sh b/.travis/build.sh
index 271165b53..99ad3fdfc 100755
--- a/.travis/build.sh
+++ b/.travis/build.sh
@@ -21,7 +21,7 @@ fi
 echo "Building EnMasse with tag $TAG, version $VERSION from $BRANCH. PR: $PULL_REQUEST"
 make clean
 
-make
+time make
 
 make docu_html
 
@@ -47,4 +47,4 @@ else
 fi
 
 echo "Running systemtests"
-./systemtests/scripts/run_test_kubernetes.sh templates/build/enmasse-${TAG} ${SYSTEMTEST_PROFILE} ${SYSTEMTEST_ARGS}
+time ./systemtests/scripts/run_test_kubernetes.sh templates/build/enmasse-${TAG} ${SYSTEMTEST_PROFILE} ${SYSTEMTEST_ARGS}
diff --git a/Makefile b/Makefile
index 8ff66cfce..bbe75abe4 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ TOPDIR          := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
 include $(TOPDIR)/Makefile.env.mk
 
 BUILD_DIRS       = none-authservice
-DOCKER_DIRS      = agent topic-forwarder artemis broker-plugin api-server address-space-controller standard-controller keycloak-plugin keycloak-controller router router-metrics mqtt-gateway mqtt-lwt service-broker
+DOCKER_DIRS      = agent topic-forwarder artemis broker-plugin api-server address-space-controller standard-controller keycloak-plugin keycloak-controller router router-metrics mqtt-gateway mqtt-lwt service-broker iot/iot-tenant-service
 FULL_BUILD       = true
 
 GO_DIRS          = iot/qdr-proxy-configurator iot/iot-operator iot/iot-gc
diff --git a/broker-plugin/sasl-delegation/src/main/java/io/enmasse/artemis/sasl_delegation/SaslDelegatingLogin.java b/broker-plugin/sasl-delegation/src/main/java/io/enmasse/artemis/sasl_delegation/SaslDelegatingLogin.java
index b7f6a8b25..e3b7aa40d 100644
--- a/broker-plugin/sasl-delegation/src/main/java/io/enmasse/artemis/sasl_delegation/SaslDelegatingLogin.java
+++ b/broker-plugin/sasl-delegation/src/main/java/io/enmasse/artemis/sasl_delegation/SaslDelegatingLogin.java
@@ -32,6 +32,7 @@ import java.security.NoSuchAlgorithmException;
 import java.security.Principal;
 import java.util.*;
 import java.util.function.BooleanSupplier;
+import java.util.stream.Collectors;
 import javax.naming.InvalidNameException;
 import javax.naming.ldap.LdapName;
 import javax.net.ssl.SSLContext;
@@ -352,9 +353,12 @@ public class SaslDelegatingLogin implements LoginModule {
             roles.addAll(defaultRolesAuthenticated);
 
             if (remoteProperties.get(Symbol.valueOf(GROUPS)) instanceof List) {
-                List<String> groups = (List<String>) remoteProperties.get(Symbol.valueOf(GROUPS));
+                List<String> groups = new ArrayList<>(((List<String>) ((List) remoteProperties.get(Symbol.valueOf(GROUPS)))));
                 groups.retainAll(SPECIAL_AUTHZ_GROUPS);
                 roles.addAll(groups);
+                for (String group : groups) {
+                    roles.add(group + "_#");
+                }
             }
         }
 
@@ -364,7 +368,7 @@ public class SaslDelegatingLogin implements LoginModule {
                 List<String> groups = new ArrayList<>();
                 for(Map.Entry<String, String[]> entry : authz.entrySet()) {
                     for(String permission : entry.getValue()) {
-                        groups.add(permission + "_" + entry.getKey());
+                        groups.add(permission + "_" + entry.getKey().replace('*', '#'));
                     }
                 }
                 roles.addAll(groups);
diff --git a/iot/iot-tenant-service/Dockerfile b/iot/iot-tenant-service/Dockerfile
new file mode 100644
index 000000000..55827e4ef
--- /dev/null
+++ b/iot/iot-tenant-service/Dockerfile
@@ -0,0 +1,10 @@
+FROM enmasseproject/java-base:8-11
+
+ARG version
+ARG maven_version
+ARG commit
+ENV VERSION=${version} COMMIT=${commit} MAVEN_VERSION=${maven_version}
+
+ADD target/iot-tenant-service-${MAVEN_VERSION}.jar /iot-tenant-service.jar
+
+CMD ["/opt/run-java/launch_java.sh", "/iot-tenant-service.jar"]
diff --git a/iot/tenant-service/Makefile b/iot/iot-tenant-service/Makefile
similarity index 100%
rename from iot/tenant-service/Makefile
rename to iot/iot-tenant-service/Makefile
diff --git a/iot/tenant-service/pom.xml b/iot/iot-tenant-service/pom.xml
similarity index 98%
rename from iot/tenant-service/pom.xml
rename to iot/iot-tenant-service/pom.xml
index 59445abc5..df8ecf70a 100644
--- a/iot/tenant-service/pom.xml
+++ b/iot/iot-tenant-service/pom.xml
@@ -11,7 +11,7 @@
     <version>0.27-SNAPSHOT</version>
   </parent>
 
-  <artifactId>tenant-service</artifactId>
+  <artifactId>iot-tenant-service</artifactId>
 
   <properties>
     <!--  Hono requires 3.5.4 -->
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/model/IoTProjects.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/model/IoTProjects.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/model/IoTProjects.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/model/IoTProjects.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/Application.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/Application.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/Application.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/Application.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/AmqpEndpointConfiguration.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/AmqpEndpointConfiguration.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/AmqpEndpointConfiguration.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/AmqpEndpointConfiguration.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/ApplicationConfiguration.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/ApplicationConfiguration.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/ApplicationConfiguration.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/ApplicationConfiguration.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/AuthenticationConfiguration.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/AuthenticationConfiguration.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/AuthenticationConfiguration.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/AuthenticationConfiguration.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/HttpEndpointConfiguration.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/HttpEndpointConfiguration.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/HttpEndpointConfiguration.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/HttpEndpointConfiguration.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/MetricsConfiguration.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/MetricsConfiguration.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/MetricsConfiguration.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/MetricsConfiguration.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/ServiceConfiguration.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/ServiceConfiguration.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/ServiceConfiguration.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/ServiceConfiguration.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/VertxConfiguration.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/VertxConfiguration.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/config/VertxConfiguration.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/config/VertxConfiguration.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/AbstractKubernetesTenantService.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/AbstractKubernetesTenantService.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/AbstractKubernetesTenantService.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/AbstractKubernetesTenantService.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantAmqpService.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantAmqpService.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantAmqpService.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantAmqpService.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantRestService.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantRestService.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantRestService.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantRestService.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceConfigProperties.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceConfigProperties.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceConfigProperties.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceConfigProperties.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceImpl.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceImpl.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceImpl.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/impl/TenantServiceImpl.java
diff --git a/iot/tenant-service/src/main/java/io/enmasse/iot/tenant/utils/HonoUtils.java b/iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/utils/HonoUtils.java
similarity index 100%
rename from iot/tenant-service/src/main/java/io/enmasse/iot/tenant/utils/HonoUtils.java
rename to iot/iot-tenant-service/src/main/java/io/enmasse/iot/tenant/utils/HonoUtils.java
diff --git a/iot/tenant-service/src/main/resources/banner.txt b/iot/iot-tenant-service/src/main/resources/banner.txt
similarity index 100%
rename from iot/tenant-service/src/main/resources/banner.txt
rename to iot/iot-tenant-service/src/main/resources/banner.txt
diff --git a/iot/tenant-service/src/main/resources/config/application-dev.yml b/iot/iot-tenant-service/src/main/resources/config/application-dev.yml
similarity index 100%
rename from iot/tenant-service/src/main/resources/config/application-dev.yml
rename to iot/iot-tenant-service/src/main/resources/config/application-dev.yml
diff --git a/iot/tenant-service/src/main/resources/config/application-prod.yml b/iot/iot-tenant-service/src/main/resources/config/application-prod.yml
similarity index 100%
rename from iot/tenant-service/src/main/resources/config/application-prod.yml
rename to iot/iot-tenant-service/src/main/resources/config/application-prod.yml
diff --git a/iot/tenant-service/src/main/resources/config/application.yml b/iot/iot-tenant-service/src/main/resources/config/application.yml
similarity index 100%
rename from iot/tenant-service/src/main/resources/config/application.yml
rename to iot/iot-tenant-service/src/main/resources/config/application.yml
diff --git a/iot/tenant-service/src/main/resources/logback-spring.xml b/iot/iot-tenant-service/src/main/resources/logback-spring.xml
similarity index 100%
rename from iot/tenant-service/src/main/resources/logback-spring.xml
rename to iot/iot-tenant-service/src/main/resources/logback-spring.xml
diff --git a/iot/tenant-service/src/test/java/io/enmasse/iot/tenant/TestApplication.java b/iot/iot-tenant-service/src/test/java/io/enmasse/iot/tenant/TestApplication.java
similarity index 100%
rename from iot/tenant-service/src/test/java/io/enmasse/iot/tenant/TestApplication.java
rename to iot/iot-tenant-service/src/test/java/io/enmasse/iot/tenant/TestApplication.java
diff --git a/iot/pom.xml b/iot/pom.xml
index c0d25398b..75b1e6a44 100644
--- a/iot/pom.xml
+++ b/iot/pom.xml
@@ -21,7 +21,7 @@
   </properties>
 
   <modules>
-    <module>tenant-service</module>
+    <module>iot-tenant-service</module>
   </modules>
 
   <dependencyManagement>
diff --git a/iot/tenant-service/Dockerfile b/iot/tenant-service/Dockerfile
deleted file mode 100644
index 5fb221c87..000000000
--- a/iot/tenant-service/Dockerfile
+++ /dev/null
@@ -1,9 +0,0 @@
-FROM enmasseproject/java-base:8-11
-
-ARG version
-ARG commit
-ENV VERSION=${version} COMMIT=${commit}
-
-ADD target/tenant-service-${VERSION}.jar /tenant-service.jar
-
-CMD ["/opt/run-java/launch_java.sh", "/tenant-service.jar"]
diff --git a/keycloak-user-api/src/main/java/io/enmasse/user/keycloak/KeycloakUserApi.java b/keycloak-user-api/src/main/java/io/enmasse/user/keycloak/KeycloakUserApi.java
index 648df5b05..832342013 100644
--- a/keycloak-user-api/src/main/java/io/enmasse/user/keycloak/KeycloakUserApi.java
+++ b/keycloak-user-api/src/main/java/io/enmasse/user/keycloak/KeycloakUserApi.java
@@ -16,15 +16,7 @@ import java.nio.charset.StandardCharsets;
 import java.time.Clock;
 import java.time.Duration;
 import java.time.Instant;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
@@ -325,7 +317,7 @@ public class KeycloakUserApi implements UserApi {
     /**
      * Create the set of desired groups.
      *
-     * @param user The user to create the groups for.
+     * @param authorization The authorization rule list to create the groups for.
      * @return A set of groups.
      */
     static Set<String> createDesiredGroupsSet(final List<UserAuthorization> authorization) {
@@ -338,11 +330,9 @@ public class KeycloakUserApi implements UserApi {
 
                 switch (operation) {
                     case manage:
-                        desiredGroups.add("manage_#");
                         desiredGroups.add("manage");
                         break;
                     case view:
-                        desiredGroups.add("monitor_#");
                         desiredGroups.add("monitor");
                         break;
                     default:
@@ -351,8 +341,6 @@ public class KeycloakUserApi implements UserApi {
                                 String groupName = operation.name() + "_" + encodePart(address);
                                 // normal name
                                 desiredGroups.add(groupName);
-                                // brokered name ( the set will remove duplicates for us)
-                                desiredGroups.add(groupName.replace("*", "#"));
                             }
                         }
                         break;
@@ -582,8 +570,8 @@ public class KeycloakUserApi implements UserApi {
 
     static User buildUser(UserRepresentation userRep, List<GroupRepresentation> groupReps) {
         log.debug("Creating user from user representation id {}, name {} part of groups {}", userRep.getId(), userRep.getUsername(), userRep.getGroups());
-        Map<String, Set<Operation>> operationsByAddress = new HashMap<>();
-        Set<Operation> globalOperations = new HashSet<>();
+        Map<String, Set<Operation>> operationsByAddress = new LinkedHashMap<>();
+        Set<Operation> globalOperations = new LinkedHashSet<>();
         for (GroupRepresentation groupRep : groupReps) {
             log.debug("Checking group id {} name {}", groupRep.getId(), groupRep.getName());
             if (groupRep.getName().startsWith("manage")) {
@@ -594,15 +582,15 @@ public class KeycloakUserApi implements UserApi {
                 String[] parts = groupRep.getName().split("_");
                 Operation operation = Operation.valueOf(parts[0]);
                 String address = decodePart(parts[1]);
-                operationsByAddress.computeIfAbsent(address, k -> new HashSet<>())
+                operationsByAddress.computeIfAbsent(address, k -> new LinkedHashSet<>())
                         .add(operation);
             }
         }
 
-        Map<Set<Operation>, Set<String>> operations = new HashMap<>();
+        Map<Set<Operation>, Set<String>> operations = new LinkedHashMap<>();
         for (Map.Entry<String, Set<Operation>> byAddressEntry : operationsByAddress.entrySet()) {
             if (!operations.containsKey(byAddressEntry.getValue())) {
-                operations.put(byAddressEntry.getValue(), new HashSet<>());
+                operations.put(byAddressEntry.getValue(), new LinkedHashSet<>());
             }
             operations.get(byAddressEntry.getValue()).add(byAddressEntry.getKey());
         }
diff --git a/pom.xml b/pom.xml
index 085eb756f..1dbb3b504 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,9 +59,10 @@
         <commons-collections.version>3.2.2</commons-collections.version>
         <guava.version>25.0-jre</guava.version>
         <hamcrest.version>1.3</hamcrest.version>
-        <junit.jupiter.version>5.3.1</junit.jupiter.version>
-        <junit.platform.runner.version>1.1.0</junit.platform.runner.version>
-        <junit.platform.launcher.version>1.3.0</junit.platform.launcher.version>
+        <junit.jupiter.version>5.4.0</junit.jupiter.version>
+        <junit.platform.runner.version>1.4.0</junit.platform.runner.version>
+        <junit.platform.launcher.version>1.4.0</junit.platform.launcher.version>
+        <junit.platform.surefire.provider.version>1.3.2</junit.platform.surefire.provider.version>
         <artemis.version>2.6.4</artemis.version>
         <ngwebdriver.version>1.1.4</ngwebdriver.version>
         <paho.version>1.2.0</paho.version>
@@ -89,7 +90,7 @@
         <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
         <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
         <maven-shade-plugin.version>3.1.0</maven-shade-plugin.version>
-        <maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
+        <maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
         <maven-site-plugin.version>3.5.1</maven-site-plugin.version>
         <maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
         <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
@@ -840,7 +841,7 @@
                     <dependency>
                         <groupId>org.junit.platform</groupId>
                         <artifactId>junit-platform-surefire-provider</artifactId>
-                        <version>${junit.platform.runner.version}</version>
+                        <version>${junit.platform.surefire.provider.version}</version>
                     </dependency>
                 </dependencies>
             </plugin>
diff --git a/templates/iot/tenant-service-s2i/020-BuildConfig-tenant-service.yaml b/templates/iot/tenant-service-s2i/020-BuildConfig-tenant-service.yaml
index 71d412b79..beca8fd6c 100644
--- a/templates/iot/tenant-service-s2i/020-BuildConfig-tenant-service.yaml
+++ b/templates/iot/tenant-service-s2i/020-BuildConfig-tenant-service.yaml
@@ -22,9 +22,9 @@ spec:
         name: fabric8-s2i-java-custom:java8
       env:
       - name: MAVEN_ARGS_APPEND
-        value: -pl io.enmasse:tenant-service --also-make
+        value: -pl io.enmasse:iot-tenant-service --also-make
       - name: ARTIFACT_DIR
-        value: iot/tenant-service/target
+        value: iot/iot-tenant-service/target
   output:
     to:
       kind: ImageStreamTag


Test patch:
diff --git a/keycloak-user-api/src/test/java/io/enmasse/user/keycloak/KeycloakUserApiTest.java b/keycloak-user-api/src/test/java/io/enmasse/user/keycloak/KeycloakUserApiTest.java
index c32ee035d..9f6970462 100644
--- a/keycloak-user-api/src/test/java/io/enmasse/user/keycloak/KeycloakUserApiTest.java
+++ b/keycloak-user-api/src/test/java/io/enmasse/user/keycloak/KeycloakUserApiTest.java
@@ -264,7 +264,7 @@ public class KeycloakUserApiTest {
 
         final Set<String> result = KeycloakUserApi.createDesiredGroupsSet(auth);
 
-        assertGroups(result, "manage", "manage_#");
+        assertGroups(result, "manage");
     }
 
     @Test
@@ -280,7 +280,7 @@ public class KeycloakUserApiTest {
 
         assertGroups(result,
                 "recv_foo%2Fbar", "send_foo%2Fbar", "recv_bar%2Fbaz%2F%23", "send_bar%2Fbaz%2F%23",
-                "monitor", "monitor_#", "manage", "manage_#");
+                "monitor", "manage");
     }
 
     @Test
@@ -303,7 +303,7 @@ public class KeycloakUserApiTest {
 
         final Set<String> result = KeycloakUserApi.createDesiredGroupsSet(auth);
 
-        assertGroups(result, "manage", "manage_#");
+        assertGroups(result, "manage");
     }
 
     /**
diff --git a/systemtests/pom.xml b/systemtests/pom.xml
index de9f6e7f4..e4592689f 100644
--- a/systemtests/pom.xml
+++ b/systemtests/pom.xml
@@ -128,7 +128,7 @@
                     <dependency>
                         <groupId>org.junit.platform</groupId>
                         <artifactId>junit-platform-surefire-provider</artifactId>
-                        <version>${junit.platform.runner.version}</version>
+                        <version>${junit.platform.surefire.provider.version}</version>
                     </dependency>
                 </dependencies>
             </plugin>
diff --git a/systemtests/scripts/test_func.sh b/systemtests/scripts/test_func.sh
index 94ea6b43d..471fd79a9 100755
--- a/systemtests/scripts/test_func.sh
+++ b/systemtests/scripts/test_func.sh
@@ -42,7 +42,9 @@ function export_required_env {
     SANITIZED_NAMESPACE=${SANITIZED_NAMESPACE//\//-}
     KUBERNETES_NAMESPACE=${SANITIZED_NAMESPACE}
 
-    API_URL=$(oc config view -o jsonpath='{.clusters[0].cluster.server}')
+    if oc whoami --show-server=true > /dev/null 2>&1; then
+        API_URL=$(oc whoami --show-server=true)
+    fi
     export KUBERNETES_API_URL=${KUBERNETES_API_URL:-${API_URL}}
     export OPENSHIFT_USER=${OPENSHIFT_USER:-test}
     export OPENSHIFT_PASSWD=${OPENSHIFT_PASSWD:-test}
diff --git a/systemtests/src/main/java/io/enmasse/systemtest/Environment.java b/systemtests/src/main/java/io/enmasse/systemtest/Environment.java
index a8979cfde..076170fd2 100644
--- a/systemtests/src/main/java/io/enmasse/systemtest/Environment.java
+++ b/systemtests/src/main/java/io/enmasse/systemtest/Environment.java
@@ -21,6 +21,7 @@ public class Environment {
     public static final String tokenEnv = "KUBERNETES_API_TOKEN";
     public static final String upgradeEnv = "SYSTEMTESTS_UPGRADED";
     public static final String enmasseVersionProp = "enmasse.version";
+    public static final String domain = "KUBERNETES_DOMAIN";
 
     private final String token = System.getenv(tokenEnv);
     private final String url = System.getenv(urlEnv);
@@ -32,6 +33,7 @@ public class Environment {
     private final boolean upgrade = Boolean.parseBoolean(System.getenv().getOrDefault(upgradeEnv, "false"));
     private final String ocpVersion = System.getenv().getOrDefault(ocpVersionEnv, "3.11");
     private final String enmasseVersion = System.getProperty("enmasse.version");
+    private final String kubernetesDomain = System.getenv().getOrDefault(domain, ".nip.io");
 
     private Environment() {
         String debugFormat = "{}:{}";
@@ -120,4 +122,8 @@ public class Environment {
     public String enmasseVersion() {
         return enmasseVersion;
     }
+
+    public String kubernetesDomain() {
+        return kubernetesDomain;
+    }
 }
diff --git a/systemtests/src/main/java/io/enmasse/systemtest/SystemtestsKubernetesApps.java b/systemtests/src/main/java/io/enmasse/systemtest/SystemtestsKubernetesApps.java
index e256b01ae..9d7050619 100644
--- a/systemtests/src/main/java/io/enmasse/systemtest/SystemtestsKubernetesApps.java
+++ b/systemtests/src/main/java/io/enmasse/systemtest/SystemtestsKubernetesApps.java
@@ -197,6 +197,7 @@ public class SystemtestsKubernetesApps {
     }
 
     private static Ingress getSystemtestsIngressResource(String appName, int port) throws Exception {
+        Environment env = Environment.getInstance();
         IngressBackend backend = new IngressBackend();
         backend.setServiceName(appName);
         backend.setServicePort(new IntOrString(port));
@@ -211,7 +212,7 @@ public class SystemtestsKubernetesApps {
                 .endMetadata()
                 .withNewSpec()
                 .withRules(new IngressRuleBuilder()
-                        .withHost(appName + "." + new URL(Environment.getInstance().getApiUrl()).getHost() + ".nip.io")
+                        .withHost(appName + "." +  (env.kubernetesDomain().equals(".nip.io") ?  new URL(Environment.getInstance().getApiUrl()).getHost() + ".nip.io" : env.kubernetesDomain()))
                         .withNewHttp()
                         .withPaths(path)
                         .endHttp()