aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-06-19 20:01:29 +0200
committerJakob Unterwurzacher2016-06-19 20:04:09 +0200
commit930e597f5ae83ea5940b7196e45404daa14bf647 (patch)
treea93598080c61cea71c620d4538bb10a488133a57 /tests
parentf0b4d2354ddd481eed6c6b26046fe6b4e04e5d7e (diff)
tests: expect mount failure for v0.6 and older example filesystems
Diffstat (limited to 'tests')
-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()
}