tests: invert ResetTmpDir argument
As reverse also does not want a diriv file, the "plaintextNames" argument became a misnomer.
This commit is contained in:
parent
29c8ca85d8
commit
8c89e2da0c
|
@ -32,7 +32,7 @@ func TestMain(m *testing.M) {
|
||||||
if testing.Verbose() {
|
if testing.Verbose() {
|
||||||
fmt.Printf("example_filesystems: testing with %q\n", opensslOpt)
|
fmt.Printf("example_filesystems: testing with %q\n", opensslOpt)
|
||||||
}
|
}
|
||||||
test_helpers.ResetTmpDir(true)
|
test_helpers.ResetTmpDir(false)
|
||||||
r := m.Run()
|
r := m.Run()
|
||||||
if r != 0 {
|
if r != 0 {
|
||||||
os.Exit(r)
|
os.Exit(r)
|
||||||
|
|
|
@ -65,8 +65,7 @@ func TestMain(m *testing.M) {
|
||||||
j, _ := json.Marshal(testcase)
|
j, _ := json.Marshal(testcase)
|
||||||
fmt.Printf("matrix: testcase = %s\n", string(j))
|
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 := []string{"-zerokey"}
|
||||||
opts = append(opts, fmt.Sprintf("-openssl=%v", testcase.Openssl))
|
opts = append(opts, fmt.Sprintf("-openssl=%v", testcase.Openssl))
|
||||||
opts = append(opts, fmt.Sprintf("-plaintextnames=%v", testcase.Plaintextnames))
|
opts = append(opts, fmt.Sprintf("-plaintextnames=%v", testcase.Plaintextnames))
|
||||||
|
|
|
@ -48,7 +48,7 @@ func init() {
|
||||||
// |-- DefaultPlainDir
|
// |-- DefaultPlainDir
|
||||||
// *-- DefaultCipherDir
|
// *-- DefaultCipherDir
|
||||||
// *-- gocryptfs.diriv
|
// *-- gocryptfs.diriv
|
||||||
func ResetTmpDir(plaintextNames bool) {
|
func ResetTmpDir(createDirIV bool) {
|
||||||
// Try to unmount and delete everything
|
// Try to unmount and delete everything
|
||||||
entries, err := ioutil.ReadDir(TmpDir)
|
entries, err := ioutil.ReadDir(TmpDir)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -83,7 +83,7 @@ func ResetTmpDir(plaintextNames bool) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
if !plaintextNames {
|
if createDirIV {
|
||||||
err = nametransform.WriteDirIV(DefaultCipherDir)
|
err = nametransform.WriteDirIV(DefaultCipherDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue