aboutsummaryrefslogtreecommitdiff
path: root/tests
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
parent195d9d18a90d88ff2cb0530d832c59d98934fd1f (diff)
-deterministic-names: accept flag on -init
And store it in gocryptfs.conf (=remove DirIV feature flag).
Diffstat (limited to 'tests')
-rw-r--r--tests/cli/cli_test.go6
-rw-r--r--tests/deterministic_names/deterministic_names_test.go14
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index 85a8006..f4162f8 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -995,3 +995,9 @@ func TestMountCreat(t *testing.T) {
test_helpers.UnmountPanic(mnt)
}
}
+
+// Test -init -deterministic-names
+func TestInitDeterministicNames(t *testing.T) {
+ dir := test_helpers.InitFS(t, "-deterministic-names")
+
+}
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)