test: Update 2 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 22s
Build-Test-Publish / build (linux/arm64) (push) Successful in 23s

This commit is contained in:
Your Name
2025-08-24 15:50:19 +12:00
parent 9e3234b4bc
commit 89da030821
2 changed files with 21 additions and 3 deletions

12
sos
View File

@@ -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"

12
test.sh
View File

@@ -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