aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/example_filesystems/example_filesystems_test.go28
-rw-r--r--tests/test_helpers/helpers.go7
2 files changed, 18 insertions, 17 deletions
diff --git a/tests/example_filesystems/example_filesystems_test.go b/tests/example_filesystems/example_filesystems_test.go
index dce4558..1cf05b6 100644
--- a/tests/example_filesystems/example_filesystems_test.go
+++ b/tests/example_filesystems/example_filesystems_test.go
@@ -86,9 +86,10 @@ func TestExampleFSv04(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- test_helpers.MountOrFatal(t, cDir, pDir, "-extpass", "echo test")
- checkExampleFS(t, pDir, false)
- test_helpers.Unmount(pDir)
+ err = test_helpers.Mount(cDir, pDir, "-extpass", "echo test")
+ if err == nil {
+ t.Errorf("Mounting deprecated FS should fail")
+ }
test_helpers.MountOrFatal(t, cDir, pDir, "-masterkey", "74676e34-0b47c145-00dac61a-17a92316-"+
"bb57044c-e205b71f-65f4fdca-7cabd4b3", "-diriv=false", "-emenames=false", "-gcmiv128=false")
checkExampleFS(t, pDir, true)
@@ -108,9 +109,10 @@ func TestExampleFSv05(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- test_helpers.MountOrFatal(t, cDir, pDir, "-extpass", "echo test")
- checkExampleFS(t, pDir, false)
- test_helpers.Unmount(pDir)
+ err = test_helpers.Mount(cDir, pDir, "-extpass", "echo test")
+ if err == nil {
+ t.Errorf("Mounting deprecated FS should fail")
+ }
test_helpers.MountOrFatal(t, cDir, pDir, "-masterkey", "199eae55-36bff4af-83b9a3a2-4fa16f65-"+
"1549ccdb-2d08d1f0-b1b26965-1b61f896", "-emenames=false", "-gcmiv128=false")
checkExampleFS(t, pDir, true)
@@ -130,9 +132,10 @@ func TestExampleFSv06(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- test_helpers.MountOrFatal(t, cDir, pDir, "-extpass", "echo test")
- checkExampleFS(t, pDir, false)
- test_helpers.Unmount(pDir)
+ err = test_helpers.Mount(cDir, pDir, "-extpass", "echo test")
+ if err == nil {
+ t.Errorf("Mounting deprecated FS should fail")
+ }
test_helpers.MountOrFatal(t, cDir, pDir, "-masterkey", "7bc8deb0-5fc894ef-a093da43-61561a81-"+
"0e8dee83-fdc056a4-937c37dd-9df5c520", "-gcmiv128=false")
checkExampleFS(t, pDir, true)
@@ -154,9 +157,10 @@ func TestExampleFSv06PlaintextNames(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- test_helpers.MountOrFatal(t, cDir, pDir, "-extpass", "echo test")
- checkExampleFS(t, pDir, false)
- test_helpers.Unmount(pDir)
+ err = test_helpers.Mount(cDir, pDir, "-extpass", "echo test")
+ if err == nil {
+ t.Errorf("Mounting deprecated FS should fail")
+ }
test_helpers.MountOrFatal(t, cDir, pDir, "-masterkey", "f4690202-595e4593-64c4f7e0-4dddd7d1-"+
"303147f9-0ca8aea2-966341a7-52ea8ae9", "-plaintextnames", "-gcmiv128=false")
checkExampleFS(t, pDir, true)
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go
index 04686c2..a3258fb 100644
--- a/tests/test_helpers/helpers.go
+++ b/tests/test_helpers/helpers.go
@@ -109,11 +109,8 @@ func Mount(c string, p string, extraArgs ...string) error {
cmd := exec.Command(GocryptfsBinary, args...)
cmd.Stderr = os.Stderr
- if testing.Verbose() {
- // Don't show the "deprecated filesystem" warnings by default. These
- // are not silenced by "-q".
- cmd.Stdout = os.Stdout
- }
+ cmd.Stdout = os.Stdout
+
return cmd.Run()
}