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 c2dcb24d08 HDDS-8587. Test that CertificateClient can store multiple 
rootCA certificates (#4852)
c2dcb24d08 is described below

commit c2dcb24d08f55834940357fe8175f47235c62c4e
Author: Galsza <[email protected]>
AuthorDate: Fri Jun 9 22:07:31 2023 +0200

    HDDS-8587. Test that CertificateClient can store multiple rootCA 
certificates (#4852)
---
 .../client/TestDefaultCertificateClient.java          | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git 
a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
 
b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
index e5a09530cf..5049d2d59e 100644
--- 
a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
+++ 
b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/TestDefaultCertificateClient.java
@@ -336,6 +336,25 @@ public class TestDefaultCertificateClient {
         .toString()));
   }
 
+  @Test
+  public void testStoreMultipleRootCACertificate() throws Exception {
+    KeyPair keyPair = keyGenerator.generateKey();
+    X509Certificate cert1 = generateX509Cert(keyPair);
+    X509Certificate cert2 = generateX509Cert(keyPair);
+    X509Certificate cert3 = generateX509Cert(keyPair);
+
+    dnCertClient.storeCertificate(getPEMEncodedString(cert1), CAType.ROOT);
+    dnCertClient.storeCertificate(getPEMEncodedString(cert2), CAType.ROOT);
+    dnCertClient.storeCertificate(getPEMEncodedString(cert3), CAType.ROOT);
+
+    assertEquals(cert1, dnCertClient.getCertificate(cert1.getSerialNumber()
+        .toString()));
+    assertEquals(cert2, dnCertClient.getCertificate(cert2.getSerialNumber()
+        .toString()));
+    assertEquals(cert3, dnCertClient.getCertificate(cert3.getSerialNumber()
+        .toString()));
+  }
+
   @Test
   public void testInitCertAndKeypairValidationFailures() throws Exception {
     GenericTestUtils.LogCapturer dnClientLog = GenericTestUtils.LogCapturer


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

Reply via email to