initial version

This commit is contained in:
Dan Horák 2026-08-07 09:31:41 +02:00
commit a9a3e95ece
5 changed files with 82 additions and 0 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

9
plans/gating.fmf Normal file
View file

@ -0,0 +1,9 @@
summary: Run libzpc gating tests
discover:
how: fmf
test:
- "^/tests/sanity"
execute:
how: tmt

4
plans/main.fmf Normal file
View file

@ -0,0 +1,4 @@
adjust:
- when: arch != s390x
enabled: false
because: The libzpc package is s390x only.

18
tests/sanity/main.fmf Normal file
View file

@ -0,0 +1,18 @@
summary: sanity
description: |
Basic test for libzpc
contact: Daniel Horak <dhorak@redhat.com>
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

50
tests/sanity/runtest.sh Executable file
View file

@ -0,0 +1,50 @@
#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Description: Smoke, Sanity and function tests for libzpc
# Author: Dan Horák <dhorak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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