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..d34033d --- /dev/null +++ b/plans/gating.fmf @@ -0,0 +1,9 @@ +summary: Run libzfcphbaapi 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..b216437 --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,4 @@ +adjust: + - when: arch != s390x + enabled: false + because: The libzfcphbaapi package is s390x only. diff --git a/tests/sanity/main.fmf b/tests/sanity/main.fmf new file mode 100644 index 0000000..a3ee0ab --- /dev/null +++ b/tests/sanity/main.fmf @@ -0,0 +1,18 @@ +summary: sanity +description: | + Basic test for libzfcphbaapi +contact: Daniel Horak +component: + - libzfcphbaapi +test: ./runtest.sh +framework: beakerlib +require: + - libzfcphbaapi + - libzfcphbaapi-devel + - /usr/bin/readelf +duration: 1m +enabled: true +adjust: + - when: arch != s390x + enabled: false + because: This this package is s390x only diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh new file mode 100755 index 0000000..e295780 --- /dev/null +++ b/tests/sanity/runtest.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/libzfcphbaapi/smoke-functionality +# Description: Smoke, Sanity and function tests +# Author: Dan HorĂ¡k +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGES="libzfcphbaapi libzfcphbaapi-devel" + +rlJournalStart + rlPhaseStartSetup + for p in $PACKAGES ; do + rlAssertRpm $p + done + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlAssertExists /usr/include/hbaapi.h + rlAssertExists /usr/lib64/libzfcphbaapi.so + rlRun "readelf -d /usr/lib64/libzfcphbaapi.so | grep SONAME" 0 "Getting library soname" + rlPhaseEnd + + rlPhaseStartTest + rlRun "zfcp_show -h" + rlRun "zfcp_ping -h" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd