aboutsummaryrefslogtreecommitdiff
path: root/tests/deterministic_names/deterministic_names_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-20 15:57:40 +0200
committerJakob Unterwurzacher2021-08-20 15:57:40 +0200
commit2a9dea2973a6141e8efdf8bd26d8ddb2d2c35fc4 (patch)
tree3af78126e573b5a9963111c1bdea6f8d1100fbd1 /tests/deterministic_names/deterministic_names_test.go
parent195d9d18a90d88ff2cb0530d832c59d98934fd1f (diff)
-deterministic-names: accept flag on -init
And store it in gocryptfs.conf (=remove DirIV feature flag).
Diffstat (limited to 'tests/deterministic_names/deterministic_names_test.go')
-rw-r--r--tests/deterministic_names/deterministic_names_test.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/deterministic_names/deterministic_names_test.go b/tests/deterministic_names/deterministic_names_test.go
index 1b355df..e94b0b6 100644
--- a/tests/deterministic_names/deterministic_names_test.go
+++ b/tests/deterministic_names/deterministic_names_test.go
@@ -3,11 +3,13 @@ package deterministic_names
// integration tests that target "-deterministic-names" specifically
import (
+ "fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
+ "github.com/rfjakob/gocryptfs/internal/configfile"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
)
@@ -19,8 +21,18 @@ var testPw = []byte("test")
// Create and mount "-deterministic-names" fs
func TestMain(m *testing.M) {
cDir = test_helpers.InitFS(nil, "-deterministic-names")
+ // Check config file sanity
+ _, c, err := configfile.LoadAndDecrypt(cDir+"/"+configfile.ConfDefaultName, testPw)
+ if err != nil {
+ fmt.Println(err)
+ os.Exit(1)
+ }
+ if c.IsFeatureFlagSet(configfile.FlagDirIV) {
+ fmt.Println("DirIV flag should be off")
+ os.Exit(1)
+ }
pDir = cDir + ".mnt"
- test_helpers.MountOrExit(cDir, pDir, "-deterministic-names", "-extpass", "echo test")
+ test_helpers.MountOrExit(cDir, pDir, "-extpass", "echo test")
r := m.Run()
test_helpers.UnmountPanic(pDir)
os.Exit(r)