Skip to content

Commit

Permalink
test/suites: Test the token pruning task removes expired pending TLS …
Browse files Browse the repository at this point in the history
…identities.

Signed-off-by: Mark Laing <[email protected]>
  • Loading branch information
markylaing committed Oct 24, 2024
1 parent 0cc73ad commit a3f50fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/suites/auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ test_authorization() {
# The token was used, so the pending identity should be deleted.
[ "$(lxc auth identity list --format csv | grep -cF 'pending')" = 0 ]

# Check token prune task works
lxc auth identity create tls/test-user2 --quiet
[ "$(lxc auth identity list --format csv | grep -cF 'pending')" = 1 ]
sleep 2 # Wait for token to expire (expiry is still set to 1 second)
lxc query --request POST /internal/testing/prune-tokens
[ "$(lxc auth identity list --format csv | grep -cF 'pending')" = 0 ]

# Check users have been added to the group.
tls_identity_fingerprint="$(cert_fingerprint "${LXD_CONF2}/client.crt")"
lxc auth identity list --format csv | grep -Fq 'oidc,OIDC client," ",[email protected],test-group'
Expand Down

0 comments on commit a3f50fa

Please sign in to comment.