| |
@@ -0,0 +1,79 @@
|
| |
+ #!/bin/bash
|
| |
+ # vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
| |
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| |
+ #
|
| |
+ # runtest.sh of /tools/systemtap/Regression/bz711976-debugfs-dir-removal-after-OOM
|
| |
+ # Description: Test for bz711976 (Systemtap does not remove directory of debugfs)
|
| |
+ # Author: Petr Muller <pmuller@redhat.com>
|
| |
+ #
|
| |
+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
| |
+ #
|
| |
+ # 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
|
| |
+
|
| |
+ PACKAGE="systemtap"
|
| |
+
|
| |
+ rlJournalStart
|
| |
+ rlPhaseStartSetup "Determining system suitability"
|
| |
+ CPUS=$(grep processor /proc/cpuinfo | wc -l)
|
| |
+ MEMNEEDED=$(($CPUS * 4094))
|
| |
+ MEMKB=$(grep MemTotal /proc/meminfo | tr -c -d '[[:digit:]]')
|
| |
+ MEMMB=$(($MEMKB / 1024))
|
| |
+
|
| |
+ rlLog "CPU count: $CPUS"
|
| |
+ rlLog "Needed memory: $(($MEMNEEDED)) MB"
|
| |
+ rlLog "Available memory: $(($MEMMB)) MB"
|
| |
+
|
| |
+ if [ $MEMNEEDED -lt $MEMMB ]
|
| |
+ then
|
| |
+ rlLog "The system has more memory than we need"
|
| |
+ rlPhaseEnd
|
| |
+ rlJournalPrintText
|
| |
+ rlJournalEnd
|
| |
+ exit 0
|
| |
+ else
|
| |
+ rlPass "System has sufficiently low memory"
|
| |
+ fi
|
| |
+ rlPhaseEnd
|
| |
+
|
| |
+ rlPhaseStartSetup "Preparations"
|
| |
+ rlRun "swapoff --all"
|
| |
+ rlRun "stap -p4 -b -e 'global a probe begin {a=1} probe timer.ms(2000){if (a==1) exit()}' -m bz711976"
|
| |
+ rlPhaseEnd
|
| |
+
|
| |
+ rlPhaseStartTest
|
| |
+ rlRun "staprun -R -L -b 4095 bz711976.ko" 1
|
| |
+ sleep 5
|
| |
+ rlAssertNotExists /sys/kernel/debug/systemtap/bz711976
|
| |
+ tmplog=$(mktemp)
|
| |
+ rlRun "staprun -R -L -b 1 bz711976.ko |& tee $tmplog"
|
| |
+ modname=$(cat $tmplog | tr -d '"' | awk '/To reconnect, type/ {print $NF}')
|
| |
+ sleep 10
|
| |
+ rlRun "staprun -A $modname"
|
| |
+ rlPhaseEnd
|
| |
+
|
| |
+ rlPhaseStartCleanup
|
| |
+ rlRun "swapon --all"
|
| |
+ rlRun "rm -f bz711976.ko $tmplog"
|
| |
+ rlPhaseEnd
|
| |
+ rlJournalPrintText
|
| |
+ rlJournalEnd
|
| |
Try to separate gating tests, add a non-gating test