2016-09-25 15:05:09 +02:00
|
|
|
package reverse_test
|
|
|
|
|
|
|
|
import (
|
2016-09-25 15:32:46 +02:00
|
|
|
"bytes"
|
2016-09-25 15:05:09 +02:00
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/rfjakob/gocryptfs/tests/test_helpers"
|
|
|
|
)
|
|
|
|
|
|
|
|
var dirA, dirB, dirC string
|
2016-09-25 15:32:46 +02:00
|
|
|
var x240 string
|
2016-09-25 15:05:09 +02:00
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
2016-09-25 15:32:46 +02:00
|
|
|
x240 = string(bytes.Repeat([]byte("x"), 240))
|
2016-09-25 15:05:09 +02:00
|
|
|
dirA = test_helpers.TmpDir + "/a"
|
|
|
|
dirB = test_helpers.TmpDir + "/b"
|
|
|
|
dirC = test_helpers.TmpDir + "/c"
|
|
|
|
if err := os.Mkdir(dirA, 0700); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
if err := os.Mkdir(dirB, 0700); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
if err := os.Mkdir(dirC, 0700); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
test_helpers.MountOrExit(dirA, dirB, "-zerokey", "-reverse")
|
2016-09-26 23:25:13 +02:00
|
|
|
test_helpers.MountOrExit(dirB, dirC, "-zerokey", "-aessiv")
|
2016-09-25 15:05:09 +02:00
|
|
|
r := m.Run()
|
|
|
|
test_helpers.UnmountPanic(dirC)
|
|
|
|
test_helpers.UnmountPanic(dirB)
|
|
|
|
os.RemoveAll(test_helpers.TmpDir)
|
|
|
|
os.Exit(r)
|
|
|
|
}
|