tests: add v1.1-reverse example filesystem
This commit is contained in:
parent
3c2c3453ad
commit
eb51a1ed20
@ -152,8 +152,35 @@ func TestExampleFSv11(t *testing.T) {
|
||||
test_helpers.UnmountPanic(pDir)
|
||||
pDir = pDir + ".2"
|
||||
test_helpers.MountOrFatal(t, cDir, pDir, "-masterkey",
|
||||
"be505f7d-54871394-2c0c2481-1bdcd0d8-9113b08a-0f7b4dfc-851c96da-55ef36b5",
|
||||
"eaf371c3-f9a55336-8819f22b-7bccd7c2-a738cf61-7261c658-14c28a03-9428992b",
|
||||
"-aessiv", opensslOpt)
|
||||
checkExampleFSLongnames(t, pDir)
|
||||
test_helpers.UnmountPanic(pDir)
|
||||
}
|
||||
|
||||
// gocryptfs v1.1 introduced reverse mode
|
||||
func TestExampleFSv11reverse(t *testing.T) {
|
||||
dirA := "v1.1-reverse"
|
||||
dirB := test_helpers.TmpDir + "/" + dirA + ".B"
|
||||
err := os.Mkdir(dirB, 0700)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
dirC := test_helpers.TmpDir + "/" + dirA + ".C"
|
||||
err = os.Mkdir(dirC, 0700)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-extpass", "echo test", opensslOpt)
|
||||
test_helpers.MountOrFatal(t, dirB, dirC, "-extpass", "echo test", opensslOpt)
|
||||
checkExampleFSrw(t, dirC, false)
|
||||
test_helpers.UnmountPanic(dirC)
|
||||
test_helpers.UnmountPanic(dirB)
|
||||
|
||||
m := "68b51855-042abd80-635ae1ba-90152a78-2ec2d243-832ac72a-eab0561a-f2d37913"
|
||||
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-masterkey", m, opensslOpt)
|
||||
test_helpers.MountOrFatal(t, dirB, dirC, "-aessiv", "-masterkey", m, opensslOpt)
|
||||
checkExampleFSrw(t, dirC, false)
|
||||
test_helpers.UnmountPanic(dirC)
|
||||
test_helpers.UnmountPanic(dirB)
|
||||
}
|
||||
|
@ -48,10 +48,17 @@ func checkExampleFS(t *testing.T, dir string, rw bool) {
|
||||
}
|
||||
|
||||
// checkExampleFSLongnames - verify that "dir" contains the expected test files
|
||||
// plus the long file name test file
|
||||
// plus the long file name test file.
|
||||
// Also tests simple directory operations.
|
||||
func checkExampleFSLongnames(t *testing.T, dir string) {
|
||||
checkExampleFSrw(t, dir, true)
|
||||
}
|
||||
|
||||
// checkExampleFSrw is like checkExampleFSLongnames but gives the caller the
|
||||
// choice if he wants to run tests that write to the FS.
|
||||
func checkExampleFSrw(t *testing.T, dir string, rw bool) {
|
||||
// regular tests
|
||||
checkExampleFS(t, dir, true)
|
||||
checkExampleFS(t, dir, rw)
|
||||
// long name test file
|
||||
longname := "longname_255_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
|
||||
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +
|
||||
@ -65,5 +72,4 @@ func checkExampleFSLongnames(t *testing.T, dir string) {
|
||||
if content != statusTxtContent {
|
||||
t.Errorf("longname_255: unexpected content: %s\n", content)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"Creator": "gocryptfs v1.1-beta1-33-gf054353-dirty",
|
||||
"EncryptedKey": "GD7CQzhKMs4r8B/jc7eNNAffyMn4Z2A0tH9EC50y6v5y6amJdU6NQK5xLPWpWSc45si5L26VOVhT8dhz",
|
||||
"ScryptObject": {
|
||||
"Salt": "G/Cpk6TnscJzx1fae9t8guejwoPk1lsGkkcljIMjJdw=",
|
||||
"N": 1024,
|
||||
"R": 8,
|
||||
"P": 1,
|
||||
"KeyLen": 32
|
||||
},
|
||||
"Version": 2,
|
||||
"FeatureFlags": [
|
||||
"GCMIV128",
|
||||
"DirIV",
|
||||
"EMENames",
|
||||
"LongNames",
|
||||
"AESSIV"
|
||||
]
|
||||
}
|
1
tests/example_filesystems/v1.1-reverse/abs
Symbolic link
1
tests/example_filesystems/v1.1-reverse/abs
Symbolic link
@ -0,0 +1 @@
|
||||
/a/b/c/d
|
@ -0,0 +1 @@
|
||||
It works!
|
1
tests/example_filesystems/v1.1-reverse/rel
Symbolic link
1
tests/example_filesystems/v1.1-reverse/rel
Symbolic link
@ -0,0 +1 @@
|
||||
status.txt
|
1
tests/example_filesystems/v1.1-reverse/status.txt
Normal file
1
tests/example_filesystems/v1.1-reverse/status.txt
Normal file
@ -0,0 +1 @@
|
||||
It works!
|
Loading…
Reference in New Issue
Block a user