Skip to content

Commit

Permalink
GoogleContainerTools#3158 - [Jib core] Tar archives with same content…
Browse files Browse the repository at this point in the history
…s are not reproducible
  • Loading branch information
davidtron committed Apr 9, 2021
1 parent 75d321a commit 9c1141b
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,18 @@ private void verifyTarArchive(TarArchiveInputStream tarArchiveInputStream) throw
// Verifies fileB was archived correctly.
TarArchiveEntry headerFileB = tarArchiveInputStream.getNextTarEntry();
Assert.assertEquals("crepecake", headerFileB.getName());
Assert.assertEquals(Instant.EPOCH, headerFileB.getModTime().toInstant());
byte[] fileBString = ByteStreams.toByteArray(tarArchiveInputStream);
Assert.assertArrayEquals(fileBContents, fileBString);

// Verifies directoryA was archived correctly.
TarArchiveEntry headerDirectoryA = tarArchiveInputStream.getNextTarEntry();
Assert.assertEquals("some/path/to/", headerDirectoryA.getName());
Assert.assertEquals(Instant.EPOCH, headerDirectoryA.getModTime().toInstant());

// Verifies the long file was archived correctly.
TarArchiveEntry headerFileALong = tarArchiveInputStream.getNextTarEntry();
Assert.assertEquals(
"some/really/long/path/that/exceeds/100/characters/abcdefghijklmnopqrstuvwxyz0123456789012345678901234567890",
headerFileALong.getName());
Assert.assertEquals(Instant.EPOCH, headerFileALong);
byte[] fileALongString = ByteStreams.toByteArray(tarArchiveInputStream);
Assert.assertArrayEquals(fileAContents, fileALongString);

Expand Down

0 comments on commit 9c1141b

Please sign in to comment.