From 5b7df0882617c2783b6869b7eeb1c1632d40b305 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Tue, 14 Jun 2022 11:54:45 -0700 Subject: [PATCH] e2e: Reformat ncsvr scripts for readability --- test_e2e.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/test_e2e.sh b/test_e2e.sh index d62b03b..7e76890 100755 --- a/test_e2e.sh +++ b/test_e2e.sh @@ -1053,7 +1053,12 @@ function e2e::askpass_url() { # run the askpass_url service with wrong password CTR=$(docker_run \ e2e/test/test-ncsvr \ - 80 'echo -e "HTTP/1.1 200 OK\r\n\r\nusername=my-username\npassword=wrong"') + 80 ' + echo "HTTP/1.1 200 OK" + echo + echo "username=my-username" + echo "password=wrong" + ') IP=$(docker_ip "$CTR") GIT_SYNC \ @@ -1074,7 +1079,12 @@ function e2e::askpass_url() { # run with askpass_url service with correct password CTR=$(docker_run \ e2e/test/test-ncsvr \ - 80 'echo -e "HTTP/1.1 200 OK\r\n\r\nusername=my-username\npassword=my-password"') + 80 ' + echo "HTTP/1.1 200 OK" + echo + echo "username=my-username" + echo "password=my-password" + ') IP=$(docker_ip "$CTR") GIT_SYNC \ @@ -1230,7 +1240,7 @@ function e2e::webhook_success() { CTR=$(docker_run \ -v "$HITLOG":/var/log/hits \ e2e/test/test-ncsvr \ - 80 'echo -e "HTTP/1.1 200 OK\r\n"') + 80 'echo "HTTP/1.1 200 OK"') IP=$(docker_ip "$CTR") echo "$FUNCNAME 1" > "$REPO"/file git -C "$REPO" commit -qam "$FUNCNAME 1" @@ -1277,7 +1287,7 @@ function e2e::webhook_fail_retry() { CTR=$(docker_run \ -v "$HITLOG":/var/log/hits \ e2e/test/test-ncsvr \ - 80 'echo -e "HTTP/1.1 500 Internal Server Error\r\n"') + 80 'echo "HTTP/1.1 500 Internal Server Error"') IP=$(docker_ip "$CTR") echo "$FUNCNAME 1" > "$REPO"/file git -C "$REPO" commit -qam "$FUNCNAME 1" @@ -1306,7 +1316,7 @@ function e2e::webhook_fail_retry() { --ip="$IP" \ -v "$HITLOG":/var/log/hits \ e2e/test/test-ncsvr \ - 80 'echo -e "HTTP/1.1 200 OK\r\n"') + 80 'echo "HTTP/1.1 200 OK"') sleep 2 HITS=$(cat "$HITLOG" | wc -l) if [[ "$HITS" < 1 ]]; then @@ -1326,7 +1336,7 @@ function e2e::webhook_success_once() { CTR=$(docker_run \ -v "$HITLOG":/var/log/hits \ e2e/test/test-ncsvr \ - 80 'sleep 3 && echo -e "HTTP/1.1 200 OK\r\n"') + 80 'sleep 3 && echo "HTTP/1.1 200 OK"') IP=$(docker_ip "$CTR") echo "$FUNCNAME 1" > "$REPO"/file git -C "$REPO" commit -qam "$FUNCNAME 1" @@ -1363,7 +1373,7 @@ function e2e::webhook_fail_retry_once() { CTR=$(docker_run \ -v "$HITLOG":/var/log/hits \ e2e/test/test-ncsvr \ - 80 'sleep 3 && echo -e "HTTP/1.1 500 Internal Server Error\r\n"') + 80 'sleep 3 && echo "HTTP/1.1 500 Internal Server Error"') IP=$(docker_ip "$CTR") echo "$FUNCNAME 1" > "$REPO"/file git -C "$REPO" commit -qam "$FUNCNAME 1" @@ -1398,7 +1408,7 @@ function e2e::webhook_fire_and_forget() { CTR=$(docker_run \ -v "$HITLOG":/var/log/hits \ e2e/test/test-ncsvr \ - 80 'echo -e "HTTP/1.1 404 Not Found\r\n"') + 80 'echo "HTTP/1.1 404 Not Found"') IP=$(docker_ip "$CTR") # First sync