tests: check Mkdir and Rmdir
This commit is contained in:
parent
4d466c3412
commit
b5bf59a31d
@ -3,6 +3,7 @@ package integration_tests
|
|||||||
// File reading, writing, modification, truncate
|
// File reading, writing, modification, truncate
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"syscall"
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
@ -192,6 +193,7 @@ func TestFileHoles(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// sContains - does the slice of strings "haystack" contain "needle"?
|
||||||
func sContains(haystack []string, needle string) bool {
|
func sContains(haystack []string, needle string) bool {
|
||||||
for _, element := range haystack {
|
for _, element := range haystack {
|
||||||
if element == needle {
|
if element == needle {
|
||||||
@ -307,3 +309,16 @@ func TestFilenameEncryption(t *testing.T) {
|
|||||||
t.Errorf("file name encryption not working")
|
t.Errorf("file name encryption not working")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test Mkdir and Rmdir
|
||||||
|
func TestMkdirRmdir(t *testing.T) {
|
||||||
|
dir := defaultPlainDir + "dir1"
|
||||||
|
err := os.Mkdir(dir, 0777)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
err = syscall.Rmdir(dir)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user