-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust support for modifying plan templates
Add support for modifying all supported steps. Mention the new functionality in the examples. Include a simple test for the feature as well.
- Loading branch information
Showing
5 changed files
with
94 additions
and
32 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
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: Create a test plan using template and command line data | ||
test: ./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,37 @@ | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "TMP=\$(mktemp -d)" 0 "Creating tmp directory" | ||
rlRun "pushd $TMP" | ||
rlRun "set -o pipefail" | ||
rlRun "tmt init" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Valid data" | ||
yaml1='{how: "fmf", name: "int", url: "https://int/repo"}' | ||
yaml2='{how: "fmf", name: "ext", url: "https://ext/repo"}' | ||
rlRun "tmt plan create /plans/custom --template mini \ | ||
--discover '$yaml1' --discover '$yaml2'" | ||
rlAssertGrep "name: ext" "plans/custom.fmf" | ||
rlAssertGrep "url:.*ext/repo" "plans/custom.fmf" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Invalid yaml" | ||
yaml='{how: "fmf"; name: "int"; url: "https://int/repo"}' | ||
rlRun "tmt plan create /plans/bad --template mini \ | ||
--discover '$yaml' 2>&1 | tee output " 1 | ||
rlAssertGrep "Invalid yaml data" "output" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Invalid step" | ||
rlRun "tmt plan create /plans/bad --template mini \ | ||
--discover '' 2>&1 | tee output " 1 | ||
rlAssertGrep "Invalid step data" "output" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlRun "rm -r $TMP" 0 "Removing tmp directory" | ||
rlPhaseEnd | ||
rlJournalEnd |
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
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