Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 152 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Docker test

- name: Docker test with a dedicated OpenDJ container
shell: bash
run: |
docker network create test-openam
Expand Down Expand Up @@ -153,3 +154,153 @@ jobs:
http://openam.example.org:8080/openam/json/authenticate | grep tokenId'

docker inspect --format="{{json .State.Health.Status}}" test-openam | grep -q \"healthy\"

echo "Stopping containers and removing the network"
docker stop test-opendj test-openam
docker network rm test-openam

- name: Docker multi-server test
shell: bash
run: |

docker network create test-openam

echo "Starting OpenAM-1 container"
docker run --rm -it -d -h openam1.example.org --name=test-openam1 --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}

echo "Waiting for OpenAM-1 to be alive..."
timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam1 | grep -q \"healthy\"; do sleep 10; done'

docker exec -w '/usr/openam/ssoconfiguratortools' test-openam1 bash -c \
'echo "ACCEPT_LICENSES=true
SERVER_URL=http://openam1.example.org:8080
DEPLOYMENT_URI=/$OPENAM_PATH
BASE_DIR=$OPENAM_DATA_DIR
locale=en_US
PLATFORM_LOCALE=en_US
AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
ADMIN_PWD=ampassword
AMLDAPUSERPASSWD=password
COOKIE_DOMAIN=example.org
ACCEPT_LICENSES=true
DATA_STORE=embedded
DIRECTORY_SSL=SIMPLE
DIRECTORY_SERVER=openam1.example.org
DIRECTORY_PORT=50389
DIRECTORY_ADMIN_PORT=4444
DIRECTORY_JMX_PORT=1689
ROOT_SUFFIX=dc=openam,dc=example,dc=org
DS_DIRMGRDN=cn=Directory Manager
DS_DIRMGRPASSWD=password
LB_SITE_NAME=lb
LB_PRIMARY_URL=http://lb.example.org:80/openam
" > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'

docker exec test-openam1 bash -c \
'curl \
--request POST \
--header "Content-Type: application/json" \
--header "X-OpenAM-Username: amadmin" \
--header "X-OpenAM-Password: ampassword" \
--data "{}" \
http://openam1.example.org:8080/openam/json/authenticate | grep tokenId'

docker inspect --format="{{json .State.Health.Status}}" test-openam1 | grep -q \"healthy\"

echo "Add another two OpenAM servers to the cluster"

echo "Starting OpenAM-2 container..."
docker run --rm -it -d -h openam2.example.org --name=test-openam2 --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}

echo "waiting for OpenAM-2 to be alive..."
timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam2 | grep -q \"healthy\"; do sleep 10; done'

docker exec -w '/usr/openam/ssoconfiguratortools' test-openam2 bash -c \
'echo "ACCEPT_LICENSES=true
SERVER_URL=http://openam2.example.org:8080
DEPLOYMENT_URI=/$OPENAM_PATH
BASE_DIR=$OPENAM_DATA_DIR
locale=en_US
PLATFORM_LOCALE=en_US
AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
ADMIN_PWD=ampassword
AMLDAPUSERPASSWD=password
COOKIE_DOMAIN=example.org
ACCEPT_LICENSES=true
DATA_STORE=embedded
DIRECTORY_SSL=SIMPLE
DIRECTORY_SERVER=openam2.example.org
DIRECTORY_PORT=50389
DIRECTORY_ADMIN_PORT=4444
DIRECTORY_JMX_PORT=1689
ROOT_SUFFIX=dc=openam,dc=example,dc=org
DS_DIRMGRDN=cn=Directory Manager
DS_DIRMGRPASSWD=password
DS_EMB_REPL_FLAG=embReplFlag
DS_EMB_REPL_REPLPORT1=8989
DS_EMB_REPL_HOST2=openam1.example.com
DS_EMB_REPL_ADMINPORT2=4444
DS_EMB_REPL_REPLPORT2=8989
existingserverid=http://openam1.example.org:8080
LB_SITE_NAME=lb
LB_PRIMARY_URL=http://lb.example.org:80/openam
" > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'

docker exec test-openam2 bash -c \
'curl \
--request POST \
--header "Content-Type: application/json" \
--header "X-OpenAM-Username: amadmin" \
--header "X-OpenAM-Password: ampassword" \
--data "{}" \
http://openam2.example.org:8080/openam/json/authenticate | grep tokenId'

docker inspect --format="{{json .State.Health.Status}}" test-openam2 | grep -q \"healthy\"

echo "Starting OpenAM-3 container..."
docker run --rm -it -d -h openam3.example.org --name=test-openam3 --network test-openam localhost:5000/${GITHUB_REPOSITORY,,}:${{ env.release_version }}

echo "waiting for OpenAM-3 to be alive..."
timeout 3m bash -c 'until docker inspect --format="{{json .State.Health.Status}}" test-openam3 | grep -q \"healthy\"; do sleep 10; done'

docker exec -w '/usr/openam/ssoconfiguratortools' test-openam2 bash -c \
'echo "ACCEPT_LICENSES=true
SERVER_URL=http://openam3.example.org:8080
DEPLOYMENT_URI=/$OPENAM_PATH
BASE_DIR=$OPENAM_DATA_DIR
locale=en_US
PLATFORM_LOCALE=en_US
AM_ENC_KEY=O6QWwHPO4os+zEz3Nqn/2daAYWyiFE32
ADMIN_PWD=ampassword
AMLDAPUSERPASSWD=password
COOKIE_DOMAIN=example.org
ACCEPT_LICENSES=true
DATA_STORE=embedded
DIRECTORY_SSL=SIMPLE
DIRECTORY_SERVER=openam3.example.org
DIRECTORY_PORT=50389
DIRECTORY_ADMIN_PORT=4444
DIRECTORY_JMX_PORT=1689
ROOT_SUFFIX=dc=openam,dc=example,dc=org
DS_DIRMGRDN=cn=Directory Manager
DS_DIRMGRPASSWD=password
DS_EMB_REPL_FLAG=embReplFlag
DS_EMB_REPL_REPLPORT1=8989
DS_EMB_REPL_HOST2=openam2.example.com
DS_EMB_REPL_ADMINPORT2=4444
DS_EMB_REPL_REPLPORT2=9989
existingserverid=http://openam2.example.org:8080
LB_SITE_NAME=lb
LB_PRIMARY_URL=http://lb.example.org:80/openam
" > conf.file && java -jar openam-configurator-tool*.jar --file conf.file'

docker exec test-openam3 bash -c \
'curl \
--request POST \
--header "Content-Type: application/json" \
--header "X-OpenAM-Username: amadmin" \
--header "X-OpenAM-Password: ampassword" \
--data "{}" \
http://openam3.example.org:8080/openam/json/authenticate | grep tokenId'

docker inspect --format="{{json .State.Health.Status}}" test-openam3 | grep -q \"healthy\"
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<maven.compiler.source>11</maven.compiler.source>
<!-- Supress checkstyle errors on legacy com.iplanet and com.sun.identity packages -->
<checkstyleUnitTestSuppressionsLocation>checkstyle/suppressions.xml</checkstyleUnitTestSuppressionsLocation>
<opendj.version>5.0.2</opendj.version>
<opendj.version>5.0.3-SNAPSHOT</opendj.version>
<javadoc-utils.version>1.0.0</javadoc-utils.version>
<ant.contrib.version>1.0b3</ant.contrib.version>
<guice.version>7.0.0</guice.version>
Expand Down