Skip to content

Commit

Permalink
test: Add tests to check that resources are attached to entitlements
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
  • Loading branch information
gabrielmougard committed Nov 20, 2024
1 parent 2a17de5 commit 8e68504
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/suites/auth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ test_authorization() {
lxc auth identity list --format csv | grep -Fq "tls,Client certificate,test-user,${tls_identity_fingerprint},test-group"

# Test `lxc auth identity info`
expectedOIDCInfo='authentication_method: oidc
expectedOIDCInfo='entitlements: []
authentication_method: oidc
type: OIDC client
id: test-user@example.com
name: '"'"' '"'"'
Expand All @@ -124,10 +125,13 @@ groups:
tls_certificate: ""
effective_groups:
- test-group
effective_permissions: []'
effective_permissions: []
is_fine_grained: true'

[ "$(lxc auth identity info oidc:)" = "${expectedOIDCInfo}" ]

expectedTLSInfo="authentication_method: tls
expectedTLSInfo="entitlements: []
authentication_method: tls
type: Client certificate
id: ${tls_identity_fingerprint}
name: test-user
Expand All @@ -137,7 +141,9 @@ tls_certificate: |
$(awk '{printf " %s\n", $0}' "${LXD_CONF2}/client.crt")
effective_groups:
- test-group
effective_permissions: []"
effective_permissions: []
is_fine_grained: true"

[ "$(LXD_CONF="${LXD_CONF2}" lxc auth identity info tls:)" = "${expectedTLSInfo}" ]


Expand Down

0 comments on commit 8e68504

Please sign in to comment.