systemtap/tests/Regression/selected-parts-of-upstream-testsuite/runtest.sh
Martin Cermak 8d5d041590 Include downstream/RHEL tests
Find new home for downstream RHEL tests.  Upstream them.  The set of
tests used for fedora gating stays intact:  The gating tests are only
those having the tier1 tag set in their main.fmf file.  The testplan
plans/ci.fmf filters the others out from gating.

The set of Fedora gating tests stays the same as it was before this
change.
2022-05-10 09:56:18 +02:00

185 lines
6.2 KiB
Bash
Executable File

#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/systemtap/Regression/selected-parts-of-upstream-testsuite
# Description: selected-parts-of-upstream-testsuite
# Author: Martin Cermak <mcermak@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 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/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Be tolerant about selinux
export AVC_ERROR='+no_avc_check'
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
DMESG1=$(mktemp)
DMESG2=$(mktemp)
PACKAGE="systemtap"
SUBTESTS="\
attach_detach.exp \
bz1126645.exp \
bz1214176.exp \
bz1252436.exp \
exelib.exp \
pr22005.exp \
server.exp \
systemtap-service.exp \
task_dentry_path.exp \
task_paths.exp \
tracepoints.exp \
"
blacklist_subtest()
{
token=${1/\//\\/}
SUBTESTS=${SUBTESTS/$token/}
}
P4TESTS="\
buildok/nfs-all-probes.stp \
buildok/nfs-detailed.stp \
buildok/nfs-fop.check_flags.stp \
buildok/nfs_proc-detailed.stp \
buildok/nfsd-all-probes.stp \
buildok/nfsd-detailed.stp \
systemtap.examples/io/nfs_func_users.stp \
systemtap.examples/network/nfsdtop.stp \
"
blacklist_p4()
{
token=${1/\//\\/}
P4TESTS=${P4TESTS/$token/}
}
if [[ $(rpm --eval '%{rhel}') -ge 8 ]]; then
# mjw authored that testcase - had been notified
arch | fgrep 'x86_64' && blacklist_subtest 'exelib.exp'
blacklist_p4 'buildok/nfs-fop.check_flags.stp'
blacklist_p4 'buildok/nfs_proc-detailed.stp'
blacklist_p4 'buildok/nfsd-detailed.stp'
# bz1709831
blacklist_p4 'buildok/nfs-detailed.stp'
arch | fgrep -q ppc64le && blacklist_p4 'buildok/nfs-all-probes.stp'
elif [[ $(rpm --eval '%{rhel}') -eq 7 ]]; then
# RHEL-ALT
if rpm -qi kernel | fgrep -q kernel-alt; then
# at_var.exp is expected to fail on Pegas - https://bugzilla.redhat.com/show_bug.cgi?id=1165848#c7
blacklist_subtest 'at_var.exp'
fi
# bz1107616, bz1698737
blacklist_p4 'buildok/nfsd-detailed.stp'
if arch | fgrep -q ppc64le; then
blacklist_p4 'buildok/nfs-all-probes.stp'
blacklist_p4 'buildok/nfs-detailed.stp'
blacklist_p4 'buildok/nfsd-all-probes.stp'
fi
elif [[ $(rpm --eval '%{rhel}') -le 6 ]]; then
true
fi
which stap | fgrep -q toolset && blacklist_subtest 'modules_out_of_tree.exp'
rlJournalStart
rlPhaseStartSetup
TESTSUITERPM="$(rpm --queryformat='%{name}\n' -qf $(which stap) | head -1 | grep -o '.*systemtap')-testsuite"
rlLogInfo "$(rpm -q $TESTSUITERPM)"
TESTSUITEDIR="$(rpm -ql $TESTSUITERPM | grep -o '.*share/systemtap/testsuite/' | head -1)"
rlLogInfo "$TESTSUITEDIR"
# For devtoolset, compat arch support was dropped for non-x86_64 arches. Ref: bz1493500
if echo $TESTSUITEDIR | grep -q toolset && arch | egrep -q '^(ppc64|s390x)$'; then
sed -i '/^proc arch_compile_flags/,/^}/d' $TESTSUITEDIR/lib/compile_flags.exp
echo 'proc arch_compile_flags {} { return 1 }' >> $TESTSUITEDIR/lib/compile_flags.exp
fi
# Need to suppress warnings so that task_dentry_path.exp can pass
# And --skip-badvars to let task_paths.exp pass
rlRun "sed -i 's/--rlimit-cpu=850/-w --skip-badvars \0/' $TESTSUITEDIR/lib/systemtap.exp"
rlServiceStop firewalld
rlServiceStop iptables
rlServiceStop ip6tables
rlServiceStart avahi-daemon
rlRun "rpm -qa | grep ^kernel | grep -v `uname -r` | xargs rpm -e" 0-255
rlRun "stap-prep" 0,127
PKGMGR="yum --skip-broken --nogpgcheck"
rpm -q dnf && PKGMGR="dnf --setopt=strict=0 --nogpgcheck"
rlRun "$PKGMGR -y install --setopt=multilib_policy=all libstdc++ dejagnu elfutils-devel gettext libgcc glibc-devel gcc-c++ libstdc++-devel dyninst dyninst-devel"
rlRun "sysctl -w kernel.panic=1"
rlRun "sysctl -w kernel.panic_on_oops=1"
rlPhaseEnd
rlPhaseStartTest
rlRun "cd $TESTSUITEDIR"
rlRun "make clean"
rlRun "dmesg > $DMESG1"
rlRun "make installcheck RUNTESTFLAGS=\"${RUNTESTFLAGS:-$SUBTESTS}\""
rlRun "dmesg > $DMESG2"
rlLogInfo "$SUBTESTS"
rlDejaSum "systemtap.sum"
rlFileSubmit "systemtap.log"
rlFileSubmit "systemtap.sum"
rlPhaseEnd
rlPhaseStart FAIL "Run selected -p4 tests"
for t in $P4TESTS; do
rlLogInfo "Trying to compile $t without prologue search ..."
ADDSWITCHES=''
stap $ADDSWITCHES -w -o /dev/null -p4 $t || ADDSWITCHES='-P'
rlRun "stap $ADDSWITCHES -w -p4 $t"
done
rlPhaseEnd
rlPhaseStart FAIL "Check for BUG: in dmesg"
rlRun "diff $DMESG1 $DMESG2" 0-255
rlRun "diff $DMESG1 $DMESG2 | grep 'BUG:'" 1
rlPhaseEnd
rlPhaseStart FAIL "Evaluate test results"
TEMPLOG=$(mktemp)
rlRun "cp systemtap.sum $TEMPLOG"
# BLACKLIST
if which stap | grep -q toolset; then
rlLogInfo "Ignore boot time probing subtest FAILures per bz1121363#c20 for devtoolset"
sed -i '/^FAIL: stap-service::boot probing - install script/d' $TEMPLOG
sed -i '/^FAIL: stap-service::boot probing - check script/d' $TEMPLOG
fi
# check for failures
rlRun "grep ^PASS $TEMPLOG" 0 "Assert a/some PASS"
rlRun "grep ^FAIL $TEMPLOG" 1 "Assert no FAIL"
rm -f $TEMPLOG
rlPhaseEnd
rlPhaseStartCleanup
rlServiceRestore firewalld
rlServiceRestore iptables
rlServiceRestore ip6tables
rlServiceRestore avahi-daemon
rlPhaseEnd
rlJournalPrintText
rlJournalEnd