-
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.
Signed-off-by: Carlos Rodriguez-Fernandez <[email protected]>
- Loading branch information
1 parent
195da33
commit ec94ffb
Showing
18 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
summary: Check that become works on podman provision | ||
description: Ensures that become works when used in containers. |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
provision: | ||
how: virtual | ||
image: fedora | ||
user: fedora | ||
|
||
execute: | ||
how: tmt |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
discover: | ||
tests: | ||
- name: dummy-test | ||
test: echo "pass" | ||
|
||
/root: | ||
provision+: | ||
become: true | ||
|
||
/inline: | ||
prepare: | ||
script: test "$(whoami)" == "root" | ||
finish: | ||
script: test "$(whoami)" == "root" | ||
|
||
/scripts: | ||
prepare: | ||
script: scripts/is_root_test.sh | ||
finish: | ||
script: scripts/is_root_test.sh | ||
|
||
/user: | ||
provision+: | ||
become: false | ||
|
||
/inline: | ||
prepare: | ||
script: test "$(whoami)" == "fedora" | ||
finish: | ||
script: test "$(whoami)" == "fedora" | ||
|
||
/scripts: | ||
prepare: | ||
script: scripts/is_user_test.sh | ||
finish: | ||
script: scripts/is_user_test.sh |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
|
||
test "$(whoami)" == "root" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
|
||
test "$(whoami)" == "fedora" |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/root: | ||
provision+: | ||
become: true | ||
discover: | ||
tests: | ||
- name: user-is-root | ||
test: test "$(whoami)" == "root" | ||
|
||
/user: | ||
provision+: | ||
become: false | ||
discover: | ||
tests: | ||
- name: user-is-user | ||
test: test "$(whoami)" == "fedora" |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
summary: Check that become works on virtual provision | ||
description: Ensures that become works when used in virtual instances. |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
PROVISION_METHODS=${PROVISION_METHODS:-virtual} | ||
|
||
rlJournalStart | ||
if [[ "$PROVISION_METHODS" =~ virtual ]]; then | ||
rlPhaseStartSetup | ||
rlRun "pushd data" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Virtual, test with become=true" | ||
rlRun "tmt run -rvvv plan --name /test/root" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Virtual, test with become=false" | ||
rlRun "tmt run -rvvv plan --name /test/user" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Virtual, prepare/finish inline with become=true" | ||
rlRun "tmt run -rvvv plan --name /prepare-finish/root/inline" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Virtual, prepare/finish inline with become=false" | ||
rlRun "tmt run -rvvv plan --name /prepare-finish/user/inline" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Virtual, prepare/finish scripts with become=true" | ||
rlRun "tmt run -rvvv plan --name /prepare-finish/root/scripts" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Virtual, prepare/finish scripts with become=false" | ||
rlRun "tmt run -rvvv plan --name /prepare-finish/user/scripts" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlPhaseEnd | ||
fi | ||
rlJournalEnd |