1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
# Docker Compose for SeaweedFS S3 IAM Integration Tests
services:
# SeaweedFS Master
seaweedfs-master:
image: chrislusf/seaweedfs:latest
container_name: seaweedfs-master-test
command: master -mdir=/data -defaultReplication=000 -port=9333
ports:
- "9333:9333"
volumes:
- master-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9333/cluster/status"]
interval: 10s
timeout: 5s
retries: 5
networks:
- seaweedfs-test
# SeaweedFS Volume
seaweedfs-volume:
image: chrislusf/seaweedfs:latest
container_name: seaweedfs-volume-test
command: volume -dir=/data -port=8083 -mserver=seaweedfs-master:9333
ports:
- "8083:8083"
volumes:
- volume-data:/data
depends_on:
seaweedfs-master:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8083/status"]
interval: 10s
timeout: 5s
retries: 5
networks:
- seaweedfs-test
# SeaweedFS Filer
seaweedfs-filer:
image: chrislusf/seaweedfs:latest
container_name: seaweedfs-filer-test
command: filer -port=8888 -master=seaweedfs-master:9333 -defaultStoreDir=/data
ports:
- "8888:8888"
volumes:
- filer-data:/data
depends_on:
seaweedfs-master:
condition: service_healthy
seaweedfs-volume:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8888/status"]
interval: 10s
timeout: 5s
retries: 5
networks:
- seaweedfs-test
# SeaweedFS S3 API
seaweedfs-s3:
image: chrislusf/seaweedfs:latest
container_name: seaweedfs-s3-test
command: s3 -port=8333 -filer=seaweedfs-filer:8888 -config=/config/test_config.json
ports:
- "8333:8333"
volumes:
- ./test_config.json:/config/test_config.json:ro
depends_on:
seaweedfs-filer:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8333/"]
interval: 10s
timeout: 5s
retries: 5
networks:
- seaweedfs-test
# Test Runner
integration-tests:
build:
context: ../../../
dockerfile: test/s3/iam/Dockerfile.s3
container_name: seaweedfs-s3-iam-tests
environment:
- WEED_BINARY=weed
- S3_PORT=8333
- FILER_PORT=8888
- MASTER_PORT=9333
- VOLUME_PORT=8083
- TEST_TIMEOUT=30m
- LOG_LEVEL=2
depends_on:
seaweedfs-s3:
condition: service_healthy
volumes:
- .:/app/test/s3/iam
- test-results:/app/test-results
networks:
- seaweedfs-test
command: ["make", "test"]
# Optional: Mock LDAP Server for LDAP testing
ldap-server:
image: osixia/openldap:1.5.0
container_name: ldap-server-test
environment:
LDAP_ORGANISATION: "Example Corp"
LDAP_DOMAIN: "example.com"
LDAP_ADMIN_PASSWORD: "admin-password"
LDAP_CONFIG_PASSWORD: "config-password"
LDAP_READONLY_USER: "true"
LDAP_READONLY_USER_USERNAME: "readonly"
LDAP_READONLY_USER_PASSWORD: "readonly-password"
ports:
- "389:389"
- "636:636"
volumes:
- ldap-data:/var/lib/ldap
- ldap-config:/etc/ldap/slapd.d
networks:
- seaweedfs-test
# Optional: LDAP Admin UI
ldap-admin:
image: osixia/phpldapadmin:latest
container_name: ldap-admin-test
environment:
PHPLDAPADMIN_LDAP_HOSTS: "ldap-server"
PHPLDAPADMIN_HTTPS: "false"
ports:
- "8080:80"
depends_on:
- ldap-server
networks:
- seaweedfs-test
volumes:
master-data:
driver: local
volume-data:
driver: local
filer-data:
driver: local
ldap-data:
driver: local
ldap-config:
driver: local
test-results:
driver: local
networks:
seaweedfs-test:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
|