@@ -102,7 +102,8 @@ jobs:
102102 push : true
103103 tags : ${{ steps.meta.outputs.tags }}
104104 labels : ${{ steps.meta.outputs.labels }}
105- - name : Docker test
105+
106+ - name : Docker test with a dedicated OpenDJ container
106107 shell : bash
107108 run : |
108109 docker network create test-openam
@@ -154,6 +155,58 @@ jobs:
154155
155156 docker inspect --format="{{json .State.Health.Status}}" test-openam | grep -q \"healthy\"
156157
158+ echo "Stopping containers and removing the network"
159+ docker stop test-opendj test-openam
160+ docker network rm test-openam
161+
162+ - name : Docker multi-server test
163+ shell : bash
164+ run : |
165+
166+ docker network create test-openam
167+
168+ echo "Starting OpenAM-1 container"
169+ docker run --rm -it -h openam1.example.org --name=test-openam1 --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}
170+
171+ echo "Waiting for OpenAM-1 to be alive..."
172+ timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam1 | grep -q \"healthy\"; do sleep 10; done'
173+
174+ docker exec -w '/usr/openam/ssoconfiguratortools' test-openam1 bash -c \
175+ 'echo "ACCEPT_LICENSES=true
176+ SERVER_URL=http://openam1.example.org:8080
177+ DEPLOYMENT_URI=/$OPENAM_PATH
178+ BASE_DIR=$OPENAM_DATA_DIR
179+ locale=en_US
180+ PLATFORM_LOCALE=en_US
181+ AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
182+ ADMIN_PWD=ampassword
183+ AMLDAPUSERPASSWD=password
184+ COOKIE_DOMAIN=example.org
185+ ACCEPT_LICENSES=true
186+ DATA_STORE=embedded
187+ DIRECTORY_SSL=SIMPLE
188+ DIRECTORY_SERVER=openam1.example.org
189+ DIRECTORY_PORT=50389
190+ DIRECTORY_ADMIN_PORT=4444
191+ DIRECTORY_JMX_PORT=1689
192+ ROOT_SUFFIX=dc=openam,dc=example,dc=org
193+ DS_DIRMGRDN=cn=Directory Manager
194+ DS_DIRMGRPASSWD=password
195+ LB_SITE_NAME=lb
196+ LB_PRIMARY_URL=http://lb.example.org:80/openam
197+ " > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'
198+
199+ docker exec test-openam bash -c \
200+ 'curl \
201+ --request POST \
202+ --header "Content-Type: application/json" \
203+ --header "X-OpenAM-Username: amadmin" \
204+ --header "X-OpenAM-Password: ampassword" \
205+ --data "{}" \
206+ http://openam1.example.org:8080/openam/json/authenticate | grep tokenId'
207+
208+ docker inspect --format="{{json .State.Health.Status}}" test-openam1 | grep -q \"healthy\"
209+
157210 echo "Add another two OpenAM servers to the cluster"
158211
159212 echo "Starting OpenAM-2 container..."
@@ -169,7 +222,7 @@ jobs:
169222 BASE_DIR=$OPENAM_DATA_DIR
170223 locale=en_US
171224 PLATFORM_LOCALE=en_US
172- AM_ENC_KEY=
225+ AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
173226 ADMIN_PWD=ampassword
174227 AMLDAPUSERPASSWD=password
175228 COOKIE_DOMAIN=example.org
@@ -183,7 +236,12 @@ jobs:
183236 ROOT_SUFFIX=dc=openam,dc=example,dc=org
184237 DS_DIRMGRDN=cn=Directory Manager
185238 DS_DIRMGRPASSWD=password
186- existingserverid=http://openam.example.org:8080
239+ DS_EMB_REPL_FLAG=embReplFlag
240+ DS_EMB_REPL_REPLPORT1=8989
241+ DS_EMB_REPL_HOST2=openam1.example.com
242+ DS_EMB_REPL_ADMINPORT2=4444
243+ DS_EMB_REPL_REPLPORT2=8989
244+ existingserverid=http://openam1.example.org:8080
187245 LB_SITE_NAME=lb
188246 LB_PRIMARY_URL=http://lb.example.org:80/openam
189247 " > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'
@@ -205,14 +263,14 @@ jobs:
205263 echo "waiting for OpenAM-3 to be alive..."
206264 timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam3 | grep -q \"healthy\"; do sleep 10; done'
207265
208- docker exec -w '/usr/openam/ssoconfiguratortools' test-openam3 bash -c \
266+ docker exec -w '/usr/openam/ssoconfiguratortools' test-openam2 bash -c \
209267 ' echo "ACCEPT_LICENSES=true
210268 SERVER_URL=http://openam3.example.org:8080
211269 DEPLOYMENT_URI=/$OPENAM_PATH
212270 BASE_DIR=$OPENAM_DATA_DIR
213271 locale=en_US
214272 PLATFORM_LOCALE=en_US
215- AM_ENC_KEY=
273+ AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
216274 ADMIN_PWD=ampassword
217275 AMLDAPUSERPASSWD=password
218276 COOKIE_DOMAIN=example.org
@@ -226,6 +284,11 @@ jobs:
226284 ROOT_SUFFIX=dc=openam,dc=example,dc=org
227285 DS_DIRMGRDN=cn=Directory Manager
228286 DS_DIRMGRPASSWD=password
287+ DS_EMB_REPL_FLAG=embReplFlag
288+ DS_EMB_REPL_REPLPORT1=8989
289+ DS_EMB_REPL_HOST2=openam2.example.com
290+ DS_EMB_REPL_ADMINPORT2=4444
291+ DS_EMB_REPL_REPLPORT2=8989
229292 existingserverid=http://openam2.example.org:8080
230293 LB_SITE_NAME=lb
231294 LB_PRIMARY_URL=http://lb.example.org:80/openam
0 commit comments