e2e: Reformat ncsvr scripts for readability

This commit is contained in:
Tim Hockin 2022-06-14 11:54:45 -07:00
parent a4b3b3ff08
commit 5b7df08826
1 changed files with 18 additions and 8 deletions

View File

@ -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