diff --git a/tests/Regression/RHEL6Feature-cpp-methods/golden.el7.out b/tests/Regression/RHEL6Feature-cpp-methods/golden.el7.out deleted file mode 100644 index d7cff12..0000000 --- a/tests/Regression/RHEL6Feature-cpp-methods/golden.el7.out +++ /dev/null @@ -1,70 +0,0 @@ -StandaloneFunction start: _Z18StandaloneFunctionv -StandaloneFunction end: main -StandaloneFunction start: _ZN5inner18StandaloneFunctionEv -inner::StandaloneFunction start: _ZN5inner18StandaloneFunctionEv -StandaloneFunction end: main -inner::StandaloneFunction end: main -StandaloneFunction start: _ZN9moreinner18StandaloneFunctionEv -moreinner::StandaloneFunction start: _ZN9moreinner18StandaloneFunctionEv -StandaloneFunction end: main -moreinner::StandaloneFunction end: main -puMethod start: _ZN6CLASS18puMethodEv -prMethod start: _ZN6CLASS18prMethodEv -prMethod end: _ZN6CLASS18puMethodEv -puMethod end: main -stMethod start: _ZN6CLASS18stMethodEv -stMethod end: main -puMethod start: _ZN5inner6CLASS18puMethodEv -inner::puMethod start: _ZN5inner6CLASS18puMethodEv -prMethod start: _ZN5inner6CLASS18prMethodEv -inner::prMethod start: _ZN5inner6CLASS18prMethodEv -prMethod end: _ZN5inner6CLASS18puMethodEv -inner::prMethod end: _ZN5inner6CLASS18puMethodEv -puMethod end: main -inner::puMethod end: main -stMethod start: _ZN5inner6CLASS18stMethodEv -inner::stMethod start: _ZN5inner6CLASS18stMethodEv -stMethod end: main -inner::stMethod end: main -puMethod start: _ZN9moreinner6CLASS18puMethodEv -moreinner::puMethod start: _ZN9moreinner6CLASS18puMethodEv -prMethod start: _ZN9moreinner6CLASS18prMethodEv -moreinner::prMethod start: _ZN9moreinner6CLASS18prMethodEv -prMethod end: _ZN9moreinner6CLASS18puMethodEv -moreinner::prMethod end: _ZN9moreinner6CLASS18puMethodEv -puMethod end: main -moreinner::puMethod end: main -stMethod start: _ZN9moreinner6CLASS18stMethodEv -moreinner::stMethod start: _ZN9moreinner6CLASS18stMethodEv -stMethod end: main -moreinner::stMethod end: main -puMethod start: _ZN6CLASS18puMethodEv -prMethod start: _ZN6CLASS18prMethodEv -prMethod end: _ZN6CLASS18puMethodEv -puMethod end: main -stMethod start: _ZN6CLASS18stMethodEv -stMethod end: main -puMethod start: _ZN5inner6CLASS18puMethodEv -inner::puMethod start: _ZN5inner6CLASS18puMethodEv -prMethod start: _ZN5inner6CLASS18prMethodEv -inner::prMethod start: _ZN5inner6CLASS18prMethodEv -prMethod end: _ZN5inner6CLASS18puMethodEv -inner::prMethod end: _ZN5inner6CLASS18puMethodEv -puMethod end: main -inner::puMethod end: main -stMethod start: _ZN5inner6CLASS18stMethodEv -inner::stMethod start: _ZN5inner6CLASS18stMethodEv -stMethod end: main -inner::stMethod end: main -puMethod start: _ZN9moreinner6CLASS18puMethodEv -moreinner::puMethod start: _ZN9moreinner6CLASS18puMethodEv -prMethod start: _ZN9moreinner6CLASS18prMethodEv -moreinner::prMethod start: _ZN9moreinner6CLASS18prMethodEv -prMethod end: _ZN9moreinner6CLASS18puMethodEv -moreinner::prMethod end: _ZN9moreinner6CLASS18puMethodEv -puMethod end: main -moreinner::puMethod end: main -stMethod start: _ZN9moreinner6CLASS18stMethodEv -moreinner::stMethod start: _ZN9moreinner6CLASS18stMethodEv -stMethod end: main -moreinner::stMethod end: main diff --git a/tests/Regression/RHEL6Feature-cpp-methods/golden.el8.out b/tests/Regression/RHEL6Feature-cpp-methods/golden.el8.out deleted file mode 100644 index 6ba6bc9..0000000 --- a/tests/Regression/RHEL6Feature-cpp-methods/golden.el8.out +++ /dev/null @@ -1,83 +0,0 @@ -StandaloneFunction start: _Z18StandaloneFunctionv -StandaloneFunction end: main -StandaloneFunction start: _ZN5inner18StandaloneFunctionEv -inner::StandaloneFunction start: _ZN5inner18StandaloneFunctionEv -StandaloneFunction end: main -inner::StandaloneFunction end: main -StandaloneFunction start: _ZN9moreinner18StandaloneFunctionEv -moreinner::StandaloneFunction start: _ZN9moreinner18StandaloneFunctionEv -StandaloneFunction end: main -moreinner::StandaloneFunction end: main -puMethod start: _ZN6CLASS18puMethodEv -prMethod start: _ZN6CLASS18prMethodEv -prMethod end: _ZN6CLASS18puMethodEv -puMethod end: main -stMethod start: _ZN6CLASS18stMethodEv -stMethod end: main -puMethod start: _ZN5inner6CLASS18puMethodEv -inner::puMethod start: _ZN5inner6CLASS18puMethodEv -prMethod start: _ZN5inner6CLASS18prMethodEv -inner::prMethod start: _ZN5inner6CLASS18prMethodEv -prMethod end: _ZN5inner6CLASS18puMethodEv -inner::prMethod end: _ZN5inner6CLASS18puMethodEv -puMethod end: main -inner::puMethod end: main -stMethod start: _ZN5inner6CLASS18stMethodEv -inner::stMethod start: _ZN5inner6CLASS18stMethodEv -stMethod end: main -inner::stMethod end: main -puMethod start: _ZN9moreinner6CLASS18puMethodEv -moreinner::puMethod start: _ZN9moreinner6CLASS18puMethodEv -prMethod start: _ZN9moreinner6CLASS18prMethodEv -moreinner::prMethod start: _ZN9moreinner6CLASS18prMethodEv -prMethod end: _ZN9moreinner6CLASS18puMethodEv -moreinner::prMethod end: _ZN9moreinner6CLASS18puMethodEv -puMethod end: main -moreinner::puMethod end: main -stMethod start: _ZN9moreinner6CLASS18stMethodEv -moreinner::stMethod start: _ZN9moreinner6CLASS18stMethodEv -stMethod end: main -moreinner::stMethod end: main -puMethod start: _ZN6CLASS18puMethodEv -prMethod start: _ZN6CLASS18prMethodEv -prMethod end: _ZN6CLASS18puMethodEv -puMethod end: main -stMethod start: _ZN6CLASS18stMethodEv -stMethod end: main -puMethod start: _ZN5inner6CLASS18puMethodEv -inner::puMethod start: _ZN5inner6CLASS18puMethodEv -prMethod start: _ZN5inner6CLASS18prMethodEv -inner::prMethod start: _ZN5inner6CLASS18prMethodEv -prMethod end: _ZN5inner6CLASS18puMethodEv -inner::prMethod end: _ZN5inner6CLASS18puMethodEv -puMethod end: main -inner::puMethod end: main -stMethod start: _ZN5inner6CLASS18stMethodEv -inner::stMethod start: _ZN5inner6CLASS18stMethodEv -stMethod end: main -inner::stMethod end: main -puMethod start: _ZN9moreinner6CLASS18puMethodEv -moreinner::puMethod start: _ZN9moreinner6CLASS18puMethodEv -prMethod start: _ZN9moreinner6CLASS18prMethodEv -moreinner::prMethod start: _ZN9moreinner6CLASS18prMethodEv -prMethod end: _ZN9moreinner6CLASS18puMethodEv -moreinner::prMethod end: _ZN9moreinner6CLASS18puMethodEv -puMethod end: main -moreinner::puMethod end: main -stMethod start: _ZN9moreinner6CLASS18stMethodEv -moreinner::stMethod start: _ZN9moreinner6CLASS18stMethodEv -stMethod end: main -moreinner::stMethod end: main -__StandaloneFunction=0 -__hitcount=70 -__inner_StandaloneFunction=0 -__moreinner_StandaloneFunction=0 -__stMethod=0 -__inner_CLASS1_stMethod=0 -__moreinner_star_stMethod=0 -__prMethod=0 -__inner_CLASS1_prMethod=0 -__moreinner_star_prMethod=0 -__puMethod=0 -__inner_CLASS1_puMethod=0 -__moreinner_star_puMethod=0 diff --git a/tests/Regression/RHEL6Feature-cpp-methods/golden.out b/tests/Regression/RHEL6Feature-cpp-methods/golden.out deleted file mode 100644 index fe9c7bb..0000000 --- a/tests/Regression/RHEL6Feature-cpp-methods/golden.out +++ /dev/null @@ -1,70 +0,0 @@ -StandaloneFunction start: StandaloneFunction -StandaloneFunction end: StandaloneFunction -StandaloneFunction start: StandaloneFunction -inner::StandaloneFunction start: inner::StandaloneFunction -inner::StandaloneFunction end: inner::StandaloneFunction -StandaloneFunction end: StandaloneFunction -StandaloneFunction start: StandaloneFunction -moreinner::StandaloneFunction start: moreinner::StandaloneFunction -moreinner::StandaloneFunction end: moreinner::StandaloneFunction -StandaloneFunction end: StandaloneFunction -puMethod start: puMethod -prMethod start: prMethod -prMethod end: prMethod -puMethod end: puMethod -stMethod start: stMethod -stMethod end: stMethod -puMethod start: puMethod -inner::puMethod start: inner::CLASS1::puMethod -prMethod start: prMethod -inner::prMethod start: inner::CLASS1::prMethod -inner::prMethod end: inner::CLASS1::prMethod -prMethod end: prMethod -inner::puMethod end: inner::CLASS1::puMethod -puMethod end: puMethod -stMethod start: stMethod -inner::stMethod start: inner::CLASS1::stMethod -inner::stMethod end: inner::CLASS1::stMethod -stMethod end: stMethod -puMethod start: puMethod -moreinner::puMethod start: moreinner::CLASS1::puMethod -prMethod start: prMethod -moreinner::prMethod start: moreinner::CLASS1::prMethod -moreinner::prMethod end: moreinner::CLASS1::prMethod -prMethod end: prMethod -moreinner::puMethod end: moreinner::CLASS1::puMethod -puMethod end: puMethod -stMethod start: stMethod -moreinner::stMethod start: moreinner::CLASS1::stMethod -moreinner::stMethod end: moreinner::CLASS1::stMethod -stMethod end: stMethod -puMethod start: puMethod -prMethod start: prMethod -prMethod end: prMethod -puMethod end: puMethod -stMethod start: stMethod -stMethod end: stMethod -puMethod start: puMethod -inner::puMethod start: inner::CLASS1::puMethod -prMethod start: prMethod -inner::prMethod start: inner::CLASS1::prMethod -inner::prMethod end: inner::CLASS1::prMethod -prMethod end: prMethod -inner::puMethod end: inner::CLASS1::puMethod -puMethod end: puMethod -stMethod start: stMethod -inner::stMethod start: inner::CLASS1::stMethod -inner::stMethod end: inner::CLASS1::stMethod -stMethod end: stMethod -puMethod start: puMethod -moreinner::puMethod start: moreinner::CLASS1::puMethod -prMethod start: prMethod -moreinner::prMethod start: moreinner::CLASS1::prMethod -moreinner::prMethod end: moreinner::CLASS1::prMethod -prMethod end: prMethod -moreinner::puMethod end: moreinner::CLASS1::puMethod -puMethod end: puMethod -stMethod start: stMethod -moreinner::stMethod start: moreinner::CLASS1::stMethod -moreinner::stMethod end: moreinner::CLASS1::stMethod -stMethod end: stMethod diff --git a/tests/Regression/RHEL6Feature-cpp-methods/runtest.sh b/tests/Regression/RHEL6Feature-cpp-methods/runtest.sh index 443ff56..a019d7a 100755 --- a/tests/Regression/RHEL6Feature-cpp-methods/runtest.sh +++ b/tests/Regression/RHEL6Feature-cpp-methods/runtest.sh @@ -30,16 +30,13 @@ . /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="systemtap" +export LANG=C rlJournalStart rlPhaseStartSetup rlRun "stap-prep" 0-255 rlRun "g++ -O0 classes.cpp -o classes -g" - - rlIsRHEL 6 && COMPAT='--compatible=1.8' - # rlIsRHEL 7 && cp -f golden.el7.out golden.out - # rlIsRHEL 8 && cp -f golden.el8.out golden.out rlPhaseEnd rlPhaseStartTest @@ -50,22 +47,25 @@ rlPhaseStartTest # rlRun "diff golden.out output.out" rlRun "grep ^__ output.out | sort > summary.out" + # The way sort works across test systems may differ + # esp wrt whether capitals go first or not, so let's sort + # the golden_summary.out first using actual defaults + # slash LANG etc... + rlRun "sort golden_summary.out > golden_summary.sort" + # RHEL6: covert hex to dec: rlRun "sed -i 's/0x0/0/' summary.out" rlRun "sed -i 's/0x46/70/' summary.out" # Sanity check - rlRun "diff golden_summary.out summary.out" || ( + rlRun "diff golden_summary.sort summary.out" || ( rlRun "cat golden_summary.out" rlRun "cat summary.out" ) rlPhaseEnd rlPhaseStartCleanup - rlFileSubmit golden.out - rlFileSubmit output.out - - rlRun "rm -f output.out classes" + rlRun "rm -f golden_summary.sort output.out summary.out classes" rlPhaseEnd rlJournalPrintText diff --git a/tests/Regression/python-probing/main.fmf b/tests/Regression/python-probing/main.fmf index 55b3281..f3abc74 100644 --- a/tests/Regression/python-probing/main.fmf +++ b/tests/Regression/python-probing/main.fmf @@ -9,10 +9,13 @@ framework: beakerlib recommend: - python - python-debuginfo +- python3-debuginfo +- python3.9-debuginfo - systemtap - python2 - python3 - elfutils +- yum-utils duration: 15m extra-summary: /CoreOS/python/Sanity/systemtap extra-task: /CoreOS/python/Sanity/systemtap diff --git a/tests/Regression/python-probing/runtest.sh b/tests/Regression/python-probing/runtest.sh index f4061ea..80f10f9 100755 --- a/tests/Regression/python-probing/runtest.sh +++ b/tests/Regression/python-probing/runtest.sh @@ -48,6 +48,10 @@ rlJournalStart rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" rlRun "cp list.stp top.stp test.py $TmpDir" 0 "Copying scripts" rlRun "pushd $TmpDir" + + # Install needed debuginfo, best effort + rlRun "L=$(stap -p2 -e 'probe python.function.entry {exit()}' | awk -F\" '/process/ {print $2}')" 0-255 + rlRun "debuginfo-install -y $L" 0-255 rlPhaseEnd rlPhaseStartTest "Verifying ELF file for presence of .probes section" diff --git a/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/nfs.proc.commit_done.c b/tests/Regression/wrong-data-returned-by-nfs-commit-done/nfs.proc.commit_done.c similarity index 96% rename from tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/nfs.proc.commit_done.c rename to tests/Regression/wrong-data-returned-by-nfs-commit-done/nfs.proc.commit_done.c index 0417d71..f7b5e9b 100644 --- a/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/nfs.proc.commit_done.c +++ b/tests/Regression/wrong-data-returned-by-nfs-commit-done/nfs.proc.commit_done.c @@ -7,7 +7,7 @@ #include #include -#define TEST_DIR "/systemtap-sts-nfs-share-and-mount-tmpdir/sts_mount" +#define TEST_DIR "/systemtap-sts-nfs-share-and-mount-tmpdir2/sts_mount" static int create_and_write(char *file_name); static int read_file(char *file_name); diff --git a/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/nfs.proc.commit_done.stp b/tests/Regression/wrong-data-returned-by-nfs-commit-done/nfs.proc.commit_done.stp similarity index 100% rename from tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/nfs.proc.commit_done.stp rename to tests/Regression/wrong-data-returned-by-nfs-commit-done/nfs.proc.commit_done.stp diff --git a/tests/Regression/wrong-data-returned-by-nfs-commit-done/runtest.sh b/tests/Regression/wrong-data-returned-by-nfs-commit-done/runtest.sh index 5543268..b33b035 100755 --- a/tests/Regression/wrong-data-returned-by-nfs-commit-done/runtest.sh +++ b/tests/Regression/wrong-data-returned-by-nfs-commit-done/runtest.sh @@ -31,42 +31,48 @@ . /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 "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" + 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 "make" - rlRun "./test-for-nfs" + 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 - 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 + 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 "./test-for-nfs -c" + 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" + rlRun "rm -r $TMPDIR $NFS_TMP" rlPhaseEnd rlJournalPrintText rlJournalEnd diff --git a/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/Makefile b/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/Makefile deleted file mode 100644 index 021de18..0000000 --- a/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -CFLAGS+= -Wall - -SRCS = $(wildcard *.c) -TARGETS = $(patsubst %.c,%,$(SRCS)) - -all: $(TARGETS) - -install: - -clean: - rm -f $(TARGETS) diff --git a/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/test-for-nfs b/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/test-for-nfs deleted file mode 100755 index 95579bc..0000000 --- a/tests/Regression/wrong-data-returned-by-nfs-commit-done/testpro/test-for-nfs +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash - -export NFS_TMP="$HOME/systemtap-sts-nfs-share-and-mount-tmpdir" - -nfs_service() -{ - local ret - local status="$1" - local OS_VER="$2" - - case "$status" in - restart) - ps -ef | grep "nfsd" | grep -v grep > /dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "nfsd already running!!" - return 0 - fi - - /bin/systemctl restart nfs-server.service - ret=$? - ;; - stop) - /bin/systemctl stop nfs-server.service - ret=$? - ;; - *) - echo "Error: nfs_service [stop|restart]" - ret=1 - ;; - esac - - return $ret -} - -clean_nfs_env() -{ - umount "$NFS_TMP"/sts_mount - /usr/sbin/exportfs -u 127.0.0.1:"$NFS_TMP"/sts_share - rm -rf "$NFS_TMP" - nfs_service stop - if [ $? -ne 0 ]; then - return 1 - else - echo "Info: The nfs env for test clean successfully." - return 0 - fi -} - -create_nfs_env() -{ - nfs_service restart - if [ $? -ne 0 ]; then - return 1 - fi - - sleep 1 - - mkdir -p "$NFS_TMP"/sts_share - mkdir -p "$NFS_TMP"/sts_mount - - /usr/sbin/exportfs -i -o 'rw,async,no_root_squash' 127.0.0.1:"$NFS_TMP"/sts_share - mount -t nfs 127.0.0.1:"$NFS_TMP"/sts_share "$NFS_TMP"/sts_mount - - return 0 -} - -if [ $# -gt 2 ]; then - echo "Usage: test-for-nfs [-c]" - exit 1 -fi - -case "$1" in --c) - clean_nfs_env - ret=$? - if [ $ret -ne 0 ]; then - echo "Error: cleaning the nfs env for test failed." - fi - ;; -*) - create_nfs_env - ret=$? - if [ $ret -eq 0 ]; then - echo "Info: The nfs env for test create successfully." - else - echo "Error: creating the nfs env for test failed." - fi - ;; -esac - -exit $ret