test-sso-smb.sh 921 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env bash
  2. #
  3. # SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. #
  6. set -e
  7. DC_IP="$1"
  8. SCRIPT_DIR="${0%/*}"
  9. echo -n "Checking that we can authenticate using kerberos: "
  10. 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)
  11. if [[ "$LOGIN_CONTENT" =~ "Location: http://localhost/success" ]]; then
  12. echo "✔️"
  13. else
  14. echo "❌"
  15. exit 1
  16. fi
  17. echo -n "Getting test file: "
  18. 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)
  19. CONTENT=$(echo $CONTENT | head -n 1 | tr -d '[:space:]')
  20. if [[ $CONTENT == "testfile" ]]; then
  21. echo "✔️"
  22. else
  23. echo "❌"
  24. exit 1
  25. fi