aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-05-01 13:06:52 +0200
committerJakob Unterwurzacher2019-05-01 13:12:44 +0200
commit3ac98722306c316223169fa4a0f9a2769bcceb65 (patch)
treed3bc45432ed84b699b9584d087c6f966afbc75ae /tests
parent41dfbe67f827ecaebd7dd81a079f38a676288800 (diff)
tests: split testParentDir by UID
When we run tests as root, they will leave root-owned files in testParentDir, which causes trouble when we run tests as a normal user later on. Split by UID.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_helpers/helpers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go
index fd36f76..7275997 100644
--- a/tests/test_helpers/helpers.go
+++ b/tests/test_helpers/helpers.go
@@ -59,8 +59,8 @@ func init() {
func doInit() {
X255 = string(bytes.Repeat([]byte("X"), 255))
MountInfo = make(map[string]mountInfo)
-
- testParentDir := os.TempDir() + "/gocryptfs-test-parent"
+ // Something like /tmp/gocryptfs-test-parent-1234
+ testParentDir := fmt.Sprintf("%s/gocryptfs-test-parent-%d", os.TempDir(), os.Getuid())
os.MkdirAll(testParentDir, 0700)
var err error
TmpDir, err = ioutil.TempDir(testParentDir, "")