From a9a3e95eced1578b762f374ccf9008dc697bbea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Fri, 7 Aug 2026 09:31:41 +0200 Subject: [PATCH] initial version --- .fmf/version | 1 + plans/gating.fmf | 9 ++++++++ plans/main.fmf | 4 ++++ tests/sanity/main.fmf | 18 +++++++++++++++ tests/sanity/runtest.sh | 50 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 .fmf/version create mode 100644 plans/gating.fmf create mode 100644 plans/main.fmf create mode 100644 tests/sanity/main.fmf create mode 100755 tests/sanity/runtest.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/gating.fmf b/plans/gating.fmf new file mode 100644 index 0000000..b729bbb --- /dev/null +++ b/plans/gating.fmf @@ -0,0 +1,9 @@ +summary: Run libzpc gating tests + +discover: + how: fmf + test: + - "^/tests/sanity" + +execute: + how: tmt diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..a13087d --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,4 @@ +adjust: + - when: arch != s390x + enabled: false + because: The libzpc package is s390x only. diff --git a/tests/sanity/main.fmf b/tests/sanity/main.fmf new file mode 100644 index 0000000..b38ee88 --- /dev/null +++ b/tests/sanity/main.fmf @@ -0,0 +1,18 @@ +summary: sanity +description: | + Basic test for libzpc +contact: Daniel Horak +component: + - libzpc +test: ./runtest.sh +framework: beakerlib +require: + - libzpc-provider + - libzpc-tools + - openssl +duration: 1m +enabled: true +adjust: + - when: arch != s390x + enabled: false + because: This package is s390x only diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh new file mode 100755 index 0000000..1126a0f --- /dev/null +++ b/tests/sanity/runtest.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Description: Smoke, Sanity and function tests for libzpc +# Author: Dan HorĂ¡k +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2026 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES="libzpc-provider libzpc-tools openssl" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm --all + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest "Check provider functionality" + rlRun "openssl list -providers | grep -q hbkzpc" 0 "Checking if provider is configured in openssl" + rlPhaseEnd + + rlPhaseStartTest "Check tool functionality" + rlRun "zpckey --version" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd