Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Comment thread
chungen0126 marked this conversation as resolved.
Expand Down Expand Up @@ -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);
Expand Down
Loading