Skip to content

Commit

Permalink
Merge branch 'develop' into release/2.1.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
infeo committed Sep 6, 2021
2 parents 1f0c078 + fb4d99d commit e38994e
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<maven.compiler.release>16</maven.compiler.release>

<!-- dependencies -->
<cryptolib.version>2.0.1</cryptolib.version>
<cryptolib.version>2.0.2</cryptolib.version>
<jwt.version>3.18.1</jwt.version>
<dagger.version>2.37</dagger.version>
<guava.version>30.1.1-jre</guava.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,7 @@ public void persist() {
private void persistInternal() throws IOException {
Path longNameFile = c9sPath.resolve(INFLATED_FILE_NAME);
Files.createDirectories(c9sPath);
try (WritableByteChannel ch = Files.newByteChannel(longNameFile, StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW)) {
ch.write(UTF_8.encode(longName));
} catch (FileAlreadyExistsException e) {
// no-op: if the file already exists, we assume its content to be what we want (or we found a SHA1 collision ;-))
assert Arrays.equals(Files.readAllBytes(longNameFile), longName.getBytes(UTF_8));
}
Files.write(longNameFile,UTF_8.encode(longName).array()); //WRITE, CREATE, TRUNCATE_EXISTING
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,38 @@ public void testRemoveOtherSymlink() throws IOException {

@Test
@Order(9)
@DisplayName("ln -s foo '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet'")
public void testCreateSymlinkWithLongName() throws IOException {
Path target = fs1.getPath("/foo");
Assumptions.assumeTrue(Files.isRegularFile(target));
Path longNameLink = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Files.createSymbolicLink(longNameLink, target);
MatcherAssert.assertThat(MoreFiles.listFiles(fs1.getPath("/")), Matchers.hasItem(longNameLink));
Assertions.assertTrue(Files.exists(longNameLink));
}

@Test
@Order(10)
@DisplayName("mv '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet' '/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat")
public void testMoveSymlinkWithLongNameToAnotherLongName() throws IOException {
Path longNameSource = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Assumptions.assumeTrue(Files.isSymbolicLink(longNameSource));
Path longNameTarget = longNameSource.resolveSibling("/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat");
Files.move(longNameSource, longNameTarget);
Assertions.assertTrue(Files.exists(longNameTarget));
Assertions.assertTrue(Files.notExists(longNameSource));
}

@Test
@Order(11)
@DisplayName("rm -r '/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat'")
public void testRemoveSymlinkWithLongName() throws IOException {
Path longNamePath = fs1.getPath("/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat");
Files.delete(longNamePath);
Assertions.assertTrue(Files.notExists(longNamePath));
}
@Test
@Order(12)
@DisplayName("mkdir '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet'")
public void testCreateDirWithLongName() throws IOException {
Path longNamePath = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Expand All @@ -372,16 +404,27 @@ public void testCreateDirWithLongName() throws IOException {
}

@Test
@Order(10)
@DisplayName("rm -r '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet'")
@Order(13)
@DisplayName("mv '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet' '/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat")
public void testMoveDirWithLongNameToAnotherLongName() throws IOException {
Path longNameSource = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Path longNameTarget = longNameSource.resolveSibling("/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat");
Files.move(longNameSource, longNameTarget);
Assertions.assertTrue(Files.exists(longNameTarget));
Assertions.assertTrue(Files.notExists(longNameSource));
}

@Test
@Order(14)
@DisplayName("rm -r '/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat'")
public void testRemoveDirWithLongName() throws IOException {
Path longNamePath = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Path longNamePath = fs1.getPath("/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat");
Files.delete(longNamePath);
Assertions.assertTrue(Files.notExists(longNamePath));
}

@Test
@Order(11)
@Order(15)
@DisplayName("touch '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet'")
public void testCreateFileWithLongName() throws IOException {
Path longNamePath = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Expand All @@ -391,16 +434,27 @@ public void testCreateFileWithLongName() throws IOException {
}

@Test
@Order(12)
@DisplayName("rm '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet'")
@Order(16)
@DisplayName("mv '/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet' '/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat")
public void testMoveFileWithLongNameToAnotherLongName() throws IOException {
Path longNameSource = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Path longNameTarget = longNameSource.resolveSibling("/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat");
Files.move(longNameSource, longNameTarget);
Assertions.assertTrue(Files.exists(longNameTarget));
Assertions.assertTrue(Files.notExists(longNameSource));
}

@Test
@Order(17)
@DisplayName("rm -r '/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat'")
public void testRemoveFileWithLongName() throws IOException {
Path longNamePath = fs1.getPath("/Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet Telefon Energie Wasser Webseitengeraffel Bus Bahn Mietwagen Internet");
Path longNamePath = fs1.getPath("/Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat Talafan Anargaa Wassar Wabsaatangaraffal Bas Bahn Maatwagan Antarnat");
Files.delete(longNamePath);
Assertions.assertTrue(Files.notExists(longNamePath));
}

@Test
@Order(13)
@Order(18)
@DisplayName("cp fs1:/foo fs2:/bar")
public void testCopyFileAcrossFilesystem() throws IOException {
Path file1 = fs1.getPath("/foo");
Expand All @@ -414,7 +468,7 @@ public void testCopyFileAcrossFilesystem() throws IOException {
}

@Test
@Order(14)
@Order(19)
@DisplayName("echo 'goodbye world' > /foo")
public void testWriteToFile() throws IOException {
Path file1 = fs1.getPath("/foo");
Expand All @@ -423,7 +477,7 @@ public void testWriteToFile() throws IOException {
}

@Test
@Order(15)
@Order(20)
@DisplayName("cp -f fs1:/foo fs2:/bar")
public void testCopyFileAcrossFilesystemReplaceExisting() throws IOException {
Path file1 = fs1.getPath("/foo");
Expand All @@ -437,7 +491,7 @@ public void testCopyFileAcrossFilesystemReplaceExisting() throws IOException {
}

@Test
@Order(16)
@Order(21)
@DisplayName("readattr /attributes.txt")
public void testLazinessOfFileAttributeViews() throws IOException {
Path file = fs1.getPath("/attributes.txt");
Expand All @@ -462,7 +516,7 @@ public void testLazinessOfFileAttributeViews() throws IOException {
}

@Test
@Order(17)
@Order(22)
@DisplayName("ln -s /linked/targetY /links/linkX")
public void testSymbolicLinks() throws IOException {
Path linksDir = fs1.getPath("/links");
Expand Down Expand Up @@ -501,7 +555,7 @@ public void testSymbolicLinks() throws IOException {
}

@Test
@Order(18)
@Order(22)
@DisplayName("mv -f fs1:/foo fs2:/baz")
public void testMoveFileFromOneCryptoFileSystemToAnother() throws IOException {
Path file1 = fs1.getPath("/foo");
Expand Down

0 comments on commit e38994e

Please sign in to comment.