Skip to content

Commit

Permalink
Add basic auth to test
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackthornYugen committed Jan 13, 2024
1 parent 624e5af commit 9feec4a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/tests/mongo-express-run/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ fi
# Create an instance of the container-under-test
mongoCid="$(docker run -d "$mongoImage")"
trap "docker rm -vf $mongoCid > /dev/null" EXIT
cid="$(docker run -d --link "$mongoCid":mongo "$serverImage")"
cid="$(docker run \
--detach \
--link "$mongoCid":mongo \
--env ME_CONFIG_BASICAUTH_USERNAME="test-user" \
--env ME_CONFIG_BASICAUTH_PASSWORD="test-password" \
"$serverImage"
)"
trap "docker rm -vf $cid $mongoCid > /dev/null" EXIT

_request() {
Expand All @@ -35,7 +41,7 @@ _request() {
}

# make sure that mongo-express is listening and ready
. "$dir/../../retry.sh" '_request GET / --output /dev/null'
. "$dir/../../retry.sh" '_request GET / --output /dev/null --user test-user:test-password'

# if we evetually got a "200 OK" response from mongo-express, it should be ~working fine!
# (since it fails to even start if it can't connect to MongoDB, etc)

0 comments on commit 9feec4a

Please sign in to comment.