diff --git a/Sanity/fstrm-utils/dnstap.0 b/Sanity/fstrm-utils/dnstap.0 new file mode 100644 index 0000000..91be70c Binary files /dev/null and b/Sanity/fstrm-utils/dnstap.0 differ diff --git a/Sanity/fstrm-utils/main.fmf b/Sanity/fstrm-utils/main.fmf new file mode 100644 index 0000000..44814a9 --- /dev/null +++ b/Sanity/fstrm-utils/main.fmf @@ -0,0 +1,36 @@ +summary: Use fstrm upstream utils to excercise the library. +description: '' +contact: Petr Dancak +component: + - fstrm +test: ./runtest.sh +framework: beakerlib +recommend: + - fstrm + - fstrm-utils +duration: 5m +enabled: true +tag: + - NoRHEL4 + - NoRHEL5 + - NoRHEL6 + - NoRHEL7 + - TIPfail_infra + - TIPpass + - Tier1 + - rhel-buildroot + - rhel8-buildroot + - rhel9-buildroot +tier: '1' +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2051512 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2039889 + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1869225 +adjust: + - enabled: false + when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-alt-7 + continue: false +extra-nitrate: TC#0609276 +extra-summary: /CoreOS/fstrm/Sanity/fstrm-utils +extra-task: /CoreOS/fstrm/Sanity/fstrm-utils +id: 5463d1fd-5f18-4a8c-8b1b-1a9c7dc11658 diff --git a/Sanity/fstrm-utils/runtest.sh b/Sanity/fstrm-utils/runtest.sh new file mode 100755 index 0000000..01887f6 --- /dev/null +++ b/Sanity/fstrm-utils/runtest.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/fstrm/Sanity/fstrm-utils +# Description: Use fstrm upstream utils to excercise the library. +# Author: Petr Mensik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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 + +PACKAGE="fstrm" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlAssertRpm $PACKAGE-utils + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + TAPSOURCE="`pwd`/dnstap.0" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "fstrm_dump $TAPSOURCE test.dump >/dev/null 2>dump.log" + rlAssertGrep '^Data frame ' dump.log + rlAssertExists test.dump + + rlRun "fstrm_capture -u test -t protobuf:dnstap.Dnstap -w test.captured &" + CAPTURE_PID=$! + rlRun "fstrm_replay --type protobuf:dnstap.Dnstap -u test -r $TAPSOURCE" + rlRun "kill $CAPTURE_PID" + rlRun "wait $CAPTURE_PID" + rlRun "fstrm_dump test.captured 2>&1 | grep '^Data frame'" 0 "Verify capture was successful" + [ "$DEBUG" = y ] && PS1="test-debug $PS1" bash -i + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd