forked from Mirrors/minio
fs: Re-implement object layer to remember the fd (#3509)
This patch re-writes FS backend to support shared backend sharing locks for safe concurrent access across multiple servers.
This commit is contained in:
@@ -126,48 +126,6 @@ func TestMaxObjectSize(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test urlPathSplit.
|
||||
func TestURLPathSplit(t *testing.T) {
|
||||
type test struct {
|
||||
urlPath string
|
||||
bucketName string
|
||||
prefixName string
|
||||
}
|
||||
|
||||
testCases := []test{
|
||||
{
|
||||
urlPath: "/b/c/",
|
||||
bucketName: "b",
|
||||
prefixName: "c/",
|
||||
},
|
||||
{
|
||||
urlPath: "c/aa",
|
||||
bucketName: "c",
|
||||
prefixName: "aa",
|
||||
},
|
||||
{
|
||||
urlPath: "",
|
||||
bucketName: "",
|
||||
prefixName: "",
|
||||
},
|
||||
{
|
||||
urlPath: "/b",
|
||||
bucketName: "b",
|
||||
prefixName: "",
|
||||
},
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
bucketName, prefixName := urlPathSplit(testCase.urlPath)
|
||||
if bucketName != testCase.bucketName {
|
||||
t.Errorf("Tets %d: Expected %s, %s", i+1, testCase.bucketName, bucketName)
|
||||
}
|
||||
if prefixName != testCase.prefixName {
|
||||
t.Errorf("Tets %d: Expected %s, %s", i+1, testCase.bucketName, bucketName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tests minimum allowed part size.
|
||||
func TestMinAllowedPartSize(t *testing.T) {
|
||||
sizes := []struct {
|
||||
|
||||
Reference in New Issue
Block a user