From ed97b76675468b9693ef7a0dba56d5a7ea05030e Mon Sep 17 00:00:00 2001 From: Matus Marhefka Date: Thu, 27 Aug 2020 11:47:39 +0200 Subject: [PATCH] Sanity/oscap-version: basic test to check that oscap prints its version --- Sanity/oscap-version/main.fmf | 8 ++++++ Sanity/oscap-version/runtest.sh | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Sanity/oscap-version/main.fmf create mode 100755 Sanity/oscap-version/runtest.sh diff --git a/Sanity/oscap-version/main.fmf b/Sanity/oscap-version/main.fmf new file mode 100644 index 0000000..c3111e8 --- /dev/null +++ b/Sanity/oscap-version/main.fmf @@ -0,0 +1,8 @@ +summary: openscap prints version +description: 'Checks that openscap prints its version' +contact: Matus Marhefka +duration: 5m +tier: 1 +recommend: +- openscap +- openscap-scanner diff --git a/Sanity/oscap-version/runtest.sh b/Sanity/oscap-version/runtest.sh new file mode 100755 index 0000000..32011db --- /dev/null +++ b/Sanity/oscap-version/runtest.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/openscap/Sanity/oscap-version +# Description: Checks that openscap prints its version. +# Author: Matus Marhefka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 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/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="openscap" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "oscap --version | head -n1 | grep \"[0-9]\+\.[0-9]\+\.[0-9]\+\"" \ + 0 "openscap prints its version on the first line" + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd