From 8cc17392a7ddba30464a09078f3e42e0ff176dba Mon Sep 17 00:00:00 2001 From: Gabriel Mougard Date: Tue, 19 Nov 2024 17:35:42 +0100 Subject: [PATCH] test: Add tests to check that resources are attached to entitlements Signed-off-by: Gabriel Mougard --- test/suites/auth.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/suites/auth.sh b/test/suites/auth.sh index 6b28c55839df..9a751af1c6cc 100644 --- a/test/suites/auth.sh +++ b/test/suites/auth.sh @@ -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: '"'"' '"'"' @@ -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 @@ -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}" ]