aboutsummaryrefslogtreecommitdiff
path: root/tests/reverse/main_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/reverse/main_test.go')
-rw-r--r--tests/reverse/main_test.go46
1 files changed, 29 insertions, 17 deletions
diff --git a/tests/reverse/main_test.go b/tests/reverse/main_test.go
index a42bb82..a2b7eb6 100644
--- a/tests/reverse/main_test.go
+++ b/tests/reverse/main_test.go
@@ -10,26 +10,38 @@ import (
var dirA, dirB, dirC string
var x240 string
+var plaintextnames bool
func TestMain(m *testing.M) {
x240 = string(bytes.Repeat([]byte("x"), 240))
- 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)
+ var r int
+ for _, plaintextnames = range []bool{false, true} {
+ argsA := []string{"-reverse"}
+ if plaintextnames {
+ argsA = append(argsA, "-plaintextnames")
+ }
+ dirA = test_helpers.InitFS(nil, argsA...)
+ dirB = test_helpers.TmpDir + "/b"
+ dirC = test_helpers.TmpDir + "/c"
+ 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, "-reverse", "-extpass", "echo test")
+ test_helpers.MountOrExit(dirB, dirC, "-extpass", "echo test")
+ r = m.Run()
+ test_helpers.UnmountPanic(dirC)
+ test_helpers.UnmountPanic(dirB)
+
+ os.RemoveAll(dirA)
+ os.RemoveAll(dirB)
+ os.RemoveAll(dirC)
+
+ if r != 0 {
+ os.Exit(r)
+ }
}
- test_helpers.MountOrExit(dirA, dirB, "-zerokey", "-reverse")
- test_helpers.MountOrExit(dirB, dirC, "-zerokey", "-aessiv")
- r := m.Run()
- test_helpers.UnmountPanic(dirC)
- test_helpers.UnmountPanic(dirB)
- os.RemoveAll(test_helpers.TmpDir)
os.Exit(r)
}