tmt: Simplify test configuration

We are running the same test multiple times, so we can de-duplicate
the logic so that it is written only once and reused for each variant.
This commit is contained in:
Neal Gompa 2023-12-20 07:16:01 -05:00
parent 94956e7750
commit 806f23b694
5 changed files with 33 additions and 96 deletions

View File

@ -1,28 +1,7 @@
summary: Build GNOME image
prepare:
- name: install packages
how: install
package:
- distribution-gpg-keys
- fatcat
- git-core
- kiwi
- libselinux-utils
- p7zip-plugins
- python3-boto3
- rpmdistro-repoquery
- zip
- zstd
discover:
how: shell
tests:
- name: build image
test: |
setenforce 0
$TMT_TREE/builder.py build gnome
$TMT_TREE/builder.py package gnome
$TMT_TREE/builder.py tmt gnome
setenforce 1
how: fmf
environment:
image_variant: gnome
execute:
how: tmt

View File

@ -1,28 +1,7 @@
summary: Build KDE image
prepare:
- name: install packages
how: install
package:
- distribution-gpg-keys
- fatcat
- git-core
- kiwi
- libselinux-utils
- p7zip-plugins
- python3-boto3
- rpmdistro-repoquery
- zip
- zstd
discover:
how: shell
tests:
- name: build image
test: |
setenforce 0
$TMT_TREE/builder.py build kde
$TMT_TREE/builder.py package kde
$TMT_TREE/builder.py tmt kde
setenforce 1
how: fmf
environment:
image_variant: kde
execute:
how: tmt

View File

@ -1,28 +1,7 @@
summary: Build Minimal image
prepare:
- name: install packages
how: install
package:
- distribution-gpg-keys
- fatcat
- git-core
- kiwi
- libselinux-utils
- p7zip-plugins
- python3-boto3
- rpmdistro-repoquery
- zip
- zstd
discover:
how: shell
tests:
- name: build image
test: |
setenforce 0
$TMT_TREE/builder.py build minimal
$TMT_TREE/builder.py package minimal
$TMT_TREE/builder.py tmt minimal
setenforce 1
how: fmf
environment:
image_variant: minimal
execute:
how: tmt

View File

@ -1,28 +1,7 @@
summary: Build Server image
prepare:
- name: install packages
how: install
package:
- distribution-gpg-keys
- fatcat
- git-core
- kiwi
- libselinux-utils
- p7zip-plugins
- python3-boto3
- rpmdistro-repoquery
- zip
- zstd
discover:
how: shell
tests:
- name: build image
test: |
setenforce 0
$TMT_TREE/builder.py build server
$TMT_TREE/builder.py package server
$TMT_TREE/builder.py tmt server
setenforce 1
how: fmf
environment:
image_variant: server
execute:
how: tmt

21
tmt/tests/build-image.fmf Normal file
View File

@ -0,0 +1,21 @@
summary: Build image
require:
- distribution-gpg-keys
- fatcat
- git-core
- kiwi
- libselinux-utils
- p7zip-plugins
- python3-boto3
- rpmdistro-repoquery
- zip
- zstd
framework: shell
path: /
test: |
setenforce 0
./builder.py build $image_variant
./builder.py package $image_variant
./builder.py tmt $image_variant
setenforce 1
duration: 60m