Skip to content

Commit 2e9d84c

Browse files
authored
Add integration test for copr-repository provider (#4516)
Add example-based integration test for the copr-repository artifact provider using mariobl/pyspread Copr repository. The test verifies that the pyspread package can be installed from the Copr repository and checks the package source. Related to #4449
1 parent 60fed25 commit 2e9d84c

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/plan:
2+
discover:
3+
how: fmf
4+
provision:
5+
how: container
6+
prepare:
7+
how: artifact
8+
provide:
9+
- copr.repository:mariobl/pyspread
10+
execute:
11+
how: tmt
12+
13+
/test:
14+
test: ./test.sh
15+
duration: 5m
16+
summary: Verify pyspread from copr repository
17+
require:
18+
- pyspread
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
# Verify pyspread is installed
5+
rpm -q pyspread
6+
7+
# Verify pyspread came from the copr repository
8+
dnf info --installed pyspread | grep -Eq "From repo(sitory)?\s*:\s*copr:.*:mariobl:pyspread"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# Example test for copr-repository artifact provider
3+
. /usr/share/beakerlib/beakerlib.sh || exit 1
4+
. ../../../../images.sh || exit 1
5+
. ../../lib/common.sh || exit 1
6+
7+
rlJournalStart
8+
rlPhaseStartSetup
9+
rlRun "PROVISION_HOW=${PROVISION_HOW:-container}"
10+
rlRun "pushd data"
11+
rlRun "run=$(mktemp -d)" 0 "Create run directory"
12+
13+
setup_distro_environment
14+
rlPhaseEnd
15+
16+
rlPhaseStartTest "Test copr-repository provider with command-line override"
17+
rlRun "tmt run -i $run --scratch -vv --all \
18+
provision -h $PROVISION_HOW --image $TEST_IMAGE_PREFIX/$image_name \
19+
prepare --how artifact --provide copr.repository:mariobl/pyspread" 0 "Run with copr-repository provider"
20+
rlPhaseEnd
21+
22+
rlPhaseStartCleanup
23+
rlRun "rm -rf $run"
24+
rlRun "popd"
25+
rlPhaseEnd
26+
rlJournalEnd

0 commit comments

Comments
 (0)