From 83b0678b9c5958ea4478def51905c2f666a73d14 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 19 Sep 2023 15:14:54 -0700 Subject: [PATCH] e2e: merge SSH fail and success cases --- test_e2e.sh | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/test_e2e.sh b/test_e2e.sh index 4e477f438..291134c7b 100755 --- a/test_e2e.sh +++ b/test_e2e.sh @@ -1731,20 +1731,20 @@ function e2e::auth_http_password_file() { } ############################################## -# Test SSH with bad key +# Test SSH ############################################## -function e2e::auth_ssh_wrong_key() { +function e2e::auth_ssh() { echo "$FUNCNAME" > "$REPO/file" - # Run a git-over-SSH server. Use key #1. + # Run a git-over-SSH server. Use key #3 to exercise the multi-key logic. CTR=$(docker_run \ -v "$DOT_SSH/server/3":/dot_ssh:ro \ - -v "$REPO":/src:ro \ + -v "$REPO":/git/repo:ro \ e2e/test/sshd) IP=$(docker_ip "$CTR") git -C "$REPO" commit -qam "$FUNCNAME" - # Try to sync with key #2. + # Try to sync with key #1. GIT_SYNC \ --one-time \ --repo="test@$IP:/src" \ @@ -1754,26 +1754,9 @@ function e2e::auth_ssh_wrong_key() { --ssh-known-hosts=false \ --ssh-key-file="/ssh/secret.2" \ || true - - # check for failure assert_file_absent "$ROOT/link/file" -} - -############################################## -# Test SSH -############################################## -function e2e::auth_ssh() { - # Run a git-over-SSH server. Use key #3 to exercise the multi-key logic. - CTR=$(docker_run \ - -v "$DOT_SSH/server/3":/dot_ssh:ro \ - -v "$REPO":/git/repo:ro \ - e2e/test/sshd) - IP=$(docker_ip "$CTR") - - # Configure the repo. - echo "$FUNCNAME" > "$REPO/file" - git -C "$REPO" commit -qam "$FUNCNAME" + # Try to sync with multiple keys GIT_SYNC \ --one-time \ --repo="test@$IP:/git/repo" \