Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
- job: copr_build
trigger: pull_request

# Test pull requests
- job: tests
trigger: pull_request

# Propose downstream pull requests
- job: propose_downstream
trigger: release
Expand Down
30 changes: 11 additions & 19 deletions plans/tmt.fmf
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
summary: Integration testing with tmt

discover:
how: fmf

provision:
how: virtual
memory: 3072
prepare:
- name: enable-updates
how: shell
script: |
dnf install -y dnf-plugins-core
dnf install -y epel-release --skip-broken
dnf config-manager --enable '*-testing'
- name: install-tmt
how: install
copr: psss/tmt
package: tmt-provision-virtual
memory: 4096

execute:
how: tmt

/fedora:
provision+:
image: fedora

/centos:
provision+:
image: centos
adjust:
- provision:
hardware:
virtualization:
is-supported: true
memory: ">= 8 GB"
when: trigger == commit
7 changes: 0 additions & 7 deletions test/tmt/main.fmf

This file was deleted.

2 changes: 0 additions & 2 deletions test/tmt/plan.txt

This file was deleted.

1 change: 1 addition & 0 deletions test/tmt/regular-user/data/.fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
22 changes: 22 additions & 0 deletions test/tmt/regular-user/data/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/plan:
discover:
how: fmf
provision:
how: virtual
execute:
how: tmt

/fedora:
provision+:
image: fedora
environment:
EXPECTED: Fedora Linux

/centos:
provision+:
image: centos-stream-10
environment:
EXPECTED: CentOS Stream

/test:
test: grep "$EXPECTED" /etc/os-release
8 changes: 8 additions & 0 deletions test/tmt/regular-user/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
summary: Regular user can provision a guest
description:
Provision a fedora and centos-stream guest using a
short name under a regular user and run a simple check.
test: ./test.sh
framework: beakerlib
require: tmt+provision-virtual
duration: 20m
26 changes: 26 additions & 0 deletions test/tmt/regular-user/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh || exit 1

rlJournalStart
rlPhaseStartSetup
rlAssertRpm "tmt"
rlAssertRpm "python3-testcloud"
rlRun "useradd tester"
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "run=\$(mktemp -d)" 0 "Create run directory"
rlRun "cp -a data/. $tmp"
rlRun "chown -R tester $tmp $run"
[[ -d /var/tmp/tmt ]] && rlRun "chown -R tester /var/tmp/tmt"
rlPhaseEnd

rlPhaseStartTest
rlRun "su -l tester -c 'cd $tmp && tmt run --id $run -avvv'"
rlPhaseEnd

rlPhaseStartCleanup
rlRun "pkill -U tester"
rlRun "userdel -r tester"
rlGetTestState || rlFileSubmit "$run/log.txt"
rlRun "rm -r $tmp $run" 0 "Remove tmp and run directory"
rlPhaseEnd
rlJournalEnd
27 changes: 0 additions & 27 deletions test/tmt/test.sh

This file was deleted.