reverse: gocryptfs.conf was missing from the directory listings
Fix the test for that and add checks in example_filesystems_test.
This commit is contained in:
parent
8efef4b3d6
commit
d25fcc6a4b
@ -304,7 +304,7 @@ func (rfs *reverseFS) OpenDir(cipherPath string, context *fuse.Context) ([]fuse.
|
|||||||
for i := range entries {
|
for i := range entries {
|
||||||
var cName string
|
var cName string
|
||||||
// ".gocryptfs.reverse.conf" in the root directory is mapped to "gocryptfs.conf"
|
// ".gocryptfs.reverse.conf" in the root directory is mapped to "gocryptfs.conf"
|
||||||
if cipherPath == "" && rfs.isTranslatedConfig(entries[i].Name) {
|
if cipherPath == "" && entries[i].Name == configfile.ConfReverseName {
|
||||||
cName = configfile.ConfDefaultName
|
cName = configfile.ConfDefaultName
|
||||||
} else {
|
} else {
|
||||||
cName = rfs.nameTransform.EncryptName(entries[i].Name, dirIV)
|
cName = rfs.nameTransform.EncryptName(entries[i].Name, dirIV)
|
||||||
|
@ -172,6 +172,10 @@ func TestExampleFSv11reverse(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-extpass", "echo test", opensslOpt)
|
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-extpass", "echo test", opensslOpt)
|
||||||
|
c := dirB + "/gocryptfs.conf"
|
||||||
|
if !test_helpers.VerifyExistence(c) {
|
||||||
|
t.Errorf("%s missing", c)
|
||||||
|
}
|
||||||
test_helpers.MountOrFatal(t, dirB, dirC, "-extpass", "echo test", opensslOpt)
|
test_helpers.MountOrFatal(t, dirB, dirC, "-extpass", "echo test", opensslOpt)
|
||||||
checkExampleFSrw(t, dirC, false)
|
checkExampleFSrw(t, dirC, false)
|
||||||
test_helpers.UnmountPanic(dirC)
|
test_helpers.UnmountPanic(dirC)
|
||||||
@ -179,6 +183,9 @@ func TestExampleFSv11reverse(t *testing.T) {
|
|||||||
|
|
||||||
m := "68b51855-042abd80-635ae1ba-90152a78-2ec2d243-832ac72a-eab0561a-f2d37913"
|
m := "68b51855-042abd80-635ae1ba-90152a78-2ec2d243-832ac72a-eab0561a-f2d37913"
|
||||||
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-masterkey", m, opensslOpt)
|
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-masterkey", m, opensslOpt)
|
||||||
|
if !test_helpers.VerifyExistence(c) {
|
||||||
|
t.Errorf("%s missing", c)
|
||||||
|
}
|
||||||
test_helpers.MountOrFatal(t, dirB, dirC, "-aessiv", "-masterkey", m, opensslOpt)
|
test_helpers.MountOrFatal(t, dirB, dirC, "-aessiv", "-masterkey", m, opensslOpt)
|
||||||
checkExampleFSrw(t, dirC, false)
|
checkExampleFSrw(t, dirC, false)
|
||||||
test_helpers.UnmountPanic(dirC)
|
test_helpers.UnmountPanic(dirC)
|
||||||
@ -199,6 +206,10 @@ func TestExampleFSv11reversePlaintextnames(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-extpass", "echo test", opensslOpt)
|
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-extpass", "echo test", opensslOpt)
|
||||||
|
c := dirB + "/gocryptfs.conf"
|
||||||
|
if !test_helpers.VerifyExistence(c) {
|
||||||
|
t.Errorf("%s missing", c)
|
||||||
|
}
|
||||||
test_helpers.MountOrFatal(t, dirB, dirC, "-extpass", "echo test", opensslOpt)
|
test_helpers.MountOrFatal(t, dirB, dirC, "-extpass", "echo test", opensslOpt)
|
||||||
checkExampleFSrw(t, dirC, false)
|
checkExampleFSrw(t, dirC, false)
|
||||||
test_helpers.UnmountPanic(dirC)
|
test_helpers.UnmountPanic(dirC)
|
||||||
@ -206,6 +217,9 @@ func TestExampleFSv11reversePlaintextnames(t *testing.T) {
|
|||||||
|
|
||||||
m := "e7fb8f0d-2a81df9e-26611e4b-5540b218-e48aa458-c2a623af-d0c82637-1466b5f2"
|
m := "e7fb8f0d-2a81df9e-26611e4b-5540b218-e48aa458-c2a623af-d0c82637-1466b5f2"
|
||||||
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-masterkey", m, opensslOpt)
|
test_helpers.MountOrFatal(t, dirA, dirB, "-reverse", "-masterkey", m, opensslOpt)
|
||||||
|
if !test_helpers.VerifyExistence(c) {
|
||||||
|
t.Errorf("%s missing", c)
|
||||||
|
}
|
||||||
test_helpers.MountOrFatal(t, dirB, dirC, "-aessiv", "-masterkey", m, opensslOpt)
|
test_helpers.MountOrFatal(t, dirB, dirC, "-aessiv", "-masterkey", m, opensslOpt)
|
||||||
checkExampleFSrw(t, dirC, false)
|
checkExampleFSrw(t, dirC, false)
|
||||||
test_helpers.UnmountPanic(dirC)
|
test_helpers.UnmountPanic(dirC)
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
//"time"
|
|
||||||
|
|
||||||
"github.com/rfjakob/gocryptfs/tests/test_helpers"
|
"github.com/rfjakob/gocryptfs/tests/test_helpers"
|
||||||
)
|
)
|
||||||
@ -55,7 +54,9 @@ func TestSymlinks(t *testing.T) {
|
|||||||
// gocryptfs.conf
|
// gocryptfs.conf
|
||||||
func TestConfigMapping(t *testing.T) {
|
func TestConfigMapping(t *testing.T) {
|
||||||
c := dirB + "/gocryptfs.conf"
|
c := dirB + "/gocryptfs.conf"
|
||||||
test_helpers.VerifyExistence(c)
|
if !test_helpers.VerifyExistence(c) {
|
||||||
|
t.Errorf("%s missing", c)
|
||||||
|
}
|
||||||
data, err := ioutil.ReadFile(c)
|
data, err := ioutil.ReadFile(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user