tests: create all-zero gocryptfs.diriv in resetTmpDir()

Tests were failing because this file was missing
This commit is contained in:
Jakob Unterwurzacher 2015-11-27 21:50:11 +01:00
parent bdd9249a52
commit 798e5eb5e7
2 changed files with 7 additions and 1 deletions

View File

@ -15,7 +15,7 @@ const statusTxtContent = "It works!\n"
func checkStatusTxt(t *testing.T, filename string) { func checkStatusTxt(t *testing.T, filename string) {
contentBytes, err := ioutil.ReadFile(filename) contentBytes, err := ioutil.ReadFile(filename)
if err != nil { if err != nil {
t.Error(err) t.Fatal(err)
} }
content := string(contentBytes) content := string(contentBytes)
if content != statusTxtContent { if content != statusTxtContent {

View File

@ -38,6 +38,12 @@ func resetTmpDir() {
fmt.Println(err) fmt.Println(err)
os.Exit(1) os.Exit(1)
} }
dirIV := make([]byte, 16)
err = ioutil.WriteFile(defaultCipherDir + "gocryptfs.diriv", dirIV, 0444)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
} }
// mount CIPHERDIR "c" on PLAINDIR "p" // mount CIPHERDIR "c" on PLAINDIR "p"