Skip to content

Commit

Permalink
Issue #8973 - Improving documentation in Tests
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
  • Loading branch information
joakime committed Dec 6, 2022
1 parent 9047d11 commit 4e33c16
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,11 @@ public void testReloadChangingLinkTargetOfSymbolicLink() throws Exception

start(sslContextFactory ->
{
// What we want is ..
// (link) ssl/keystore -> opt/keystore
// (link) opt/keystore -> opt/keystore.1
// (file) opt/keystore.1 (actual certificate)

FS.ensureEmpty(sslDir);
FS.ensureEmpty(optDir);
Files.copy(oldKeyStoreSrc, optKeystore1);
Expand Down Expand Up @@ -314,9 +319,9 @@ public void testDoublySymlinked() throws Exception
start(sslContextFactory ->
{
// What we want is ..
// ssl/keystore.p12 -> data/keystore.p12
// ssl/data/ -> 2022-11/
// ssl/2022-11/keystore.p12 (file)
// (link) keystore.p12 -> data/keystore.p12
// (link) data/ -> 2022-11/
// (file) 2022-11/keystore.p12 (actual certificate)

FS.ensureEmpty(sslDir);
FS.ensureEmpty(timestampNovDir);
Expand All @@ -340,9 +345,11 @@ public void testDoublySymlinked() throws Exception
X509Certificate cert1 = getCertificateFromServer();
assertThat(getExpiryYear(cert1), is(2015));

// Change the data/ symlink to 2022-12/ which points to a newer certificate
// Replace keystore link
Files.delete(dataDir);
Files.createSymbolicLink(dataDir, timestampDecDir.getFileName());
// (link) data/ -> 2022-12/
// now keystore.p12 points to data/keystore.p12 which points to 2022-12/keystore.p12
System.err.println("### Triggering scan");
keyStoreScanner.scan(5000);

Expand Down

0 comments on commit 4e33c16

Please sign in to comment.