Skip to content

Commit

Permalink
Move provision virtual tests to the new approach
Browse files Browse the repository at this point in the history
  • Loading branch information
psss committed Jan 26, 2024
1 parent e8a0d0f commit f8791c8
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 95 deletions.
3 changes: 2 additions & 1 deletion plans/provision/virtual.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ description: |
even if not directly related to the provision implementation.

The plan takes care of fetching the image to speed up the
execution. Each test should consume the `PROVISION_METHODS`
execution. Each test should set the `provision-virtual` tag to
get picked by the plan, consume the `PROVISION_METHODS`
variable and use `provision --how virtual` on their own.

discover:
Expand Down
2 changes: 1 addition & 1 deletion tests/core/escaping/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rlJournalStart

for method in ${PROVISION_METHODS:-local}; do
rlPhaseStartTest "Test ($method)"
rlRun "tmt run -arvvvddd provision -h $method"
rlRun "tmt run -arvvv provision -h $method"
rlPhaseEnd
done

Expand Down
6 changes: 1 addition & 5 deletions tests/core/spaces/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ description:
test: ./test.sh
framework: beakerlib
tag-: [container, virtual]
tag+: [provision-virtual]

environment:
PROVISION_METHODS: local container
adjust:
- when: how == full
environment:
PROVISION_METHODS: container virtual local
tag+: [additional_coverage]
9 changes: 1 addition & 8 deletions tests/execute/duration/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@ summary: Verify that the test duration is correctly handled
environment:
PROVISION_METHODS: "local container"
duration: 20m

adjust:
when: how == full
environment:
PROVISION_METHODS: "local container virtual"
duration: 30m
because: with full virtualization more methods can be tested
tag+: [additional_coverage]
tag+: [provision-virtual]
6 changes: 1 addition & 5 deletions tests/execute/reboot/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ tier: 4
/out-of-session:
summary: Verify that reboot induced from outside of test session works
test: ./out-of-session.sh
tag+: [provision-virtual]

environment+:
PROVISION_METHODS: container

adjust+:
- when: how==full
environment+:
PROVISION_METHODS: container virtual

# Disabled until the testing environment 'hardware specification' can be set.
# https://tmt.readthedocs.io/en/stable/spec/plans.html#hardware
/efi:
Expand Down
6 changes: 1 addition & 5 deletions tests/execute/tty/main.fmf
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
summary: Verify TTY handling in test environment
tag+: [provision-virtual]

environment:
PROVISION_METHODS: local container
adjust:
- when: how == full
environment:
PROVISION_METHODS: local container virtual
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/finish/ansible/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description:
environment variables are correctly handed over and logs are
pulled back. In the full testing mode check virtual and local
provision method as well.
tag+: [provision-virtual]

# By default we run under a container only
environment:
Expand All @@ -14,8 +15,3 @@ adjust:
environment:
PROVISION_METHODS: container local
because: the pipeline does not support nested virtualization
- when: how == full
environment:
PROVISION_METHODS: container virtual local
because: local/virtual provision needs root/full virtualization
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/login/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
/ready:
summary: Try to log into guest to verify property is_ready
test: ./ready.sh
tag+: [provision-virtual]
environment:
PROVISION_METHODS: local container
adjust:
- when: how == full
environment:
PROVISION_METHODS: local container virtual
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/prepare/ansible/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description:
centos) and prepare it with an ansible playbook. Make sure the
environment variables are correctly handed over. In the full
testing mode check virtual and local provision method as well.
tag+: [provision-virtual]

# By default we run under a container only
environment:
Expand All @@ -13,8 +14,3 @@ adjust:
environment:
PROVISION_METHODS: container local
because: the pipeline does not support nested virtualization
- when: how == full
environment:
PROVISION_METHODS: container virtual local
because: local/virtual provision needs root/full virtualization
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/prepare/install/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ description:
Make sure that special characters are correctly escaped.
Verify that installation from copr works for epel7. Exercises
all provision methods in full mode, container only by default.
tag+: [provision-virtual]
environment:
PROVISION_METHODS: container
adjust:
- when: trigger == commit
environment:
PROVISION_METHODS: container local
because: the pipeline does not support nested virtualization
- when: how == full
environment:
PROVISION_METHODS: container virtual local
because: local/virtual provision needs root/full virtualization
tag+: [additional_coverage]
7 changes: 1 addition & 6 deletions tests/prepare/multihost/main.fmf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
summary: Check that requirement installation is guest-aware in multihost scenario
tag+: [provision-virtual]

