Browse Source

fix tests

pull/7160/head
chrislu 1 month ago
parent
commit
09f3d67fbf
  1. 8
      .github/workflows/s3-iam-tests.yml
  2. 4
      test/s3/iam/s3_iam_integration_test.go
  3. 3
      test/s3/iam/setup_all_tests.sh

8
.github/workflows/s3-iam-tests.yml

@ -304,11 +304,15 @@ jobs:
exit 1 exit 1
} }
curl -f http://localhost:8333 || {
# For IAM-enabled S3 API, we expect a 403 response when accessing without auth
# This indicates the server is running and IAM is working correctly
if curl -s http://localhost:8333 > /dev/null 2>&1; then
echo "✅ SeaweedFS S3 API is responding (IAM-protected endpoint)"
else
echo "❌ SeaweedFS S3 API not accessible" echo "❌ SeaweedFS S3 API not accessible"
cat weed-s3.log || true cat weed-s3.log || true
exit 1 exit 1
}
fi
# Run Keycloak-specific tests # Run Keycloak-specific tests
echo "=== Running Keycloak Tests ===" echo "=== Running Keycloak Tests ==="

4
test/s3/iam/s3_iam_integration_test.go

@ -22,6 +22,10 @@ const (
testObjectData = "Hello, SeaweedFS IAM Integration!" testObjectData = "Hello, SeaweedFS IAM Integration!"
) )
var (
testBucket = testBucketPrefix
)
// TestS3IAMAuthentication tests S3 API authentication with IAM JWT tokens // TestS3IAMAuthentication tests S3 API authentication with IAM JWT tokens
func TestS3IAMAuthentication(t *testing.T) { func TestS3IAMAuthentication(t *testing.T) {
framework := NewS3IAMTestFramework(t) framework := NewS3IAMTestFramework(t)

3
test/s3/iam/setup_all_tests.sh

@ -602,7 +602,8 @@ main() {
echo -e "\n${BLUE}🔍 Environment Status:${NC}" echo -e "\n${BLUE}🔍 Environment Status:${NC}"
echo -e " Keycloak: $(curl -s http://localhost:8080/health/ready > /dev/null 2>&1 && echo -e "${GREEN}✅ Running${NC}" || echo -e "${RED}❌ Not running${NC}")" echo -e " Keycloak: $(curl -s http://localhost:8080/health/ready > /dev/null 2>&1 && echo -e "${GREEN}✅ Running${NC}" || echo -e "${RED}❌ Not running${NC}")"
echo -e " S3 API: $(curl -s http://localhost:8333 > /dev/null 2>&1 && echo -e "${GREEN}✅ Running${NC}" || echo -e "${RED}❌ Not running${NC}")"
# For IAM-enabled S3 API, any response (including 403) indicates the service is running
echo -e " S3 API: $(curl -s http://localhost:8333 > /dev/null 2>&1 && echo -e "${GREEN}✅ Running (IAM-protected)${NC}" || echo -e "${RED}❌ Not running${NC}")"
if ! curl -s http://localhost:8333 > /dev/null 2>&1; then if ! curl -s http://localhost:8333 > /dev/null 2>&1; then
echo -e "\n${YELLOW}💡 To start SeaweedFS services:${NC}" echo -e "\n${YELLOW}💡 To start SeaweedFS services:${NC}"

Loading…
Cancel
Save