Skip to content

Commit

Permalink
lxd/db: Update certificates test.
Browse files Browse the repository at this point in the history
It is no longer possible to create a certificate without a type.

Signed-off-by: Mark Laing <mark.laing@canonical.com>
  • Loading branch information
markylaing committed Feb 4, 2024
1 parent 9cfa576 commit 5f202de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lxd/db/certificates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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")
Expand Down

0 comments on commit 5f202de

Please sign in to comment.