tests: expect mount failure for v0.6 and older example filesystems

This commit is contained in:
Jakob Unterwurzacher 2016-06-19 20:01:29 +02:00
parent f0b4d2354d
commit 930e597f5a
2 changed files with 18 additions and 17 deletions

View File

@ -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)

View File

@ -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
}
return cmd.Run()
}