Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,26 @@ else
exit 1
fi

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Call the gateway with the subscription key, waiting as long as the gateway asks when it answers 429 (the API allows
# ten calls a minute per subscription)
# $1: the URL
call_api() {
local url=$1
local headers_file
headers_file=$(mktemp)
STATUS_CODE=$(curl --max-time 30 --silent --output /dev/null --dump-header "$headers_file" --write-out "%{http_code}" \
STATUS_CODE=$(curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--dump-header "$(native_path "$headers_file")" \
--header "Ocp-Apim-Subscription-Key: $KEY" "$url")
if [[ $STATUS_CODE == 429 ]]; then
RETRY_AFTER=$(grep -i "^retry-after:" "$headers_file" | tr -d '\r' | awk '{print $2}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -218,12 +229,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -218,12 +229,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ for CALL in $(seq 1 "$WEB_APP_CALLS"); do
echo "Call $CALL of $WEB_APP_CALLS to the [$WEB_APP_NAME] web app answered with status code [$STATUS_CODE]"
done

# On Windows, Git Bash and MSYS2 shells pass a path such as /tmp/... unconverted to Windows programs
# (az, curl, jq, python, docker) when MSYS_NO_PATHCONV=1 is set, as the README asks. cygpath, which
# those shells provide, returns the C:/... form those programs can open; elsewhere the path is unchanged.
native_path() {
if command -v cygpath >/dev/null 2>&1; then
cygpath -m "$1"
else
echo "$1"
fi
}

# Post an activity with the web app's form and print the status code of the answer: the app redirects to its page
# (302) once it stored the activity. The form of the .NET app carries an antiforgery token, without which ASP.NET Core
# refuses the post: the function reads the form first and sends the token back with the cookie that came with it. The
Expand All @@ -219,12 +230,12 @@ done
post_activity() {
local cookie_jar form_token
cookie_jar=$(mktemp)
form_token=$(curl --max-time 30 --silent --cookie-jar "$cookie_jar" "https://$WEB_APP_HOST_NAME/" |
form_token=$(curl --max-time 30 --silent --cookie-jar "$(native_path "$cookie_jar")" "https://$WEB_APP_HOST_NAME/" |
grep -o 'name="__RequestVerificationToken"[^>]*value="[^"]*"' |
head -n 1 |
sed 's/.*value="//; s/"$//')
curl --max-time 30 --silent --output /dev/null --write-out "%{http_code}" \
--cookie "$cookie_jar" \
--cookie "$(native_path "$cookie_jar")" \
--data-urlencode "activity=$1" \
--data-urlencode "__RequestVerificationToken=$form_token" \
"https://$WEB_APP_HOST_NAME/"
Expand Down
Loading