diff options
Diffstat (limited to 'apps/files_external/tests/sso-setup/test-sso-smb.sh')
-rwxr-xr-x | apps/files_external/tests/sso-setup/test-sso-smb.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/apps/files_external/tests/sso-setup/test-sso-smb.sh b/apps/files_external/tests/sso-setup/test-sso-smb.sh new file mode 100755 index 00000000000..46955ae0d3c --- /dev/null +++ b/apps/files_external/tests/sso-setup/test-sso-smb.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# +# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later +# + +set -e + +DC_IP="$1" +SCRIPT_DIR="${0%/*}" + +echo -n "Checking that we can authenticate using kerberos: " +LOGIN_CONTENT=$("$SCRIPT_DIR/client-cmd.sh" $DC_IP curl -i -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/index.php/apps/user_saml/saml/login?originalUrl=http://localhost/success) + +if [[ "$LOGIN_CONTENT" =~ "Location: http://localhost/success" ]]; then + echo "✔️" +else + echo "❌" + echo "$CONTENT" + exit 1 +fi +echo -n "Getting test file: " +CONTENT=$("$SCRIPT_DIR/client-cmd.sh" $DC_IP curl -s --negotiate -u testuser@DOMAIN.TEST: --delegation always http://httpd.domain.test/remote.php/webdav/smb/test.txt) +CONTENT=$(echo $CONTENT | head -n 1 | tr -d '[:space:]') + +if [[ $CONTENT == "testfile" ]]; then + echo "✔️" +else + echo "❌" + echo "$CONTENT" + exit 1 +fi |