diff --git a/docker/auth-bench/run-ab.sh b/docker/auth-bench/run-ab.sh index 3e3a1d6..392cc83 100644 --- a/docker/auth-bench/run-ab.sh +++ b/docker/auth-bench/run-ab.sh @@ -2,7 +2,7 @@ function fetch_auth_cookie { local cms_type=${CMS_TYPE} - local cookie_file="/tmp/cookie.txt" + local cookie_file="/tmp/cookie.txt" # Ensure this path matches across all functions case $cms_type in "Concrete5") @@ -12,7 +12,6 @@ function fetch_auth_cookie { # Fetch and store the cookie for Concrete5, with verbose output for debugging curl -c "$cookie_file" -d "$login_data" -X POST "$login_url" -v > /tmp/curl_response_concrete5.txt 2>&1 - # Check if the cookie was successfully fetched if [ ! -s "$cookie_file" ]; then echo "Failed to fetch cookie for Concrete5. Check /tmp/curl_response_concrete5.txt for details." exit 1 @@ -20,18 +19,19 @@ function fetch_auth_cookie { ;; "WordPress") - # Placeholder for WordPress authentication, to be developed echo "WordPress authentication: To be developed" ;; *) echo "Unsupported CMS type: $cms_type" + exit 1 ;; esac } + function prepare_log_file { local log_file="/logs/authenticated.csv" > "$log_file" @@ -44,7 +44,7 @@ function run_apache_bench_and_check_ttfb { local requests=$REQUESTS local concurrency=$CONCURRENCY local log_file="/logs/authenticated.csv" - local cookie_file="/tmp/cookie" + local cookie_file="/tmp/cookie.txt" echo "URL,HTTP Code,Average TTFB (ms),AB Mean Time per Request (ms)" | tee "$log_file"