test-sso-smb.sh 798 B

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