Add --443 flag to smoke test for HTTPS on port 443
- Better argument parsing for IP, --https, --443, --port=N - Port 443 omits port from URL for cleaner output - Ignore unknown flags instead of treating as IP 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,8 +3,11 @@
|
|||||||
# Stegasoo Pi Image Smoke Test
|
# Stegasoo Pi Image Smoke Test
|
||||||
# Automated testing of a fresh Pi image
|
# Automated testing of a fresh Pi image
|
||||||
#
|
#
|
||||||
# Usage: ./smoke-test.sh [ip] [--https]
|
# Usage: ./smoke-test.sh [ip] [--https] [--443] [--port=PORT]
|
||||||
# Default IP: 192.168.0.4
|
# Default IP: 192.168.0.4
|
||||||
|
# --https Use HTTPS (port 5000)
|
||||||
|
# --443 Use HTTPS on port 443
|
||||||
|
# --port=N Specify custom port
|
||||||
#
|
#
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -17,20 +20,35 @@ BOLD='\033[1m'
|
|||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
PI_IP="${1:-192.168.0.4}"
|
PI_IP="192.168.0.4"
|
||||||
HTTPS=false
|
HTTPS=false
|
||||||
if [[ "$2" == "--https" ]] || [[ "$1" == "--https" ]]; then
|
PORT=5000
|
||||||
HTTPS=true
|
|
||||||
if [[ "$1" == "--https" ]]; then
|
# Parse arguments
|
||||||
PI_IP="192.168.0.4"
|
for arg in "$@"; do
|
||||||
|
case $arg in
|
||||||
|
--https) HTTPS=true ;;
|
||||||
|
--443) HTTPS=true; PORT=443 ;;
|
||||||
|
--port=*) PORT="${arg#*=}" ;;
|
||||||
|
--*) ;; # Ignore other flags
|
||||||
|
*)
|
||||||
|
# If it looks like an IP, use it
|
||||||
|
if [[ "$arg" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
PI_IP="$arg"
|
||||||
fi
|
fi
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
if [ "$HTTPS" = true ]; then
|
if [ "$HTTPS" = true ]; then
|
||||||
BASE_URL="https://$PI_IP:5000"
|
if [ "$PORT" = "443" ]; then
|
||||||
|
BASE_URL="https://$PI_IP"
|
||||||
|
else
|
||||||
|
BASE_URL="https://$PI_IP:$PORT"
|
||||||
|
fi
|
||||||
CURL_OPTS="-k" # Allow self-signed certs
|
CURL_OPTS="-k" # Allow self-signed certs
|
||||||
else
|
else
|
||||||
BASE_URL="http://$PI_IP:5000"
|
BASE_URL="http://$PI_IP:$PORT"
|
||||||
CURL_OPTS=""
|
CURL_OPTS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user