diff --git a/Regression/bz234045-missing-causes-netstat-I-and-netstat/main.fmf b/Regression/bz234045-missing-causes-netstat-I-and-netstat/main.fmf new file mode 100644 index 0000000..2be21c1 --- /dev/null +++ b/Regression/bz234045-missing-causes-netstat-I-and-netstat/main.fmf @@ -0,0 +1,21 @@ +summary: Test for BZ#234045 (missing '=' causes "netstat -I" and "netstat) +description: | + Bug summary: missing '=' causes "netstat -I" and "netstat --interfaces" to segfault + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=234045 +contact: fhrdina@redhat.com +component: + - net-tools +test: ./runtest.sh +framework: beakerlib +recommend: + - net-tools +duration: 5m +enabled: true +tag: + - Tier1 +tier: '1' +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=234045 +extra-nitrate: TC#0174619 +extra-summary: /CoreOS/net-tools/Regression/bz234045-missing-causes-netstat-I-and-netstat +extra-task: /CoreOS/net-tools/Regression/bz234045-missing-causes-netstat-I-and-netstat diff --git a/Regression/bz234045-missing-causes-netstat-I-and-netstat/runtest.sh b/Regression/bz234045-missing-causes-netstat-I-and-netstat/runtest.sh new file mode 100755 index 0000000..d2324d0 --- /dev/null +++ b/Regression/bz234045-missing-causes-netstat-I-and-netstat/runtest.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/net-tools/Regression/bz234045-missing-causes-netstat-I-and-netstat +# Description: Test for BZ#234045 (missing '=' causes "netstat -I" and "netstat) +# Author: Alex Sersen +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2012 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="net-tools" + +DEF_ETH=`ip route show | grep default | awk '{print $5}' | head -1` + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "netstat -i" 0 + rlRun "netstat -I" 0 + rlRun "netstat --interfaces=$DEF_ETH" 0 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd + diff --git a/Sanity/netstat-notrim-option/main.fmf b/Sanity/netstat-notrim-option/main.fmf new file mode 100644 index 0000000..33ed971 --- /dev/null +++ b/Sanity/netstat-notrim-option/main.fmf @@ -0,0 +1,24 @@ +summary: Test for bz732984 (netstat truncates IPV6 UDP sockets even with) +description: | + Bug summary: netstat truncates IPV6 UDP sockets even with --notrim specifed + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=732984 +contact: fhrdina@redhat.com +component: + - net-tools +test: ./runtest.sh +framework: beakerlib +recommend: + - net-tools + - nmap-ncat + - nc + - iproute +duration: 10m +enabled: true +tag: + - Tier1 +tier: '1' +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=732984 +extra-nitrate: TC#0111106 +extra-summary: /CoreOS/net-tools/Sanity/netstat-notrim-option +extra-task: /CoreOS/net-tools/Sanity/netstat-notrim-option diff --git a/Sanity/netstat-notrim-option/runtest.sh b/Sanity/netstat-notrim-option/runtest.sh new file mode 100755 index 0000000..715ca33 --- /dev/null +++ b/Sanity/netstat-notrim-option/runtest.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/net-tools/Sanity/netstat-notrim-option +# Description: Test for bz732984 (netstat truncates IPV6 UDP sockets even with) +# Author: Ales Zelinka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# 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, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="net-tools" +def_PORT="15151" + +rlJournalStart +rlPhaseStartTest + rlAssertRpm $PACKAGE + #starting with rhel7 the option changed. feature, not a bug. + if rlIsRHEL 5 6 ; then + OPTION="T" + else + OPTION="W" + fi + + DEFAULT_IF=`ip r | grep default | awk '{print $5}' | head -1` + IPV6_DEF_ADDR="$(ip a l dev $DEFAULT_IF | grep 'inet6 ' | grep -v 'scope link' | awk NR\=\=1 | sed 's/.* inet6 \s*\([^/]*\).*/\1/')" + rlLog "DEFAULT_IF: \"$DEFAULT_IF\"" # default interface + rlLog "IPV6_DEF_ADDR: \"$IPV6_DEF_ADDR\"" # first global IPv6 addr. of default interface + + # run udp6 NC server on IPv6 address of default interface + # to make sure there is at least 1 ipv6/udp server listening + rlRun "nc -6ul $IPV6_DEF_ADDR $def_PORT &" + sleep 10 + echo "######################## jobs ########################"; jobs # debug + echo "#################### netstat -tulen ##################"; netstat -tulen # debug + echo "#################### ss -tulen ##################"; ss -tulen # debug (netstat not showing new job on s390x sometimes - try "ss" also) + + ip a l dev "$DEFAULT_IF" | grep 'inet6 ' | grep -v 'scope link' | sed 's/.* inet6 \s*\([^/]*\).*/\1/' | \ + while read ADDRESS ; do + rlRun "netstat -A inet6 -an$OPTION |grep udp|grep $ADDRESS" 0 "netstat listed untrimmed address $ADDRESS" + done + rlLog "echo 'Why was it empty?'" + pkill nc # kill nc server +rlPhaseEnd +rlJournalPrintText +rlJournalEnd