test: Update 2 files
This commit is contained in:
12
test.sh
12
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
|
||||
|
||||
|
Reference in New Issue
Block a user