diff options
author | Jakob Unterwurzacher | 2019-01-04 19:21:09 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2019-01-04 19:21:09 +0100 |
commit | 8d71f8fe523a1c117ec8f4b47dd6067203a92551 (patch) | |
tree | 9ac142077c57ede08efe5f97b2a5d5a523b96106 /gocryptfs-xray/xray_tests/xray_test.go | |
parent | 44e860d1055c0ee946919b0a49baa85272123f5f (diff) |
xray: add dumpmasterkey test
Diffstat (limited to 'gocryptfs-xray/xray_tests/xray_test.go')
-rw-r--r-- | gocryptfs-xray/xray_tests/xray_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gocryptfs-xray/xray_tests/xray_test.go b/gocryptfs-xray/xray_tests/xray_test.go index 8e5fc0c..57fec71 100644 --- a/gocryptfs-xray/xray_tests/xray_test.go +++ b/gocryptfs-xray/xray_tests/xray_test.go @@ -41,3 +41,20 @@ func TestAessivXray(t *testing.T) { fmt.Printf("have:\n%s", string(out)) } } + +func TestDumpmasterkey(t *testing.T) { + expected := "f342380e238f708ff4eb94d1fcf79cca7e1e9d9ab91222865e4eaae8a292ee43\n" + cmd := exec.Command("../gocryptfs-xray", "-dumpmasterkey", "aesgcm_fs/gocryptfs.conf") + // Password = "test" + cmd.Stdin = bytes.NewBuffer([]byte("test")) + out1, err := cmd.CombinedOutput() + if err != nil { + t.Fatal(err) + } + out := string(out1) + if out != expected { + t.Errorf("Wrong output") + fmt.Printf("expected: %s\n", expected) + fmt.Printf("have: %s\n", out) + } +} |