.
This commit is contained in:
@@ -5,21 +5,32 @@
|
||||
|
||||
set -e
|
||||
|
||||
# Load environment settings for dynamic container naming
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
ENV_FILE="${SCRIPT_DIR}/TSYSDevStack-SupportStack-Demo-Settings"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "Error: Environment settings file not found at $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source "$ENV_FILE"
|
||||
|
||||
echo "Testing homepage host validation issue..."
|
||||
|
||||
# Check if homepage container is running
|
||||
if ! docker ps | grep -q "tsysdevstack-homepage"; then
|
||||
if ! docker ps | grep -q "$HOMEPAGE_NAME"; then
|
||||
echo "❌ Homepage container is not running"
|
||||
echo "Test failed: Homepage host validation test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test if we get the host validation error by checking the HTTP response
|
||||
response=$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:4000/ 2>/dev/null || echo "ERROR")
|
||||
response=$(curl -s -o /dev/null -w "%{http_code}" "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}/" 2>/dev/null || echo "ERROR")
|
||||
|
||||
if [ "$response" = "ERROR" ] || [ "$response" != "200" ]; then
|
||||
# Let's also check the page content to see if it contains the host validation error message
|
||||
content=$(curl -s http://127.0.0.1:4000/ 2>/dev/null || echo "")
|
||||
content=$(curl -s "http://${BIND_ADDRESS}:${HOMEPAGE_PORT}/" 2>/dev/null || echo "")
|
||||
if [[ "$content" == *"Host validation failed"* ]]; then
|
||||
echo "❌ Homepage is showing 'Host validation failed' error"
|
||||
echo "Test confirmed: Host validation issue exists"
|
||||
@@ -33,4 +44,4 @@ else
|
||||
echo "✅ Homepage is accessible and host validation is working"
|
||||
echo "Test passed: No host validation issue"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user