-
Notifications
You must be signed in to change notification settings - Fork 587
HDDS-7922. [FSO] S3G folder support fso layout filestatus s3A compatibility #4448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
3a0d8c4
637b95f
20cb8f4
7b82e8f
84d7b23
e04d3a3
7f09e13
03ee03f
e92dd34
6f467ba
00306f7
9afb488
a495d0d
bbb746c
e001dcf
821c591
0ceb8f0
204a4d9
8232ed8
95b4c72
286eb92
9366bd2
9e218fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,9 +41,12 @@ | |
| import org.junit.Assert; | ||
| import org.junit.Before; | ||
| import org.junit.Test; | ||
| import org.junit.jupiter.api.Assertions; | ||
| import org.mockito.Mockito; | ||
|
|
||
| import static java.nio.charset.StandardCharsets.UTF_8; | ||
| import static org.apache.hadoop.ozone.s3.S3GatewayConfigKeys.OZONE_S3G_FSO_DIRECTORY_CREATION_ENABLED; | ||
| import static org.apache.hadoop.ozone.s3.exception.S3ErrorTable.NO_SUCH_KEY; | ||
| import static org.apache.hadoop.ozone.s3.util.S3Consts.RANGE_HEADER; | ||
| import static org.mockito.Mockito.doReturn; | ||
|
|
||
|
|
@@ -224,4 +227,26 @@ private void setDefaultHeader() { | |
| doReturn(CONTENT_ENCODING1) | ||
| .when(headers).getHeaderString("Content-Encoding"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testGetWhenKeyIsDirectoryAndDoesNotEndWithASlash() | ||
| throws IOException { | ||
| // GIVEN | ||
| final String bucketName = "b1"; | ||
| final String keyPath = "keyDir"; | ||
| OzoneConfiguration config = new OzoneConfiguration(); | ||
| config.set(OZONE_S3G_FSO_DIRECTORY_CREATION_ENABLED, "true"); | ||
| rest.setOzoneConfiguration(config); | ||
| OzoneBucket bucket = client.getObjectStore().getS3Bucket(bucketName); | ||
| bucket.createDirectory(keyPath); | ||
|
|
||
| // WHEN | ||
| final OS3Exception ex = | ||
| Assertions.assertThrows(OS3Exception.class, | ||
| () -> rest.get(bucketName, keyPath, null, 0, null, body)); | ||
|
||
|
|
||
| // THEN | ||
| Assertions.assertEquals(NO_SUCH_KEY.getCode(), ex.getCode()); | ||
| bucket.deleteKey(keyPath); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.