aboutsummaryrefslogtreecommitdiff
path: root/server/store/store_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/store/store_test.go')
-rw-r--r--server/store/store_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/store/store_test.go b/server/store/store_test.go
index 3fd900c..628c539 100644
--- a/server/store/store_test.go
+++ b/server/store/store_test.go
@@ -30,7 +30,7 @@ func TestParseCertificate(t *testing.T) {
}
s, _ := ssh.NewSignerFromKey(r)
c.SignCert(rand.Reader, s)
- rec := parseCertificate(c)
+ rec := MakeRecord(c)
a.Equal(c.KeyId, rec.KeyID)
a.Equal(c.ValidPrincipals, []string(rec.Principals))
@@ -73,7 +73,8 @@ func testStore(t *testing.T, db CertStorer) {
cert := c.(*ssh.Certificate)
cert.ValidBefore = uint64(time.Now().Add(1 * time.Hour).UTC().Unix())
cert.ValidAfter = uint64(time.Now().Add(-5 * time.Minute).UTC().Unix())
- if err := db.SetCert(cert); err != nil {
+ rec := MakeRecord(cert)
+ if err := db.SetRecord(rec); err != nil {
t.Error(err)
}
@@ -153,6 +154,6 @@ func TestMarshalCert(t *testing.T) {
if err != nil {
t.Error(err)
}
- want := `{"key_id":"id","principals":["user"],"revoked":false,"created_at":"2017-04-10 13:00:00 +0000","expires":"2017-04-11 10:00:00 +0000"}`
+ want := `{"key_id":"id","principals":["user"],"revoked":false,"created_at":"2017-04-10 13:00:00 +0000","expires":"2017-04-11 10:00:00 +0000","message":""}`
a.JSONEq(want, string(b))
}