From ac99968796c5a898f643854ea141570d98b569db Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 28 Jan 2015 17:12:59 -0800 Subject: [PATCH] Add x509 tests and should be part of the build --- Makefile | 2 ++ pkg/utils/crypto/x509/generator_test.go | 27 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 pkg/utils/crypto/x509/generator_test.go diff --git a/Makefile b/Makefile index 4d1d400b4..95e34afe8 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,8 @@ build-utils: @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/crypto/sha512 @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/checksum/crc32c @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/database/tiedot + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/crypto/keys + @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/utils/crypto/x509 #build-os: # @godep go test -race -coverprofile=cover.out github.com/minio-io/minio/pkg/os/scsi diff --git a/pkg/utils/crypto/x509/generator_test.go b/pkg/utils/crypto/x509/generator_test.go new file mode 100644 index 000000000..6b65aa2c5 --- /dev/null +++ b/pkg/utils/crypto/x509/generator_test.go @@ -0,0 +1,27 @@ +package x509 + +import ( + "testing" + "time" + + . "gopkg.in/check.v1" +) + +func Test(t *testing.T) { TestingT(t) } + +type MySuite struct{} + +var _ = Suite(&MySuite{}) + +func (s *MySuite) Testing(c *C) { + certObj := Certificates{} + params := X509Params{ + Hostname: "example.com", + IsCA: false, + EcdsaCurve: "P224", + ValidFrom: "Jan 1 15:04:05 2015", + ValidFor: time.Duration(3600), + } + err := certObj.GenerateCertificates(params) + c.Assert(err, IsNil) +}