summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-10-04 22:29:14 +0200
committerJakob Unterwurzacher2016-10-04 22:34:12 +0200
commitdb5782028aaff99dbf15c62d851a4f6ec8227748 (patch)
tree78fddba641b4f84ec99ed22dadecb50df1eb9809 /tests
parentb80d01056f35b2d062e73a6c7d4ba3cff3b6ef7e (diff)
tests: skip tests with -openssl=false on Go 1.4 and lower
Go versions 1.4 and lower lack NewGCMWithNonceSize(), which causes a panic in the test.
Diffstat (limited to 'tests')
-rw-r--r--tests/example_filesystems/example_filesystems_test.go8
-rw-r--r--tests/matrix/matrix_test.go8
2 files changed, 14 insertions, 2 deletions
diff --git a/tests/example_filesystems/example_filesystems_test.go b/tests/example_filesystems/example_filesystems_test.go
index 8b01555..2b0c2ca 100644
--- a/tests/example_filesystems/example_filesystems_test.go
+++ b/tests/example_filesystems/example_filesystems_test.go
@@ -12,6 +12,7 @@ import (
"os"
"testing"
+ "github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
)
@@ -22,7 +23,12 @@ var opensslOpt string
func TestMain(m *testing.M) {
// Make "testing.Verbose()" return the correct value
flag.Parse()
- for _, opensslOpt = range []string{"-openssl=false", "-openssl=true"} {
+ variants := []string{"-openssl=true", "-openssl=false"}
+ if !cryptocore.HaveModernGoGCM {
+ fmt.Printf("Skipping Go GCM variant, Go installation is too old")
+ variants = variants[:1]
+ }
+ for _, opensslOpt = range variants {
if testing.Verbose() {
fmt.Printf("example_filesystems: testing with %q\n", opensslOpt)
}
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index 6a96909..b4c5668 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -22,6 +22,7 @@ import (
"syscall"
"testing"
+ "github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/syscallcompat"
"github.com/rfjakob/gocryptfs/tests/test_helpers"
)
@@ -34,7 +35,12 @@ var plaintextnames bool
func TestMain(m *testing.M) {
// Make "testing.Verbose()" return the correct value
flag.Parse()
- for _, openssl := range []bool{true, false} {
+ opensslVariants := []bool{true, false}
+ if !cryptocore.HaveModernGoGCM {
+ fmt.Printf("Skipping Go GCM variant, Go installation is too old")
+ opensslVariants = opensslVariants[:1]
+ }
+ for _, openssl := range opensslVariants {
for _, plaintextnames = range []bool{true, false} {
if testing.Verbose() {
fmt.Printf("matrix: testing openssl=%v plaintextnames=%v\n", openssl, plaintextnames)