diff options
author | millert@openbsd.org@openbsd.org <millert@openbsd.org@openbsd.org> | 2017-10-24 19:33:32 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-10-31 09:08:51 +1100 |
commit | 116b1b439413a724ebb3320633a64dd0f3ee1fe7 (patch) | |
tree | 55da5d72989b0d26d1296f1689016664ae60f4d5 /regress/connect-uri.sh | |
parent | dbe0662e9cd482593a4a8bf58c6481bfe8a747a4 (diff) |
upstream commit
Add tests for URI parsing. OK markus@
OpenBSD-Regress-ID: 5d1df19874f3b916d1a2256a905526e17a98bd3b
Diffstat (limited to 'regress/connect-uri.sh')
-rw-r--r-- | regress/connect-uri.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/regress/connect-uri.sh b/regress/connect-uri.sh new file mode 100644 index 000000000..f13f15e66 --- /dev/null +++ b/regress/connect-uri.sh | |||
@@ -0,0 +1,29 @@ | |||
1 | # $OpenBSD: connect-uri.sh,v 1.1 2017/10/24 19:33:32 millert Exp $ | ||
2 | # Placed in the Public Domain. | ||
3 | |||
4 | tid="uri connect" | ||
5 | |||
6 | # Remove Port and User from ssh_config, we want to rely on the URI | ||
7 | cp $OBJ/ssh_config $OBJ/ssh_config.orig | ||
8 | egrep -v '^ +(Port|User) +.*$' $OBJ/ssh_config.orig > $OBJ/ssh_config | ||
9 | |||
10 | start_sshd | ||
11 | |||
12 | verbose "$tid: no trailing slash" | ||
13 | ${SSH} -F $OBJ/ssh_config "ssh://${USER}@somehost:${PORT}" true | ||
14 | if [ $? -ne 0 ]; then | ||
15 | fail "ssh connection failed" | ||
16 | fi | ||
17 | |||
18 | verbose "$tid: trailing slash" | ||
19 | ${SSH} -F $OBJ/ssh_config "ssh://${USER}@somehost:${PORT}/" true | ||
20 | if [ $? -ne 0 ]; then | ||
21 | fail "ssh connection failed" | ||
22 | fi | ||
23 | |||
24 | verbose "$tid: with path name" | ||
25 | ${SSH} -F $OBJ/ssh_config "ssh://${USER}@somehost:${PORT}/${DATA}" true \ | ||
26 | > /dev/null 2>&1 | ||
27 | if [ $? -eq 0 ]; then | ||
28 | fail "ssh connection succeeded, expected failure" | ||
29 | fi | ||