Skip to content
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

Added tests to ensure support for 4TB file #15179

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public final class Constants {
*/
public static final int GB = 1024 * MB;

/**
* Represents a non-SI terabyte.
*/
public static final long TB = 1024L * GB;

/**
* Represents the value for {@link SasProtocol#HTTPS_ONLY}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ class FileAPITests extends APISpec {
FileTestHelper.assertResponseStatusCode(primaryFileClient.createWithResponse(1024, null, null, null, null, null, null), 201)
}

def "Create file 4TB"() {
expect:
FileTestHelper.assertResponseStatusCode(primaryFileClient.createWithResponse(4 * Constants.TB, null, null, null, null, null, null), 201)
}

def "Create file error"() {
when:
primaryFileClient.create(-1)
Expand Down Expand Up @@ -232,6 +237,22 @@ class FileAPITests extends APISpec {
data == stream.toByteArray()
}

def "Upload Range 4TB"() {
given:
def fileSize = 4 * Constants.TB
primaryFileClient.create(fileSize)

when:
def uploadResponse = primaryFileClient.uploadWithResponse(defaultData, dataLength, fileSize - dataLength, null, null) /* Upload to end of file. */
def stream = new ByteArrayOutputStream()
def downloadResponse = primaryFileClient.downloadWithResponse(stream, new ShareFileRange(fileSize - dataLength, fileSize), true, null, null)

then:
FileTestHelper.assertResponseStatusCode(uploadResponse, 201)
FileTestHelper.assertResponseStatusCode(downloadResponse, 206)
downloadResponse.getDeserializedHeaders().getContentLength() == dataLength
}

