This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 03222105819 HDDS-15621. TestSecureOzoneCluster fails locally (#10550)
03222105819 is described below

commit 03222105819cab167543f857c84c8e884e406059
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Sat Jun 20 10:56:38 2026 +0200

    HDDS-15621. TestSecureOzoneCluster fails locally (#10550)
---
 .../apache/hadoop/ozone/TestSecureOzoneCluster.java   | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java
index 3379167c1ca..386ba7c8240 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java
@@ -63,7 +63,6 @@
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.any;
 import static org.mockito.Mockito.anyString;
 import static org.mockito.Mockito.mock;
@@ -541,9 +540,9 @@ void 
testSecureOMDelegationTokenSecretManagerInitializationFailure() throws Exce
       conf.setTimeDuration(OMConfigKeys.DELEGATION_TOKEN_MAX_LIFETIME_KEY, 7, 
TimeUnit.DAYS);
       IllegalArgumentException exception = assertThrows(
           IllegalArgumentException.class, () -> setupOm(conf));
-      assertTrue(exception.getMessage().contains("Secret key expiry duration 
hdds.secret.key.expiry.duration "  +
+      assertThat(exception.getMessage()).contains("Secret key expiry duration 
hdds.secret.key.expiry.duration "  +
           "should be greater than value of 
(ozone.manager.delegation.token.max-lifetime + " +
-          "ozone.manager.delegation.remover.scan.interval + 
hdds.secret.key.rotate.duration"));
+          "ozone.manager.delegation.remover.scan.interval + 
hdds.secret.key.rotate.duration");
     } finally {
       if (scm != null) {
         scm.stop();
@@ -1352,22 +1351,16 @@ void validateCertificate(X509Certificate cert) throws 
Exception {
     if (m.matches()) {
       cn = m.group(1);
     }
-    String hostName = InetAddress.getLocalHost().getHostName();
-
     // Subject name should be om login user in real world but in this test
     // UGI has scm user context.
-    assertThat(cn).contains(SCM_SUB_CA);
-    assertThat(cn).contains(hostName);
+    assertThat(cn).isEqualTo(SCM_SUB_CA + "@localhost");
 
     LocalDate today = ZonedDateTime.now().toLocalDate();
-    Date invalidDate;
 
     // Make sure the end date is honored.
-    invalidDate = java.sql.Date.valueOf(today.plus(1, ChronoUnit.DAYS));
-    assertTrue(cert.getNotAfter().after(invalidDate));
-
-    invalidDate = java.sql.Date.valueOf(today.plus(400, ChronoUnit.DAYS));
-    assertTrue(cert.getNotAfter().before(invalidDate));
+    assertThat(cert.getNotAfter())
+        .isAfter(java.sql.Date.valueOf(today.plus(1, ChronoUnit.DAYS)))
+        .isBefore(java.sql.Date.valueOf(today.plus(400, ChronoUnit.DAYS)));
 
     assertThat(cert.getSubjectDN().toString()).contains(scmId);
     assertThat(cert.getSubjectDN().toString()).contains(clusterId);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to