#!/bin/bash # 完整的最终测试脚本 echo "🎯 执行最终完整性测试..." echo "" base_url="https://airsltd-ocngx.hf.space" # 测试所有关键端点 test_endpoints=( "/global/health" "/path" "/pty" "/experimental" "/instance" "/vcs" "/session" "/project" "/provider" "/file" "/find" "/config" "/doc" ) echo "📡 测试所有API端点..." failed_count=0 for endpoint in "${test_endpoints[@]}"; do echo -n " $endpoint: " response=$(curl -s -w "%{http_code}" "${base_url}${endpoint}") http_code="${response: -3}" if [ "$http_code" = "200" ]; then echo "✅ 200 OK" elif [ "$http_code" = "404" ]; then echo "❌ 404 Not Found" ((failed_count++)) elif [ "$http_code" = "401" ]; then echo "❌ 401 Unauthorized" ((failed_count++)) else echo "❓ $http_code" ((failed_count++)) fi done echo "" echo "🌐 测试静态资源..." static_resources=( "/assets/index-OLRiU-d3.js" "/assets/index-DViKQ2Re.css" "/oc-theme-preload.js" "/site.webmanifest" "/favicon.ico" ) for resource in "${static_resources[@]}"; do echo -n " $resource: " response=$(curl -s -w "%{http_code}" "${base_url}${resource}") http_code="${response: -3}" if [ "$http_code" = "200" ]; then echo "✅ 200 OK" else echo "❌ $http_code" ((failed_count++)) fi done echo "" echo "🖥️ 测试主页面..." main_response=$(curl -s -w "%{http_code}" "${base_url}/opencode/") main_http_code="${main_response: -3}" if [ "$main_http_code" = "200" ]; then echo "✅ 主页面 200 OK" if echo "${main_response%???}" | grep -q "opencode\|OpenCode"; then echo "✅ 页面内容包含OpenCode" else echo "❌ 页面内容不包含OpenCode" ((failed_count++)) fi else echo "❌ 主页面 $main_http_code" ((failed_count++)) fi echo "" echo "🎉 测试结果总结..." if [ $failed_count -eq 0 ]; then echo "🎊 所有测试通过!移动端AI编程平台完全正常工作!" echo "" echo "📱 用户可以在手机上访问:" echo " https://airsltd-ocngx.hf.space/opencode/" echo "" echo "✨ 功能特性:" echo " • 完整的AI编程Web界面" echo " • 响应式移动端设计" echo " • 实时AI对话交互" echo " • 所有API端点正常工作" echo " • 静态资源正确加载" else echo "❌ 发现 $failed_count 个问题,需要进一步修复" fi echo "" echo "🎯 测试完成!"