@@ -1892,7 +1892,7 @@ function e2e::auth_http_password_file() {
18921892}
18931893
18941894# #############################################
1895- # Test SSH
1895+ # Test SSH (user@host:path syntax)
18961896# #############################################
18971897function e2e::auth_ssh() {
18981898 # Run a git-over-SSH server. Use key #3 to exercise the multi-key logic.
@@ -1929,6 +1929,44 @@ function e2e::auth_ssh() {
19291929 assert_file_eq " $ROOT /link/file" " $FUNCNAME "
19301930}
19311931
1932+ # #############################################
1933+ # Test SSH (ssh://user@host/path syntax)
1934+ # #############################################
1935+ function e2e::auth_ssh_url() {
1936+ # Run a git-over-SSH server. Use key #3 to exercise the multi-key logic.
1937+ CTR=$( docker_run \
1938+ -v " $DOT_SSH /server/3" :/dot_ssh:ro \
1939+ -v " $REPO " :/git/repo:ro \
1940+ e2e/test/sshd)
1941+ IP=$( docker_ip " $CTR " )
1942+
1943+ # Try to sync with key #1.
1944+ assert_fail \
1945+ GIT_SYNC \
1946+ --one-time \
1947+ --repo=" ssh://test@$IP /git/repo" \
1948+ --root=" $ROOT " \
1949+ --link=" link" \
1950+ --ssh-known-hosts=false \
1951+ --ssh-key-file=" /ssh/secret.2"
1952+ assert_file_absent " $ROOT /link/file"
1953+
1954+ # Try to sync with multiple keys
1955+ GIT_SYNC \
1956+ --one-time \
1957+ --repo=" ssh://test@$IP /git/repo" \
1958+ --root=" $ROOT " \
1959+ --link=" link" \
1960+ --ssh-known-hosts=false \
1961+ --ssh-key-file=" /ssh/secret.1" \
1962+ --ssh-key-file=" /ssh/secret.2" \
1963+ --ssh-key-file=" /ssh/secret.3"
1964+
1965+ assert_link_exists " $ROOT /link"
1966+ assert_file_exists " $ROOT /link/file"
1967+ assert_file_eq " $ROOT /link/file" " $FUNCNAME "
1968+ }
1969+
19321970# #############################################
19331971# Test askpass-url with bad password
19341972# #############################################
0 commit comments