aboutsummaryrefslogtreecommitdiff
path: root/tests/test_helpers/helpers.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-05-07 21:01:39 +0200
committerJakob Unterwurzacher2017-05-07 21:01:39 +0200
commitad7942f434fea567f24458e67a0919291b5ec8dd (patch)
tree463dac4ecb99970973ae662bdd50d05c1b71ced2 /tests/test_helpers/helpers.go
parent26881538e1753e613b4143b28fa339812a9a6d16 (diff)
fusefrontend: implement path decryption via ctlsock
Closes https://github.com/rfjakob/gocryptfs/issues/84 .
Diffstat (limited to 'tests/test_helpers/helpers.go')
-rw-r--r--tests/test_helpers/helpers.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go
index 299067a..f681482 100644
--- a/tests/test_helpers/helpers.go
+++ b/tests/test_helpers/helpers.go
@@ -1,6 +1,7 @@
package test_helpers
import (
+ "bytes"
"crypto/md5"
"encoding/hex"
"encoding/json"
@@ -27,6 +28,9 @@ const GocryptfsBinary = "../../gocryptfs"
// UnmountScript is the fusermount/umount compatibility wrapper script
const UnmountScript = "../fuse-unmount.bash"
+// X255 contains 255 uppercase "X". This can be used as a maximum-length filename.
+var X255 string
+
// TmpDir is a unique temporary directory. "go test" runs package tests in parallel. We create a
// unique TmpDir in init() so the tests do not interfere.
var TmpDir string
@@ -38,6 +42,8 @@ var DefaultPlainDir string
var DefaultCipherDir string
func init() {
+ X255 = string(bytes.Repeat([]byte("X"), 255))
+
os.MkdirAll(testParentDir, 0700)
var err error
TmpDir, err = ioutil.TempDir(testParentDir, "")