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 25, 2024
1 parent 8930032 commit 8cc1739
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 @@ -138,7 +138,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 @@ -147,10 +148,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 @@ -160,7 +164,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 8cc1739

Please sign in to comment.