sanity test

This commit is contained in:
pdancak 2024-06-21 10:44:02 +02:00
commit fdedd8cab2
3 changed files with 97 additions and 0 deletions

BIN
Sanity/fstrm-utils/dnstap.0 Normal file

Binary file not shown.

View file

@ -0,0 +1,36 @@
summary: Use fstrm upstream utils to excercise the library.
description: ''
contact: Petr Dancak <pdancak@redhat.com>
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

61
Sanity/fstrm-utils/runtest.sh Executable file
View file

@ -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 <pemensik@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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