Skip to content

Commit

Permalink
squash: A couple of indentation adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
psss committed Feb 19, 2024
1 parent b3b4bc6 commit 87a16bb
Showing 1 changed file with 40 additions and 41 deletions.
81 changes: 40 additions & 41 deletions tests/provision/become/test.sh
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

0 comments on commit 87a16bb

Please sign in to comment.