aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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)