def "Upload data error"() {
when:
primaryFileClient.uploadWithResponse(defaultData, dataLength, 1, null, null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
"Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestscreatefile4tbfileapitestscreatefile4tb8ef880214?restype=share",
"Headers" : {
"x-ms-version" : "2020-02-10",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "45af89da-d55a-4ee7-8ffb-60b273275b92"
},
"Response" : {
"Transfer-Encoding" : "chunked",
"x-ms-version" : "2020-02-10",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"ETag" : "0x8D858DC918ECF1E",
"Last-Modified" : "Mon, 14 Sep 2020 18:32:43 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-id" : "1f6c0e57-601a-0017-1bc5-8a212a000000",
"Date" : "Mon, 14 Sep 2020 18:32:42 GMT",
"x-ms-client-request-id" : "45af89da-d55a-4ee7-8ffb-60b273275b92"
},
"Exception" : null
}, {
"Method" : "PUT",
"Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestscreatefile4tbfileapitestscreatefile4tb8ef880214/fileapitestscreatefile4tbfileapitestscreatefile4tb8ef93470e",
"Headers" : {
"x-ms-version" : "2020-02-10",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "73fb118e-6e43-4a3e-930f-bdbfff311c3b"
},
"Response" : {
"Transfer-Encoding" : "chunked",
"x-ms-version" : "2020-02-10",
"x-ms-file-permission-key" : "990002565778260641*11897905858180131375",
"x-ms-file-id" : "13835128424026341376",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-file-creation-time" : "2020-09-14T18:32:43.5174284Z",
"Last-Modified" : "Mon, 14 Sep 2020 18:32:43 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-server-encrypted" : "true",
"Date" : "Mon, 14 Sep 2020 18:32:43 GMT",
"ETag" : "0x8D858DC91CE0B8C",
"x-ms-file-attributes" : "Archive",
"x-ms-file-change-time" : "2020-09-14T18:32:43.5174284Z",
"x-ms-file-parent-id" : "0",
"x-ms-request-id" : "1f6c0e5a-601a-0017-1cc5-8a212a000000",
"x-ms-client-request-id" : "73fb118e-6e43-4a3e-930f-bdbfff311c3b",
"x-ms-file-last-write-time" : "2020-09-14T18:32:43.5174284Z"
},
"Exception" : null
} ],
"variables" : [ "fileapitestscreatefile4tbfileapitestscreatefile4tb8ef880214", "fileapitestscreatefile4tbfileapitestscreatefile4tb8ef93470e" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
"Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestsuploadrange4tb9529559b05297714949?restype=share",
"Headers" : {
"x-ms-version" : "2020-02-10",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "13e55648-3d16-49c4-be56-aa2eaff4e68a"
},
"Response" : {
"Transfer-Encoding" : "chunked",
"x-ms-version" : "2020-02-10",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"ETag" : "0x8D858DD55108D7D",
"Last-Modified" : "Mon, 14 Sep 2020 18:38:11 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-id" : "4b5aa092-b01a-0015-49c6-8a23d0000000",
"Date" : "Mon, 14 Sep 2020 18:38:10 GMT",
"x-ms-client-request-id" : "13e55648-3d16-49c4-be56-aa2eaff4e68a"
},
"Exception" : null
}, {
"Method" : "PUT",
"Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestsuploadrange4tb9529559b05297714949/fileapitestsuploadrange4tb85410db85466852044a",
"Headers" : {
"x-ms-version" : "2020-02-10",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "c1c89a96-0170-449c-877e-074c273bbb53"
},
"Response" : {
"Transfer-Encoding" : "chunked",
"x-ms-version" : "2020-02-10",
"x-ms-file-permission-key" : "990002565778260641*11897905858180131375",
"x-ms-file-id" : "13835128424026341376",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-file-creation-time" : "2020-09-14T18:38:11.4234414Z",
"Last-Modified" : "Mon, 14 Sep 2020 18:38:11 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-server-encrypted" : "true",
"Date" : "Mon, 14 Sep 2020 18:38:10 GMT",
"ETag" : "0x8D858DD5540882E",
"x-ms-file-attributes" : "Archive",
"x-ms-file-change-time" : "2020-09-14T18:38:11.4234414Z",
"x-ms-file-parent-id" : "0",
"x-ms-request-id" : "4b5aa098-b01a-0015-4dc6-8a23d0000000",
"x-ms-client-request-id" : "c1c89a96-0170-449c-877e-074c273bbb53",
"x-ms-file-last-write-time" : "2020-09-14T18:38:11.4234414Z"
},
"Exception" : null
}, {
"Method" : "PUT",
"Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestsuploadrange4tb9529559b05297714949/fileapitestsuploadrange4tb85410db85466852044a?comp=range",
"Headers" : {
"x-ms-version" : "2020-02-10",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "8f24b96c-16de-499e-841a-9a5f86bd5f9d",
"Content-Type" : "application/octet-stream"
},
"Response" : {
"Transfer-Encoding" : "chunked",
"x-ms-version" : "2020-02-10",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"ETag" : "0x8D858DD5563CE07",
"Last-Modified" : "Mon, 14 Sep 2020 18:38:11 GMT",
"retry-after" : "0",
"StatusCode" : "201",
"x-ms-request-id" : "4b5aa09a-b01a-0015-4ec6-8a23d0000000",
"x-ms-request-server-encrypted" : "true",
"Date" : "Mon, 14 Sep 2020 18:38:10 GMT",
"x-ms-client-request-id" : "8f24b96c-16de-499e-841a-9a5f86bd5f9d",
"Content-MD5" : "wh+Wm18D0z1D4E+PE252gg=="
},
"Exception" : null
}, {
"Method" : "GET",
"Uri" : "https://REDACTED.file.preprod.core.windows.net/fileapitestsuploadrange4tb9529559b05297714949/fileapitestsuploadrange4tb85410db85466852044a",
"Headers" : {
"x-ms-version" : "2020-02-10",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.7.0-beta.1 (11.0.7; Windows 10; 10.0)",
"x-ms-client-request-id" : "0b6b619c-88b7-4d8a-8f47-648a628cb361"
},
"Response" : {
"x-ms-lease-status" : "unlocked",
"x-ms-file-id" : "13835128424026341376",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"x-ms-file-creation-time" : "2020-09-14T18:38:11.4234414Z",
"Access-Control-Allow-Origin" : "*",
"Content-Range" : "bytes 4398046511097-4398046511103/4398046511104",
"x-ms-lease-state" : "available",
"Last-Modified" : "Mon, 14 Sep 2020 18:38:11 GMT",
"retry-after" : "0",
"StatusCode" : "206",
"Access-Control-Expose-Headers" : "x-ms-request-id,x-ms-client-request-id,Server,x-ms-version,Content-Type,Last-Modified,ETag,x-ms-type,x-ms-server-encrypted,x-ms-lease-status,x-ms-lease-state,x-ms-file-change-time,x-ms-file-last-write-time,x-ms-file-creation-time,x-ms-file-permission-key,x-ms-file-attributes,x-ms-file-id,x-ms-file-parent-id,Content-Range,Accept-Ranges",
"x-ms-file-attributes" : "Archive",
"Content-Length" : "7",
"x-ms-request-id" : "4b5aa09b-b01a-0015-4fc6-8a23d0000000",
"Body" : "ZGVmYXVsdA==",
"Content-Type" : "application/octet-stream",
"x-ms-version" : "2020-02-10",
"x-ms-file-permission-key" : "990002565778260641*11897905858180131375",
"Date" : "Mon, 14 Sep 2020 18:38:10 GMT",
"Content-MD5" : "wh+Wm18D0z1D4E+PE252gg==",
"Accept-Ranges" : "bytes",
"x-ms-server-encrypted" : "true",
"x-ms-type" : "File",
"ETag" : "0x8D858DD5563CE07",
"x-ms-file-change-time" : "2020-09-14T18:38:11.4234414Z",
"x-ms-file-parent-id" : "0",
"x-ms-client-request-id" : "0b6b619c-88b7-4d8a-8f47-648a628cb361",
"x-ms-file-last-write-time" : "2020-09-14T18:38:11.4234414Z"
},
"Exception" : null
} ],
"variables" : [ "fileapitestsuploadrange4tb9529559b05297714949", "fileapitestsuploadrange4tb85410db85466852044a" ]
}