From 440abcbac63a5994d4bac1b5dfcf838aaaefdbd7 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 7 Oct 2015 22:08:30 +0200 Subject: Add test.bash ...also adapt the cryptfs tests for 256 bit long keys --- all.bash | 6 ------ build.bash | 6 ++++++ cryptfs/content_test.go | 6 +++--- cryptfs/names_test.go | 4 ++-- test.bash | 11 +++++++++++ 5 files changed, 22 insertions(+), 11 deletions(-) delete mode 100755 all.bash create mode 100755 build.bash create mode 100755 test.bash diff --git a/all.bash b/all.bash deleted file mode 100755 index ab55293..0000000 --- a/all.bash +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -eu - -cd gocryptfs_main -go build diff --git a/build.bash b/build.bash new file mode 100755 index 0000000..ab55293 --- /dev/null +++ b/build.bash @@ -0,0 +1,6 @@ +#!/bin/bash + +set -eu + +cd gocryptfs_main +go build diff --git a/cryptfs/content_test.go b/cryptfs/content_test.go index ab48b21..aa6c9f3 100644 --- a/cryptfs/content_test.go +++ b/cryptfs/content_test.go @@ -19,7 +19,7 @@ func TestSplitRange(t *testing.T) { testRange{65444, 54}, testRange{6654, 8945}) - key := make([]byte, 16) + key := make([]byte, KEY_LEN) f := NewCryptFS(key, true) for _, r := range ranges { @@ -42,7 +42,7 @@ func TestCiphertextRange(t *testing.T) { testRange{65444, 54}, testRange{6654, 8945}) - key := make([]byte, 16) + key := make([]byte, KEY_LEN) f := NewCryptFS(key, true) for _, r := range ranges { @@ -60,7 +60,7 @@ func TestCiphertextRange(t *testing.T) { } func TestBlockNo(t *testing.T) { - key := make([]byte, 16) + key := make([]byte, KEY_LEN) f := NewCryptFS(key, true) b := f.BlockNoCipherOff(788) diff --git a/cryptfs/names_test.go b/cryptfs/names_test.go index dd57242..14c15c1 100644 --- a/cryptfs/names_test.go +++ b/cryptfs/names_test.go @@ -11,7 +11,7 @@ func TestTranslatePath(t *testing.T) { s = append(s, "foo12312312312312312313123123123") s = append(s, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890") - key := make([]byte, 16) + key := make([]byte, KEY_LEN) fs := NewCryptFS(key, true) for _, n := range s { @@ -33,7 +33,7 @@ func TestPad16(t *testing.T) { s = append(s, []byte("12345678901234567")) s = append(s, []byte("12345678901234567abcdefg")) - key := make([]byte, 16) + key := make([]byte, KEY_LEN) fs := NewCryptFS(key, true) for i := range s { diff --git a/test.bash b/test.bash new file mode 100755 index 0000000..a6f98be --- /dev/null +++ b/test.bash @@ -0,0 +1,11 @@ +#!/bin/bash + +set -eux + +cd cryptfs +go build +go test + +cd ../gocryptfs_main +go build +go test -- cgit v1.2.3