From b4f8ca74509575b4623a9455b84d2689131c4092 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 9b34aad8b..787be6328 100755 --- a/test_e2e.sh +++ b/test_e2e.sh @@ -1694,7 +1694,7 @@ function e2e::auth_http_password() { ############################################## # Test HTTP basicwith a password-file ############################################## -function e2e::auth_http_password_file_incorrect() { +function e2e::auth_http_password_file() { # Run a git-over-HTTP server. CTR=$(docker_run \ -v "$REPO":/git/repo:ro \ @@ -1731,12 +1731,12 @@ function e2e::auth_http_password_file_incorrect() { } ############################################## -# 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 \ @@ -1744,7 +1744,7 @@ function e2e::auth_ssh_wrong_key() { 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" \