From 89da030821e0857060431bd9713a1e506c9383ad Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 24 Aug 2025 15:50:19 +1200 Subject: [PATCH] test: Update 2 files --- sos | 12 +++++++++++- test.sh | 12 ++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sos b/sos index c9f5b63..affad82 100755 --- a/sos +++ b/sos @@ -28,7 +28,17 @@ function get_getpkg() { fi if [ ! -f "${GETPKG}" ]; then ARCH=$(uname -m) - curl -L -s -o "${TEMP_DIR}/getpkg" "https://getbin.xyz/getpkg:latest-${ARCH}" || die "Failed to download getpkg" + # Normalize architecture names (aarch64 -> arm64 for some systems) + if [ "$ARCH" = "aarch64" ]; then + # Try aarch64 first, fall back to arm64 if it fails + curl -L -s -o "${TEMP_DIR}/getpkg" "https://getbin.xyz/getpkg:latest-${ARCH}" 2>/dev/null + if [ ! -f "${TEMP_DIR}/getpkg" ] || [ ! -s "${TEMP_DIR}/getpkg" ]; then + ARCH="arm64" + curl -L -s -o "${TEMP_DIR}/getpkg" "https://getbin.xyz/getpkg:latest-${ARCH}" || die "Failed to download getpkg for ARM64" + fi + else + curl -L -s -o "${TEMP_DIR}/getpkg" "https://getbin.xyz/getpkg:latest-${ARCH}" || die "Failed to download getpkg" + fi chmod +x "${TEMP_DIR}/getpkg" GETPKG="${TEMP_DIR}/getpkg" [ -f "${GETPKG}" ] || die "Failed to download getpkg" diff --git a/test.sh b/test.sh index 86cd984..4d5fc81 100755 --- a/test.sh +++ b/test.sh @@ -93,7 +93,8 @@ start_test_server() { docker exec "${CONTAINER_NAME}" mkdir -p /data/storage 2>/dev/null || true docker restart "${CONTAINER_NAME}" &>/dev/null || die "Failed to restart container" - sleep 3 # Wait for restart + # ARM64 systems may need more time to restart + sleep 5 # Wait for restart # Update port if changed after restart local new_port=$(docker port "${CONTAINER_NAME}" 80 | cut -d: -f2) @@ -165,11 +166,16 @@ test_upload() { log_info "Testing upload: ${file##*/} with label ${label}" - if run_sos_upload "$file" "$label" "$@" 2>&1 | tee "${TEST_DIR}/upload_output.txt" | grep -q "Download URL:"; then + local output=$(run_sos_upload "$file" "$label" "$@" 2>&1 | tee "${TEST_DIR}/upload_output.txt") + + if echo "$output" | grep -q "Download URL:"; then log_info "Upload successful" return 0 else log_error "Upload failed" + # Show error details for debugging ARM64 issues + echo "Error output:" >&2 + echo "$output" | grep -E "(FATAL:|ERROR:|Failed|curl)" | head -5 >&2 return 1 fi } @@ -297,6 +303,8 @@ run_tests() { for test in "${tests[@]}"; do eval "$test" && ((passed++)) || true echo "" + # Small delay between tests for ARM64 stability + sleep 0.5 done set -e