diff --git a/crucible-install.sh b/crucible-install.sh index 6ddd9af..e72b40d 100755 --- a/crucible-install.sh +++ b/crucible-install.sh @@ -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 @@ -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 diff --git a/tests/test-installer b/tests/test-installer index 767d6df..ac05f88 100755 --- a/tests/test-installer +++ b/tests/test-installer @@ -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}"