environment:
PROVISION_METHODS: container
Expand All @@ -8,9 +9,3 @@ adjust:
environment:
PROVISION_METHODS: container
because: the pipeline does not support nested virtualization

- when: how == full
environment:
PROVISION_METHODS: container virtual
because: local/virtual provision needs root/full virtualization
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/prepare/recommend/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ description:
Run a simple test which recommends two packages. Check that
the existing one is installed and the other one is ignored. No
error should be reported.
tag+: [provision-virtual]
environment:
PROVISION_METHODS: container
adjust:
- when: trigger == commit
environment:
PROVISION_METHODS: container local
because: the pipeline does not support nested virtualization
- when: how == full
environment:
PROVISION_METHODS: container virtual local
because: local/virtual provision needs root/full virtualization
tag+: [additional_coverage]
1 change: 1 addition & 0 deletions tests/provision/facts/main.fmf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/guest:
summary: Check that guest facts are discovered and reported correctly
test: ./test-guest.sh
tag+: [provision-virtual]

environment:
PROVISION_METHODS: local container
Expand Down
3 changes: 2 additions & 1 deletion tests/provision/reboot/main.fmf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
summary: Check that the reboot command works
tag+: [provision-virtual]

environment:
PROVISION_METHODS: container

adjust:
- when: how == full
environment:
PROVISION_METHODS: container connect virtual
PROVISION_METHODS: container connect
tag+: [additional_coverage]

- when: how == beaker
Expand Down
6 changes: 1 addition & 5 deletions tests/pull/results/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ description:
Check that test logs are correctly fetched from the guest,
test results are stored into `results.yaml` and plan data
directory content is synced back.
tag+: [provision-virtual]

environment:
PROVISION_METHODS: container local
adjust:
- when: how == full
environment:
PROVISION_METHODS: container virtual local
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/pull/simple/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@ description:
Make sure that provisioning a guest and clean it up works as
expected even if no preparation, test execution or finish step
scripts are performed.
tag+: [provision-virtual]
link:
- verifies: https://github.com/teemtee/tmt/issues/1011

environment:
PROVISION_METHODS: container local
adjust:
- when: how == full
environment:
PROVISION_METHODS: container virtual local
tag+: [additional_coverage]
7 changes: 1 addition & 6 deletions tests/run/worktree/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ description:
against `local` and during `full` testing using `virtual` as
well.
require+: [tmt+provision-container]
tag+: [provision-virtual]

environment:
PROVISION_METHODS: 'container'
adjust:
- environment:
PROVISION_METHODS: 'container local'
when: trigger == commit
- environment:
PROVISION_METHODS: 'container local virtual'
result: xfail # issue 964
duration: 10m
when: how == full
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/security/ansible/main.fmf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
summary: Check whether an injected shell code is executed
tier: 4
tag+: [provision-virtual]

# By default, we run under a container only
environment:
Expand All @@ -9,8 +10,3 @@ adjust:
environment:
PROVISION_METHODS: container local
because: the pipeline does not support nested virtualization
- when: how == full
environment:
PROVISION_METHODS: container virtual local
because: local/virtual provision needs root/full virtualization
tag+: [additional_coverage]
13 changes: 1 addition & 12 deletions tests/test/check/main.fmf
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
summary: Test test checks
tier: 2
tag+: [provision-virtual]

/dmesg:
test: ./test-dmesg.sh

environment:
PROVISION_METHODS: local container

adjust:
- when: how == full
environment:
PROVISION_METHODS: local container virtual
tag+: [additional_coverage]

/avc:
test: ./test-avc.sh

environment:
PROVISION_METHODS: local

adjust:
- when: how == full
environment:
PROVISION_METHODS: local virtual
tag+: [additional_coverage]
6 changes: 1 addition & 5 deletions tests/test/debug/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ summary: Verify that test debugging works fine
description:
Prepare the environment for testing using provision & prepare,
then debug test code using repeated discover & execute.
tag+: [provision-virtual]

environment:
PROVISION_METHODS: local container
adjust:
environment:
PROVISION_METHODS: local container virtual
when: how == full
tag+: [additional_coverage]

0 comments on commit f8791c8

Please sign in to comment.