summaryrefslogtreecommitdiff
path: root/gocryptfs-xray/xray_tests/xray_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2019-01-04 19:02:36 +0100
committerJakob Unterwurzacher2019-01-04 19:02:36 +0100
commit30a8fda0a1d69dc9019e35a3da5bb8434ca9dbc0 (patch)
tree170cf585ca882e2021937d5e45a9994e73799b24 /gocryptfs-xray/xray_tests/xray_test.go
parentcb524b60b41bd6d5f101f13d7adda71db4e0acde (diff)
xray: add tests and example aes-gcm fs
The single test compares the gocryptfs-xray output with the expected output.
Diffstat (limited to 'gocryptfs-xray/xray_tests/xray_test.go')
-rw-r--r--gocryptfs-xray/xray_tests/xray_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/gocryptfs-xray/xray_tests/xray_test.go b/gocryptfs-xray/xray_tests/xray_test.go
new file mode 100644
index 0000000..a3374b0
--- /dev/null
+++ b/gocryptfs-xray/xray_tests/xray_test.go
@@ -0,0 +1,26 @@
+package xray_tests
+
+import (
+ "bytes"
+ "fmt"
+ "io/ioutil"
+ "os/exec"
+ "testing"
+)
+
+func TestAesgcmXray(t *testing.T) {
+ expected, err := ioutil.ReadFile("aesgcm_fs.xray.txt")
+ if err != nil {
+ t.Fatal(err)
+ }
+ cmd := exec.Command("../gocryptfs-xray", "aesgcm_fs/fRtDWUFQK9vDAtAJrTbbWg")
+ out, err := cmd.CombinedOutput()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if bytes.Compare(out, expected) != 0 {
+ t.Errorf("Unexpected output")
+ fmt.Printf("expected:\n%s", string(expected))
+ fmt.Printf("have:\n%s", string(out))
+ }
+}