diff --git a/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/main.fmf b/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/main.fmf new file mode 100644 index 0000000..266727a --- /dev/null +++ b/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/main.fmf @@ -0,0 +1,36 @@ +summary: Test for BZ#2119892 (tcpdump does not print all pgm options from pgm) +description: | + Bug summary: tcpdump does not print all pgm options from pgm packets + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2119892 +enabled: true +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2119892 + - relates: https://issues.redhat.com/browse/RHEL-10708 +tag: + - NoRHEL4 + - NoRHEL5 + - NoRHEL6 + - NoRHEL7 + - Tier1 +adjust: + - enabled: false + when: distro == rhel-4, rhel-5, rhel-6, rhel-7, rhel-alt-7 + continue: false + - enabled: false + when: distro ~< rhel-8.10 + continue: false + - enabled: false + when: distro ~< rhel-9.4 + continue: false +component: + - tcpdump +test: ./runtest.sh +tier: '1' +framework: beakerlib +recommend: + - tcpdump +duration: 5m +extra-nitrate: TC#0615263 +extra-summary: /CoreOS/tcpdump/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm +extra-task: /CoreOS/tcpdump/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm +id: 7560cad4-e502-4652-88e4-b2fdccea263d diff --git a/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/runtest.sh b/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/runtest.sh new file mode 100755 index 0000000..fb9e722 --- /dev/null +++ b/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/tcpdump/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm +# Description: Test for BZ#2119892 (tcpdump does not print all pgm options from pgm) +# Author: Ondrej Mejzlik +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2023 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=${PACKAGE:-tcpdump} + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE || rlDie "Package $PACKAGE not installed" + TESTDIR=$(pwd) + DEFAULT_IF="$(ip route show | grep default | sed 's/.* dev \([^ ]\+\) .*/\1/' | head -n 1)" + rlLog "Arch: $(arch), PC name: $(hostname), $(hostname -A) User: $(whoami) DefaultIF: $DEFAULT_IF" + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" 0 "Going into tmp directory $TmpDir" + rlRun "cp $TESTDIR/sample.pcap ." 0 "Copy sample data" + rlPhaseEnd + + rlGetTestState && { + rlPhaseStartTest + rlRun "tcpdump -r sample.pcap -T pgm -v &> out" 0 "Run tcpdump" + rlAssertNotGrep 'Bad option' out + rlAssertGrep 'OPT_21 \[30\] OPT_29 \[8\] OPT_A2 \[16\] \[94\]' out + echo "Output:" + cat out + rlPhaseEnd + } + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/sample.pcap b/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/sample.pcap new file mode 100644 index 0000000..a62f6cb Binary files /dev/null and b/Regression/bz2119892-tcpdump-does-not-print-all-pgm-options-from-pgm/sample.pcap differ