connect-uri.sh 814 B

123456789101112131415161718192021222324252627282930
  1. # $OpenBSD: connect-uri.sh,v 1.1 2017/10/24 19:33:32 millert Exp $
  2. # Placed in the Public Domain.
  3. tid="uri connect"
  4. # Remove Port and User from ssh_config, we want to rely on the URI
  5. cp $OBJ/ssh_config $OBJ/ssh_config.orig
  6. egrep -v '^ +(Port|User) +.*$' $OBJ/ssh_config.orig > $OBJ/ssh_config
  7. start_sshd
  8. verbose "$tid: no trailing slash"
  9. ${SSH} -F $OBJ/ssh_config "ssh://${USER}@somehost:${PORT}" true
  10. if [ $? -ne 0 ]; then
  11. fail "ssh connection failed"
  12. fi
  13. verbose "$tid: trailing slash"
  14. ${SSH} -F $OBJ/ssh_config "ssh://${USER}@somehost:${PORT}/" true
  15. if [ $? -ne 0 ]; then
  16. fail "ssh connection failed"
  17. fi
  18. verbose "$tid: with path name"
  19. ${SSH} -F $OBJ/ssh_config "ssh://${USER}@somehost:${PORT}/${DATA}" true \
  20. > /dev/null 2>&1
  21. if [ $? -eq 0 ]; then
  22. fail "ssh connection succeeded, expected failure"
  23. fi