-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
squash: A couple of indentation adjustments
- Loading branch information
Showing
1 changed file
with
40 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,52 @@ | ||
#!/bin/bash | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
rlJournalStart | ||
|
||
PROVISION_METHODS=${PROVISION_METHODS:-container virtual} | ||
|
||
rlJournalStart | ||
|
||
rlPhaseStartSetup | ||
rlRun "pushd data" | ||
if [[ "$PROVISION_METHODS" =~ "container" ]]; then | ||
# Try several times to build the container | ||
# https:/teemtee/tmt/issues/2063 | ||
build="podman build -t become-container-test:latest ." | ||
rlRun "rlWaitForCmd '$build' -m 5 -d 5" || rlDie "Unable to prepare the image" | ||
fi | ||
rlPhaseEnd | ||
|
||
for method in ${PROVISION_METHODS}; do | ||
|
||
if [ "$method" = "container" ] || [ "$method" = "virtual" ]; then | ||
|
||
rlPhaseStartTest "$method, test with become=true" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /test/root" | ||
rlPhaseEnd | ||
if [[ "$PROVISION_METHODS" =~ "container" ]]; then | ||
# Try several times to build the container | ||
# https:/teemtee/tmt/issues/2063 | ||
build="podman build -t become-container-test:latest ." | ||
rlRun "rlWaitForCmd '$build' -m 5 -d 5" || rlDie "Unable to prepare the image" | ||
fi | ||
rlPhaseEnd | ||
|
||
for method in ${PROVISION_METHODS}; do | ||
if [ "$method" = "container" ] || [ "$method" = "virtual" ]; then | ||
rlPhaseStartTest "$method, test with become=true" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /test/root" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, test with become=false" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /test/user" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish inline with become=true" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/root/inline" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish inline with become=false" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/user/inline" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish scripts with become=true" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/root/scripts" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish scripts with become=false" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/user/scripts" | ||
rlPhaseEnd | ||
fi | ||
done | ||
|
||
rlPhaseStartTest "$method, test with become=false" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /test/user" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish inline with become=true" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/root/inline" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish inline with become=false" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/user/inline" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish scripts with become=true" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/root/scripts" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "$method, prepare/finish scripts with become=false" | ||
rlRun "tmt --context provisiontest=$method run -rvvv plan --name /prepare-finish/user/scripts" | ||
rlPhaseEnd | ||
fi | ||
done | ||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
if [[ "$PROVISION_METHODS" =~ "container" ]]; then | ||
rlRun "podman image rm -f localhost/become-container-test:latest" 0 "Remove custom image" | ||
fi | ||
if [[ "$PROVISION_METHODS" =~ "container" ]]; then | ||
rlRun "podman image rm -f localhost/become-container-test:latest" 0 "Remove custom image" | ||
fi | ||
rlPhaseEnd | ||
rlJournalEnd |