aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-08 19:22:59 +0200
committerJakob Unterwurzacher2016-10-08 19:22:59 +0200
commit8c89e2da0ca3a2c901bfe067904b623a4da6f6a7 (patch)
tree145686ddef0cfa9c00a82ef4961fc159fd449af5
parent29c8ca85d836f560837b0be51114b7a2931cf5bd (diff)
tests: invert ResetTmpDir argument
As reverse also does not want a diriv file, the "plaintextNames" argument became a misnomer.
-rw-r--r--tests/example_filesystems/example_filesystems_test.go2
-rw-r--r--tests/matrix/matrix_test.go3
-rw-r--r--tests/test_helpers/helpers.go4
3 files changed, 4 insertions, 5 deletions
diff --git a/tests/example_filesystems/example_filesystems_test.go b/tests/example_filesystems/example_filesystems_test.go
index 2b0c2ca..d182f3a 100644
--- a/tests/example_filesystems/example_filesystems_test.go
+++ b/tests/example_filesystems/example_filesystems_test.go
@@ -32,7 +32,7 @@ func TestMain(m *testing.M) {
if testing.Verbose() {
fmt.Printf("example_filesystems: testing with %q\n", opensslOpt)
}
- test_helpers.ResetTmpDir(true)
+ test_helpers.ResetTmpDir(false)
r := m.Run()
if r != 0 {
os.Exit(r)
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index 77d9dc7..7b636ad 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -65,8 +65,7 @@ func TestMain(m *testing.M) {
j, _ := json.Marshal(testcase)
fmt.Printf("matrix: testcase = %s\n", string(j))
}
- testcase.Plaintextnames = testcase.Plaintextnames
- test_helpers.ResetTmpDir(testcase.Plaintextnames)
+ test_helpers.ResetTmpDir(!testcase.Plaintextnames)
opts := []string{"-zerokey"}
opts = append(opts, fmt.Sprintf("-openssl=%v", testcase.Openssl))
opts = append(opts, fmt.Sprintf("-plaintextnames=%v", testcase.Plaintextnames))
diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go
index c38bbf2..479da69 100644
--- a/tests/test_helpers/helpers.go
+++ b/tests/test_helpers/helpers.go
@@ -48,7 +48,7 @@ func init() {
// |-- DefaultPlainDir
// *-- DefaultCipherDir
// *-- gocryptfs.diriv
-func ResetTmpDir(plaintextNames bool) {
+func ResetTmpDir(createDirIV bool) {
// Try to unmount and delete everything
entries, err := ioutil.ReadDir(TmpDir)
if err == nil {
@@ -83,7 +83,7 @@ func ResetTmpDir(plaintextNames bool) {
if err != nil {
panic(err)
}
- if !plaintextNames {
+ if createDirIV {
err = nametransform.WriteDirIV(DefaultCipherDir)
if err != nil {
panic(err)