diff options
author | Robin Appelman <robin@icewind.nl> | 2022-01-20 19:16:08 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-01-20 20:34:34 +0300 |
commit | 4fe70de1328dbd33312e83d47dbfc0dd502fa04a (patch) | |
tree | 2561d99974f758a0348c0277b4a2fcc3c44927df /apps/files_external | |
parent | a33e1dc5bbdc16d4d0f117de1e89e21281ca2223 (diff) |
Add test for samba kerberos sso in ci
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external')
-rwxr-xr-x | apps/files_external/tests/setup-krb.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/apps/files_external/tests/setup-krb.sh b/apps/files_external/tests/setup-krb.sh new file mode 100755 index 00000000000..968ba80529e --- /dev/null +++ b/apps/files_external/tests/setup-krb.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +function getContainerHealth { + docker inspect --format "{{.State.Health.Status}}" $1 +} + +function waitContainer { + while STATUS=$(getContainerHealth $1); [ $STATUS != "healthy" ]; do + if [ $STATUS == "unhealthy" ]; then + echo "Failed!" + exit -1 + fi + printf . + lf=$'\n' + sleep 1 + done + printf "$lf" +} + +mkdir /tmp/shared + +# start the dc +docker run -dit --name dc -v /tmp/shared:/shared --hostname krb.domain.test --cap-add SYS_ADMIN icewind1991/samba-krb-test-dc +DC_IP=$(docker inspect dc --format '{{.NetworkSettings.IPAddress}}') + +waitContainer dc + +# start apache +docker run -d --name apache -v $PWD:/var/www/html -v /tmp/shared:/shared --dns $DC_IP --hostname httpd.domain.test icewind1991/samba-krb-test-apache +APACHE_IP=$(docker inspect apache --format '{{.NetworkSettings.IPAddress}}') + +# add the dns record for apache +docker exec dc samba-tool dns add krb.domain.test domain.test httpd A $APACHE_IP -U administrator --password=passwOrd1 |