Skip to content

Commit

Permalink
run crucible-install.sh in verbose mode whenever possible in test-ins…
Browse files Browse the repository at this point in the history
…taller
  • Loading branch information
k-rister committed Sep 6, 2024
1 parent a7df983 commit d2db616
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions tests/test-installer
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ start_test
# non-root
ec=$(grep EC_FAIL_USER= crucible-install.sh | cut -d '=' -f2)
./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR}
--git-repo ${CRUCIBLE_DIR} \
--verbose
test "$?" = "$ec" || exit 1
stop_test

start_test
# no args
ec=$(grep EC_FAIL_REGISTRY_UNSET= crucible-install.sh | cut -d '=' -f2)
sudo ./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR}
--git-repo ${CRUCIBLE_DIR} \
--verbose
test "$?" = "$ec" || exit 1
stop_test

Expand All @@ -55,7 +57,8 @@ for arg_mode in client-server engine; do
sudo ./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR} \
--${arg_mode}-registry myregistry.io/crucible \
--${arg_mode}-auth-file /tmp/auth-file.json
--${arg_mode}-auth-file /tmp/auth-file.json \
--verbose
test "$?" = "$ec" || exit 1
stop_test
done
Expand All @@ -68,7 +71,8 @@ for arg_mode in client-server engine; do
sudo ./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR} \
--${arg_mode}-registry myregistry.io/crucible \
--${arg_mode}-tls-verify foo
--${arg_mode}-tls-verify foo \
--verbose
test "$?" = "$ec" || exit 1
stop_test
done
Expand All @@ -84,7 +88,8 @@ for arg_mode in client-server engine; do
sudo ./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR} \
--${arg_mode}-registry myregistry.io/crucible \
--${arg_mode}-auth-file /tmp/auth-file.json
--${arg_mode}-auth-file /tmp/auth-file.json \
--verbose
test "$?" = "0" || exit 1
grep "myregistry.io" $cfgfile || exit 1
grep "auth-file.json" $cfgfile || exit 1
Expand All @@ -108,7 +113,8 @@ for arg_mode in client-server engine; do
--${arg_mode}-registry myregistry.io/crucible \
--${arg_mode}-auth-file /tmp/auth-file.json \
--name "Nobody" \
--email "[email protected]"
--email "[email protected]" \
--verbose
sudo grep "CRUCIBLE_NAME=\"Nobody\"" $idfile || exit 1
sudo grep "CRUCIBLE_EMAIL=\"[email protected]\"" $idfile || exit 1
stop_test
Expand All @@ -125,7 +131,8 @@ for arg_mode in client-server engine; do
sudo ./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR} \
--${arg_mode}-registry myregistry.io/crucible \
--${arg_mode}-auth-file /tmp/auth-file.json
--${arg_mode}-auth-file /tmp/auth-file.json \
--verbose
test "$?" = "0" || exit 1
ls /opt/crucible-moved* || exit 1
stop_test
Expand All @@ -140,7 +147,8 @@ for arg_mode in client-server engine; do
sudo mkdir -p $(dirname $cfgfile)
sudo ./crucible-install.sh \
--git-repo ${CRUCIBLE_DIR} \
--${arg_mode}-registry myregistry.io/crucible
--${arg_mode}-registry myregistry.io/crucible \
--verbose
test "$?" = "0" || exit 1
ls /opt/crucible-moved* || exit 1
stop_test
Expand Down Expand Up @@ -168,15 +176,17 @@ start_test
## negative test: --release and --git-repo
ec=$(grep EC_RELEASE_DEFAULT_REPO_ONLY= crucible-install.sh | cut -d '=' -f2)
sudo ./crucible-install.sh \
--release DoesNotMatter --git-repo DoesNotMatter
--release DoesNotMatter --git-repo DoesNotMatter \
--verbose
test "$?" = "$ec" || exit 1
stop_test

start_test
## negative test: --release and --git-branch
ec=$(grep EC_RELEASE_CONFLICTS_WITH_BRANCH= crucible-install.sh | cut -d '=' -f2)
sudo ./crucible-install.sh \
--release DoesNotMatter --git-branch DoesNotMatter
--release DoesNotMatter --git-branch DoesNotMatter \
--verbose
test "$?" = "$ec" || exit 1
stop_test

Expand All @@ -190,6 +200,7 @@ grep "^DEFAULT_GIT_REPO" crucible-install.sh
ec=$(grep EC_FAIL_CHECKOUT= crucible-install.sh | cut -d '=' -f2)
sudo ./crucible-install.sh \
--release NonExitentTag \
--client-server-registry myregistry.io/crucible
--client-server-registry myregistry.io/crucible \
--verbose
test "$?" = "$ec" || exit 1
stop_test

0 comments on commit d2db616

Please sign in to comment.