Skip to content

Commit

Permalink
test/suites: Test that OIDC identities are being added to the database.
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Laing <mark.laing@canonical.com>
  • Loading branch information
markylaing committed Feb 8, 2024
1 parent a322a71 commit dfc9bb9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/suites/oidc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ test_oidc() {

BROWSER=curl lxc remote add --accept-certificate oidc "${LXD_ADDR}" --auth-type oidc
[ "$(lxc info oidc: | grep ^auth_user_name | sed "s/.*: //g")" = "unknown" ]
[ "$(lxd sql global "SELECT identifier, name, auth_method, type FROM identities WHERE type = 5 AND identifier = 'unknown' AND auth_method = 2" | wc -l)" = 5 ]
lxc remote remove oidc

set_oidc test-user

BROWSER=curl lxc remote add --accept-certificate oidc "${LXD_ADDR}" --auth-type oidc
[ "$(lxc info oidc: | grep ^auth_user_name | sed "s/.*: //g")" = "test-user" ]
[ "$(lxd sql global "SELECT identifier, name, auth_method, type FROM identities WHERE type = 5 AND identifier = 'test-user' AND auth_method = 2" | wc -l)" = 5 ]
lxc remote remove oidc

# Cleanup OIDC
Expand Down

0 comments on commit dfc9bb9

Please sign in to comment.