systemtap/tests/Regression/wrong-data-returned-by-nfs-commit-done/runtest.sh
Martin Cermak 12975603f1 CI Tests: Multiple updates
tests/Regression/RHEL6Feature-cpp-methods:
  Fix locale/LANG dependent sort collation prob
tests/Regression/python-probing:
  Make sure needed debuginfo is in place
tests/Regression/wrong-data-returned-by-nfs-commit-done:
  Refactor, improve clranup, simplify
2023-05-04 17:56:45 +02:00

79 lines
3.0 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/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
. /etc/os-release || exit 1
PACKAGE="systemtap"
export NFS_TMP="$HOME/systemtap-sts-nfs-share-and-mount-tmpdir2"
rlJournalStart
rlPhaseStartSetup
rlRun "rpm -qf $(which --skip-alias stap)"
rlRun "TMPDIR=$(mktemp -d)"
rlRun "cp nfs.proc.commit_done.c nfs.proc.commit_done.stp $TMPDIR/"
rlRun "pushd $TMPDIR"
rlRun "mkdir -p ${NFS_TMP}/sts_share ${NFS_TMP}/sts_mount"
rlPhaseEnd
rlPhaseStart FAIL "Build testing binary, prepare nfs environment"
rlRun "systemctl stop nfs-server.service"
rlRun "systemctl stop rpcbind.service"
rlRun "sleep 3"
rlRun "systemctl start rpcbind.service"
rlRun "sleep 3"
rlRun "systemctl start nfs-server.service"
rlRun "sleep 3"
rlRun "systemctl status nfs-server.service"
rlRun "systemctl status rpcbind.service"
rlRun "exportfs -i -o 'rw,async,no_root_squash' 127.0.0.1:${NFS_TMP}/sts_share"
rlRun "mount -vvvvv -t nfs 127.0.0.1:${NFS_TMP}/sts_share ${NFS_TMP}/sts_mount"
rlRun "gcc nfs.proc.commit_done.c -o nfs.proc.commit_done"
rlPhaseEnd
rlPhaseStartTest
ps="-P"
stap -p2 nfs.proc.commit_done.stp >&/dev/null && ps=''
rlRun "stap $ps --poison-cache -vc './nfs.proc.commit_done' nfs.proc.commit_done.stp 2>&1 | tee testout.log"
rlRun "grep -qP 'nfs.proc.commit_done server_ip:\ \d+\.\d+\.\d+\.\d+' testout.log"
rlPhaseEnd
rlPhaseStart WARN "Clean the nfs environment up"
rlRun "umount -l ${NFS_TMP}/sts_mount"
rlRun "systemctl stop nfs-server.service"
rlRun "systemctl stop rpcbind.service"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMPDIR $NFS_TMP"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd