From 806f23b694f0391ac1a59988ac43126f59e04a45 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Wed, 20 Dec 2023 07:16:01 -0500 Subject: [PATCH] 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. --- tmt/plans/build-gnome.fmf | 27 +++------------------------ tmt/plans/build-kde.fmf | 27 +++------------------------ tmt/plans/build-minimal.fmf | 27 +++------------------------ tmt/plans/build-server.fmf | 27 +++------------------------ tmt/tests/build-image.fmf | 21 +++++++++++++++++++++ 5 files changed, 33 insertions(+), 96 deletions(-) create mode 100644 tmt/tests/build-image.fmf diff --git a/tmt/plans/build-gnome.fmf b/tmt/plans/build-gnome.fmf index c8388c4..c49d845 100644 --- a/tmt/plans/build-gnome.fmf +++ b/tmt/plans/build-gnome.fmf @@ -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 diff --git a/tmt/plans/build-kde.fmf b/tmt/plans/build-kde.fmf index 54def45..f1f22b3 100644 --- a/tmt/plans/build-kde.fmf +++ b/tmt/plans/build-kde.fmf @@ -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 diff --git a/tmt/plans/build-minimal.fmf b/tmt/plans/build-minimal.fmf index 44cb471..33947f9 100644 --- a/tmt/plans/build-minimal.fmf +++ b/tmt/plans/build-minimal.fmf @@ -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 diff --git a/tmt/plans/build-server.fmf b/tmt/plans/build-server.fmf index 25ba08f..b9c2c15 100644 --- a/tmt/plans/build-server.fmf +++ b/tmt/plans/build-server.fmf @@ -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 diff --git a/tmt/tests/build-image.fmf b/tmt/tests/build-image.fmf new file mode 100644 index 0000000..32e2c28 --- /dev/null +++ b/tmt/tests/build-image.fmf @@ -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