diff options
-rw-r--r-- | crypto_test.go | 3 | ||||
-rw-r--r-- | trillian_test.go | 9 | ||||
-rw-r--r-- | type_test.go | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/crypto_test.go b/crypto_test.go index b6c168b..6233613 100644 --- a/crypto_test.go +++ b/crypto_test.go @@ -51,6 +51,7 @@ func TestBuildChainFromDerList(t *testing.T) { maxChain: 3, anchors: testdata.RootCertificate, chain: mustMakeDerList(t, testdata.ExpiredChain), + wantErr: false, // TODO: should be true! fixme }, { description: "bad chain: too large", @@ -280,8 +281,6 @@ func TestGenV1Sth(t *testing.T) { } } -// TODO: test that metrics are updated correctly? - // mustMakeDerList must parse a PEM-encoded list of certificates to DER func mustMakeDerList(t *testing.T, pem []byte) [][]byte { certs, err := x509util.NewCertificateList(pem) diff --git a/trillian_test.go b/trillian_test.go index 749f22a..179d03c 100644 --- a/trillian_test.go +++ b/trillian_test.go @@ -35,11 +35,11 @@ func TestCheckQueueLeaf(t *testing.T) { }, { description: "ok response: duplicate leaf", - rsp: makeTrillianQueueLeafResponse(t, testPackage, testdata.RootChain, testdata.EndEntityPrivateKey, true), + rsp: makeTrillianQueueLeafResponse(t, testPackage, testdata.IntermediateChain, testdata.EndEntityPrivateKey, true), }, { description: "ok response: new leaf", - rsp: makeTrillianQueueLeafResponse(t, testPackage, testdata.RootChain, testdata.EndEntityPrivateKey, false), + rsp: makeTrillianQueueLeafResponse(t, testPackage, testdata.IntermediateChain, testdata.EndEntityPrivateKey, false), }, } { if err := checkQueueLeaf(table.rsp, table.err); (err != nil) != table.wantErr { @@ -58,15 +58,18 @@ func TestCheckGetLeavesByRange(t *testing.T) { }{ { description: "bad response: trillian error", + req: &GetEntriesRequest{Start: 0, End: 1}, err: fmt.Errorf("backend error"), wantErr: true, }, { description: "bad response: empty", + req: &GetEntriesRequest{Start: 0, End: 1}, wantErr: true, }, { description: "bad response: no leaves", + req: &GetEntriesRequest{Start: 0, End: 1}, rsp: func(rsp *trillian.GetLeavesByRangeResponse) *trillian.GetLeavesByRangeResponse { rsp.Leaves = nil return rsp @@ -75,6 +78,7 @@ func TestCheckGetLeavesByRange(t *testing.T) { }, { description: "bad response: no signed log root", + req: &GetEntriesRequest{Start: 0, End: 1}, rsp: func(rsp *trillian.GetLeavesByRangeResponse) *trillian.GetLeavesByRangeResponse { rsp.SignedLogRoot = nil return rsp @@ -83,6 +87,7 @@ func TestCheckGetLeavesByRange(t *testing.T) { }, { description: "bad response: no log root", + req: &GetEntriesRequest{Start: 0, End: 1}, rsp: func(rsp *trillian.GetLeavesByRangeResponse) *trillian.GetLeavesByRangeResponse { rsp.SignedLogRoot.LogRoot = nil return rsp diff --git a/type_test.go b/type_test.go index e8dce00..abfc280 100644 --- a/type_test.go +++ b/type_test.go @@ -20,8 +20,8 @@ var ( testTreeSizeLarger = uint64(256) testTimestamp = uint64(0) testProof = [][]byte{ - make([]byte, 32), - make([]byte, 32), + testNodeHash, + testNodeHash, } testIndex = uint64(0) testSignatureScheme = tls.Ed25519 |