2022-05-10 07:56:18 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
#
|
|
|
|
# runtest.sh of /tools/systemtap/Regression/wrong-data-returned-by-nfs-commit-done
|
|
|
|
# Description: wrong-data-returned-by-nfs-commit-done
|
|
|
|
# Author: Martin Cermak <mcermak@redhat.com>
|
|
|
|
#
|
|
|
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
#
|
|
|
|
# Copyright (c) 2013 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
|
2023-03-10 14:27:23 +00:00
|
|
|
. /etc/os-release || exit 1
|
2022-05-10 07:56:18 +00:00
|
|
|
|
|
|
|
PACKAGE="systemtap"
|
|
|
|
|
|
|
|
rlJournalStart
|
|
|
|
rlPhaseStartSetup
|
|
|
|
rlRun "rpm -qf $(which --skip-alias stap)"
|
|
|
|
rlRun "TMPDIR=$(mktemp -d)"
|
|
|
|
rlRun "cp -r testpro $TMPDIR"
|
|
|
|
rlRun "pushd $TMPDIR/testpro/"
|
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStart FAIL "Systemtap sanity check"
|
|
|
|
rlRun "stap --version"
|
|
|
|
rlRun "stap -v -e 'probe kernel.function(\"vfs_read\"){ exit() }'"
|
|
|
|
rlRun "uname -a"
|
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStart FAIL "Build testing binary, prepare nfs environment"
|
|
|
|
rlRun "make"
|
2023-03-10 14:27:23 +00:00
|
|
|
rlRun "./test-for-nfs"
|
2022-05-10 07:56:18 +00:00
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStartTest
|
|
|
|
if stap -p2 nfs.proc.commit_done.stp >&/dev/null; then
|
|
|
|
rlRun "stap --prologue-searching=never --poison-cache -vc './nfs.proc.commit_done' nfs.proc.commit_done.stp 2>&1 | tee testout.log"
|
|
|
|
else
|
|
|
|
rlRun "stap --prologue-searching=always --poison-cache -vc './nfs.proc.commit_done' nfs.proc.commit_done.stp 2>&1 | tee testout.log"
|
|
|
|
fi
|
|
|
|
rlRun "grep -qP 'nfs.proc.commit_done server_ip:\ \d+\.\d+\.\d+\.\d+' testout.log"
|
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStart WARN "Clean the nfs environment up"
|
2023-03-10 14:27:23 +00:00
|
|
|
rlRun "./test-for-nfs -c"
|
2022-05-10 07:56:18 +00:00
|
|
|
rlPhaseEnd
|
|
|
|
|
|
|
|
rlPhaseStartCleanup
|
|
|
|
rlRun "popd"
|
|
|
|
rlRun "rm -r $TMPDIR"
|
|
|
|
rlPhaseEnd
|
|
|
|
rlJournalPrintText
|
|
|
|
rlJournalEnd
|