1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00
Files
incus/test/suites/oidc.sh
Stéphane Graber 60b0a97720 tests: Standardize indentation
This is the result of: shfmt -w -i 4 -sr -l test/

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-07-31 15:15:11 -04:00

27 lines
830 B
Bash

test_oidc() {
ensure_import_testimage
# shellcheck disable=2153
ensure_has_localhost_remote "${INCUS_ADDR}"
# Setup OIDC
spawn_oidc
incus config set "oidc.issuer=http://127.0.0.1:$(cat "${TEST_DIR}/oidc.port")/"
incus config set "oidc.client.id=device"
BROWSER=curl incus remote add --accept-certificate oidc "${INCUS_ADDR}" --auth-type oidc
[ "$(incus info oidc: | grep ^auth_user_name | sed "s/.*: //g")" = "unknown" ]
incus remote remove oidc
set_oidc test-user
BROWSER=curl incus remote add --accept-certificate oidc "${INCUS_ADDR}" --auth-type oidc
[ "$(incus info oidc: | grep ^auth_user_name | sed "s/.*: //g")" = "test-user" ]
incus remote remove oidc
# Cleanup OIDC
kill_oidc
incus config unset oidc.issuer
incus config unset oidc.client.id
}