From 5f202dee7753f2e932fd10e694cf8894f62422ac Mon Sep 17 00:00:00 2001 From: Mark Laing Date: Thu, 1 Feb 2024 16:12:04 +0000 Subject: [PATCH] lxd/db: Update certificates test. It is no longer possible to create a certificate without a type. Signed-off-by: Mark Laing --- lxd/db/certificates_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lxd/db/certificates_test.go b/lxd/db/certificates_test.go index 1d2280ec57f5..836357013119 100644 --- a/lxd/db/certificates_test.go +++ b/lxd/db/certificates_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/canonical/lxd/lxd/certificate" "github.com/canonical/lxd/lxd/db" "github.com/canonical/lxd/lxd/db/cluster" ) @@ -18,7 +19,10 @@ func TestGetCertificate(t *testing.T) { defer cleanup() ctx := context.Background() - _, err := cluster.CreateCertificate(ctx, tx.Tx(), cluster.Certificate{Fingerprint: "foobar"}) + _, err := cluster.CreateCertificate(ctx, tx.Tx(), cluster.Certificate{ + Fingerprint: "foobar", + Type: certificate.TypeClient, + }) require.NoError(t, err) cert, err := cluster.GetCertificate(ctx, tx.Tx(), "foobar")