Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rister committed Nov 4, 2024
1 parent 0b73f1f commit 852c583
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crucible-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ EC_PULL_FAIL=16
EC_RELEASE_DEFAULT_REPO_ONLY=18
EC_RELEASE_CONFLICTS_WITH_BRANCH=19
EC_INVALID_QUAY_EXPIRATION_LENGTH=20
EC_OAUTH_FILE_NOT_FOUND=21

# remove a previous installation log
if [ -e ${GIT_INSTALL_LOG} ]; then
Expand Down Expand Up @@ -504,6 +505,12 @@ if [ -n "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_LENGTH}" ]; then
fi
fi

if [ -n "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN}" ]; then
if [ ! -f "${CRUCIBLE_ENGINE_QUAY_EXPIRATION_REFRESH_TOKEN}" ]; then
exit_error "Crucible Quay engine refresh token file not found. See --quay-engine-expiration-refresh-token for details." $EC_OAUTH_FILE_NOT_FOUND
fi
fi

if [ ! -z ${CRUCIBLE_ENGINE_AUTH_FILE+x} ]; then
if [ ! -f $CRUCIBLE_ENGINE_AUTH_FILE ]; then
exit_error "Crucible authentication file not found. See --engine-auth-file for details." $EC_AUTH_FILE_NOT_FOUND
Expand Down
13 changes: 13 additions & 0 deletions tests/test-installer
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ for arg_mode in client-server engine; do
stop_test
done

start_test
# oauth file not found
ec=$(grep EC_OAUTH_FILE_NOT_FOUND= crucible-install.sh | cut -d '=' -f2)
sudo ./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR} \
--engine-registry myregistry.io/crucible \
--engine-auth-file /tmp/auth-file.json \
--quay-engine-expiration-refresh-token /tmp/oauth-file.json \
--quay-engine-expiration-refresh-api-url myregistry.io/crucible/api/url \
--verbose
test "$?" = "$ec" || exit 1
stop_test

for arg_mode in client-server engine; do
start_test
echo "testing arg_mode=${arg_mode}"
Expand Down

0 comments on commit 852c583

Please sign in to comment.