aboutsummaryrefslogtreecommitdiff
path: root/tests/cli/cli_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cli/cli_test.go')
-rw-r--r--tests/cli/cli_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index 94a8b16..686d14c 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -2,6 +2,8 @@
package cli
import (
+ "bytes"
+ "encoding/hex"
"fmt"
"io/ioutil"
"os"
@@ -97,6 +99,19 @@ func TestInitReverse(t *testing.T) {
}
}
+// Test -init with -masterkey
+func TestInitMasterkey(t *testing.T) {
+ var testMk = make([]byte, 32)
+ dir := test_helpers.InitFS(t, fmt.Sprintf("-masterkey=%s", hex.EncodeToString(testMk)))
+ m, _, err := configfile.LoadAndDecrypt(dir+"/"+configfile.ConfDefaultName, testPw)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !bytes.Equal(testMk, m) {
+ t.Error("masterkey does not match")
+ }
+}
+
// testPasswd changes the password from "test" to "test" using
// the -extpass method, then from "test" to "newpasswd" using the
// stdin method.