You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
3.8 KiB
122 lines
3.8 KiB
name: "S3 Proxy Signature Tests"
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
concurrency:
|
|
group: ${{ github.head_ref || github.ref }}/s3-proxy-signature-tests
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
proxy-signature-tests:
|
|
name: S3 Proxy Signature Verification Tests
|
|
runs-on: ubuntu-22.04
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
id: go
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Build SeaweedFS binary for Linux
|
|
run: |
|
|
set -x
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs=false -v -o test/s3/proxy_signature/weed ./weed
|
|
|
|
- name: Run S3 Proxy Signature Tests
|
|
timeout-minutes: 10
|
|
working-directory: test/s3/proxy_signature
|
|
run: |
|
|
set -x
|
|
echo "Starting Docker Compose services..."
|
|
docker compose up -d --build
|
|
|
|
# Check if containers are running
|
|
echo "Checking container status..."
|
|
docker compose ps
|
|
|
|
# Wait for services to be ready
|
|
echo "Waiting for nginx proxy to be ready..."
|
|
PROXY_READY=0
|
|
for i in $(seq 1 30); do
|
|
if curl -s http://localhost:9000/ > /dev/null 2>&1; then
|
|
echo "Proxy is ready"
|
|
PROXY_READY=1
|
|
break
|
|
fi
|
|
echo "Waiting for proxy... ($i/30)"
|
|
sleep 1
|
|
done
|
|
if [ $PROXY_READY -eq 0 ]; then
|
|
echo "ERROR: Proxy failed to become ready after 30 seconds"
|
|
echo "Docker compose logs:"
|
|
docker compose logs --no-color || true
|
|
exit 1
|
|
fi
|
|
|
|
# Wait for SeaweedFS to be ready
|
|
echo "Waiting for SeaweedFS S3 gateway to be ready via proxy..."
|
|
S3_READY=0
|
|
for i in $(seq 1 30); do
|
|
# Check logs first for startup message (weed mini says "S3 service is ready")
|
|
if docker compose logs seaweedfs 2>&1 | grep -qE "S3 (gateway|service).*(started|ready)"; then
|
|
echo "SeaweedFS S3 gateway is ready"
|
|
S3_READY=1
|
|
break
|
|
fi
|
|
# Fallback: check headers via proxy (which is already ready)
|
|
if curl -s -I http://localhost:9000/ | grep -qi "SeaweedFS"; then
|
|
echo "SeaweedFS S3 gateway is responding via proxy"
|
|
S3_READY=1
|
|
break
|
|
fi
|
|
echo "Waiting for S3 gateway... ($i/30)"
|
|
sleep 1
|
|
done
|
|
if [ $S3_READY -eq 0 ]; then
|
|
echo "ERROR: SeaweedFS S3 gateway failed to become ready after 30 seconds"
|
|
echo "Latest seaweedfs logs:"
|
|
docker compose logs --no-color --tail 20 seaweedfs || true
|
|
exit 1
|
|
fi
|
|
|
|
# Run the test script inside AWS CLI container
|
|
echo "Running test script..."
|
|
docker run --rm --network host \
|
|
--entrypoint bash \
|
|
amazon/aws-cli:latest \
|
|
-c "$(cat test.sh)"
|
|
|
|
TEST_RESULT=$?
|
|
|
|
# Cleanup
|
|
docker compose down
|
|
|
|
exit $TEST_RESULT
|
|
|
|
- name: Cleanup on failure
|
|
if: failure()
|
|
working-directory: test/s3/proxy_signature
|
|
run: |
|
|
echo "Cleaning up Docker containers..."
|
|
ls -al weed || true
|
|
ldd weed || true
|
|
echo "Docker compose logs:"
|
|
docker compose logs --no-color || true
|
|
echo "Container status before cleanup:"
|
|
docker ps -a
|
|
echo "Stopping services..."
|
|
docker compose down || true
|