aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-05-12 13:50:11 -0700
committerChris Lu <chris.lu@gmail.com>2018-05-12 13:50:11 -0700
commit9ecbf92569911abc6d95bc86e133326845b6b005 (patch)
treef41825ef913ecaeb99de003c9e60d53d602ee840
parent81af1bafbaf556fa234e5e26d197e8ed44aa4026 (diff)
downloadseaweedfs-9ecbf92569911abc6d95bc86e133326845b6b005.tar.xz
seaweedfs-9ecbf92569911abc6d95bc86e133326845b6b005.zip
more tests
-rw-r--r--weed/filer2/memdb/memdb_store_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/weed/filer2/memdb/memdb_store_test.go b/weed/filer2/memdb/memdb_store_test.go
index 7e515d9f5..b2587f3e2 100644
--- a/weed/filer2/memdb/memdb_store_test.go
+++ b/weed/filer2/memdb/memdb_store_test.go
@@ -71,6 +71,7 @@ func TestCreateFileAndList(t *testing.T) {
filer.CreateEntry(entry1)
filer.CreateEntry(entry2)
+ // checking the 2 files
entries, err := filer.ListDirectoryEntries(filer2.FullPath("/home/chris/this/is/one/"))
if err != nil {
@@ -93,4 +94,28 @@ func TestCreateFileAndList(t *testing.T) {
return
}
+ // checking one upper directory
+ entries, _ = filer.ListDirectoryEntries(filer2.FullPath("/home/chris/this/is"))
+ if len(entries) != 1 {
+ t.Errorf("list entries count: %v", len(entries))
+ return
+ }
+
+ entry3 := &filer2.Entry{
+ FullPath: filer2.FullPath("/home/chris/this/is/file3.jpg"),
+ Attr: filer2.Attr{
+ Mode: 0440,
+ Uid: 1234,
+ Gid: 5678,
+ },
+ }
+ filer.CreateEntry(entry3)
+
+ // checking one upper directory
+ entries, _ = filer.ListDirectoryEntries(filer2.FullPath("/home/chris/this/is"))
+ if len(entries) != 2 {
+ t.Errorf("list entries count: %v", len(entries))
+ return
+ }
+
}