From 17fcd94e047c3f0839d5ed4b6bc3bc5bb041eb6b Mon Sep 17 00:00:00 2001 From: Jesus Checa Hidalgo Date: Apr 13 2022 08:01:16 +0000 Subject: Run tests from https://src.fedoraproject.org/tests/valgrind --- diff --git a/plans/ci.fmf b/plans/ci.fmf index 85710d6..fc00c44 100644 --- a/plans/ci.fmf +++ b/plans/ci.fmf @@ -1,6 +1,6 @@ -summary: CI Gating Plan +summary: CI test plan, runs all tests from tests repo. discover: how: fmf - directory: tests + url: https://src.fedoraproject.org/tests/valgrind execute: how: tmt diff --git a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/Makefile b/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/Makefile deleted file mode 100644 index 6f2afaf..0000000 --- a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /tools/valgrind/Sanity/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through -# Description: Test for BZ#672959 ([RFE] Integrate valgrind with gdb possibly through) -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2012 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. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/tools/valgrind/Sanity/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE something.c error.gdb noerror.gdb - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Miroslav Franc " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Test for BZ#672959 ([RFE] Integrate valgrind with gdb possibly through)" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 30m" >> $(METADATA) - @echo "RunFor: valgrind" >> $(METADATA) - @echo "Requires: valgrind gcc gdb glibc-debuginfo" >> $(METADATA) - @echo "Requires: glibc-devel" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Bug: 672959" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/PURPOSE b/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/PURPOSE deleted file mode 100644 index 6d2c0bf..0000000 --- a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/PURPOSE +++ /dev/null @@ -1,7 +0,0 @@ -PURPOSE of /tools/valgrind/Sanity/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through -Description: Test for BZ#672959 ([RFE] Integrate valgrind with gdb possibly through) -Author: Miroslav Franc -Bug summary: [RFE] Integrate valgrind with gdb possibly through gdbserver. -Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=672959 - -This is small sanity test to make sure gdb works with valgrind gdb server. diff --git a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/error.gdb b/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/error.gdb deleted file mode 100644 index 199cc5c..0000000 --- a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/error.gdb +++ /dev/null @@ -1,5 +0,0 @@ -target remote | vgdb -c -p var -c -q diff --git a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/main.fmf b/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/main.fmf deleted file mode 100644 index c7989c5..0000000 --- a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/main.fmf +++ /dev/null @@ -1,20 +0,0 @@ -summary: Test for BZ#672959 ([RFE] Integrate valgrind with gdb possibly through) -description: | - Bug summary: [RFE] Integrate valgrind with gdb possibly through gdbserver. - Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=672959 - - This is small sanity test to make sure gdb works with valgrind gdb server. -contact: Miroslav Franc -component: -- valgrind -test: ./runtest.sh -framework: beakerlib -recommend: -- valgrind -- gcc -- gdb -- glibc-debuginfo -- glibc-devel -duration: 30m -extra-summary: /tools/valgrind/Sanity/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through -extra-task: /tools/valgrind/Sanity/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through diff --git a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/noerror.gdb b/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/noerror.gdb deleted file mode 100644 index 147ed30..0000000 --- a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/noerror.gdb +++ /dev/null @@ -1,6 +0,0 @@ -target remote | vgdb -b something.c:10 -c -set (a=5) -c -q diff --git a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/runtest.sh b/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/runtest.sh deleted file mode 100755 index 4e025fa..0000000 --- a/tests/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through/runtest.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /tools/valgrind/Sanity/bz672959-RFE-Integrate-valgrind-with-gdb-possibly-through -# Description: Test for BZ#672959 ([RFE] Integrate valgrind with gdb possibly through) -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2012 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=$(rpm --qf "%{name}\n" -qf $(which valgrind) | head -1) -PACKAGES=(valgrind gcc gdb) - -# Expect 1th argument as a path to binary to test with -_test_routine() -{ - local binary=$1 - - rlPhaseStartTest "$binary error" - rlAssertExists "$binary" - rlLog "valgrind gdb server..." - valgrind --vex-iropt-register-updates=allregs-at-mem-access --vgdb-error=0 ./$binary > vloge 2>&1 & - vpid=$! - sleep 5 - rlRun "gdb -x error.gdb ./$binary > gloge 2>&1" - [[ -d /proc/$vpid ]] && { kill -9 $vpid; rlFail "oops: valgrind still running..."; } - rlRun "wait $vpid" - rlAssertGrep '19.*if(x)' gloge - rlAssertGrep '$1 = 42' gloge - # there should be exactly one error - rlAssertGrep 'ERROR SUMMARY: 1 errors from 1 contexts' vloge - rlLog "> gdb output <" - rlLog "$( valgrind output <" - rlLog "$( vlogn 2>&1 & - vpid=$! - sleep 5 - rlRun "gdb -x noerror.gdb ./$binary > glogn 2>&1" - [[ -d /proc/$vpid ]] && { kill -9 $vpid; rlFail "oops: valgrind still running..."; } - rlRun "wait $vpid" - rlAssertGrep '10.*f(a);' glogn - # this time, no errors - rlAssertGrep 'ERROR SUMMARY: 0 errors from 0 contexts' vlogn - rlAssertGrep 'hello, world' vlogn - rlLog "> gdb output <" - rlLog "$( valgrind output <" - rlLog "$( - -void f (int x); - -int -main (int argc, char *argv[]) -{ - int a; - - f(a); - - return 0; -} - -void -f (int x) -{ - static int var __attribute__ ((used)) = 42; - if(x) - puts("hello, world"); -} diff --git a/tests/does-Image-Magick-works-under-valgrind/Makefile b/tests/does-Image-Magick-works-under-valgrind/Makefile deleted file mode 100644 index 67799aa..0000000 --- a/tests/does-Image-Magick-works-under-valgrind/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /tools/valgrind/Sanity/does-Image-Magick-works-under-valgrind -# Description: Testing sanity of valgrind by comparing outputs of ImageMagick utilities with/without valgrind. -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 or later. -# -# 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. -# -# The image munich.jpg used in this test is from: -# https://en.wikipedia.org/wiki/File:Frauenkirche_and_Neues_Rathaus_Munich_March_2013.JPG. -# munich.jpg file is distributed under the Creative Commons -# Attribution-Share Alike 3.0 Unported license -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/tools/valgrind/Sanity/does-Image-Magick-works-under-valgrind -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE munich.jpg - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Miroslav Franc " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Testing sanity of valgrind by comparing outputs of ImageMagick utilities with/without valgrind." >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 3h" >> $(METADATA) - @echo "RunFor: valgrind" >> $(METADATA) - @echo "Requires: valgrind ImageMagick" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Releases: RHEL6 RHEL7" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/does-Image-Magick-works-under-valgrind/PURPOSE b/tests/does-Image-Magick-works-under-valgrind/PURPOSE deleted file mode 100644 index fd23e2c..0000000 --- a/tests/does-Image-Magick-works-under-valgrind/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /tools/valgrind/Sanity/does-Image-Magick-works-under-valgrind -Description: Testing sanity of valgrind by comparing outputs of ImageMagick utilities with/without valgrind. -Author: Miroslav Franc diff --git a/tests/does-Image-Magick-works-under-valgrind/main.fmf b/tests/does-Image-Magick-works-under-valgrind/main.fmf deleted file mode 100644 index 042dd60..0000000 --- a/tests/does-Image-Magick-works-under-valgrind/main.fmf +++ /dev/null @@ -1,14 +0,0 @@ -summary: Testing sanity of valgrind by comparing outputs of ImageMagick utilities - with/without valgrind. -description: '' -contact: Alexandra Hajkova -component: -- valgrind -test: ./runtest.sh -framework: beakerlib -recommend: -- valgrind -- ImageMagick -duration: 3h -extra-summary: /tools/valgrind/Sanity/does-Image-Magick-works-under-valgrind -extra-task: /tools/valgrind/Sanity/does-Image-Magick-works-under-valgrind diff --git a/tests/does-Image-Magick-works-under-valgrind/munich.jpg b/tests/does-Image-Magick-works-under-valgrind/munich.jpg deleted file mode 100644 index 6250ed6..0000000 Binary files a/tests/does-Image-Magick-works-under-valgrind/munich.jpg and /dev/null differ diff --git a/tests/does-Image-Magick-works-under-valgrind/runtest.sh b/tests/does-Image-Magick-works-under-valgrind/runtest.sh deleted file mode 100755 index be62adf..0000000 --- a/tests/does-Image-Magick-works-under-valgrind/runtest.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /tools/valgrind/Sanity/does-Image-Magick-works-under-valgrind -# Description: Testing sanity of valgrind by comparing outputs of ImageMagick utilities with/without valgrind. -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 or later. -# -# 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. -# -# The image munich.jpg used in this test is from: -# https://en.wikipedia.org/wiki/File:Frauenkirche_and_Neues_Rathaus_Munich_March_2013.JPG. -# munich.jpg file is distributed under the Creative Commons -# Attribution-Share Alike 3.0 Unported license -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include rhts environment -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -VALGRIND="${VALGRIND:-$(which valgrind)}" -PACKAGES="${PACKAGES:-$(rpm --qf '%{name}\n' -qf $(which $VALGRIND) | head -1)}" -REQUIRES="${REQUIRES:-ImageMagick}" - -Picture="munich.jpg" -Formats=(jpg gif) -Options=(-flop - -flip - -resize\ 160x100 - -resize\ 50\\\% - -sharpen\ 5x5 - -equalize - -motion-blur\ 20x5 - -paint\ 3x3 - -radial-blur\ 5 - -posterize\ 10 - ) - - -rlJournalStart - rlPhaseStartSetup - rlLogInfo "VALGRIND=$VALGRIND" - rlLogInfo "PACKAGES=$PACKAGES" - rlLogInfo "REQUIRES=$REQUIRES" - rlLogInfo "COLLECTIONS=$COLLECTIONS" - rlLogInfo "$(type valgrind)" - - rlAssertRpm --all - - rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" - rlRun "cp $Picture $TmpDir" 0 "Copying $Picture to $TmpDir" - rlRun "pushd $TmpDir" - rlRun "mkdir out" 0 "Creating out directory" - rlPhaseEnd - - for f in "${Formats[@]}"; do - for o in "${Options[@]}"; do - rlPhaseStartTest "convert $o $Picture out/0${Picture%jpg}$f" - rlRun "convert $o $Picture out/0${Picture%jpg}$f" 0 "Converting $Picture to out/0${Picture%jpg}$f with ($o)" - rlLog "convert $o $Picture out/0${Picture%jpg}$f" - rlRun "valgrind convert $o $Picture out/1${Picture%jpg}$f" 0 "Converting $Picture to out/1${Picture%jpg}$f with ($o) [valgrind]" - rlLog "valgrind convert $o $Picture out/1${Picture%jpg}$f" - [[ $(arch) = i686 ]] || rlRun "echo \`md5sum out/[01]${Picture%jpg}$f\` | while read with nic without nic; do test \"\$with\" = \"\$without\";done" 0 "Output is the same with/without valgrind" - md5sum out/[01]${Picture%jpg}$f - rlPhaseEnd - rlPhaseStartCleanup "Cleaning for $f with $o" - rlRun "mkdir -p \"out-$o\"" - rlRun "cp -r out/* \"out-$o/\"" - rlRun "rm -f out/*" 0 "Removing the old pictures" - rlPhaseEnd - done - done - - rlPhaseStartCleanup - rlRun "rm -rf out" - rlRun "tar czf out.tgz $TmpDir/*" - rlFileSubmit "out.tgz" - rlRun "popd" - rlRun "rm -r $TmpDir" 0 "Removing tmp directory" - rlPhaseEnd -rlJournalPrintText -rlJournalEnd diff --git a/tests/does-hunspell-works-under-valgrind/Makefile b/tests/does-hunspell-works-under-valgrind/Makefile deleted file mode 100644 index 4a33045..0000000 --- a/tests/does-hunspell-works-under-valgrind/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 or later. -# -# 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. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Miroslav Franc " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Testing sanity of valgrind by comparing outputs of hunspell with/without valgrind." >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 20m" >> $(METADATA) - @echo "RunFor: valgrind" >> $(METADATA) - @echo "Requires: valgrind hunspell" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/does-hunspell-works-under-valgrind/main.fmf b/tests/does-hunspell-works-under-valgrind/main.fmf deleted file mode 100644 index 11d22f7..0000000 --- a/tests/does-hunspell-works-under-valgrind/main.fmf +++ /dev/null @@ -1,17 +0,0 @@ -summary: Testing sanity of valgrind by comparing outputs of hunspell with/without valgrind. -description: | - This test is simplified version of the older RHEL does-aspell-works-under-valgrind test. - - The test collects README files and try to run spellchecker on them with and without valgrind. The output should be the same. - -contact: Alexandra Petlanova -component: -- valgrind -test: ./runtest.sh -framework: beakerlib -recommend: -- valgrind -- hunspell -duration: 5m -extra-summary: /tools/valgrind/Sanity/does-hunspell-works-under-valgrind -extra-task: /tools/valgrind/Sanity/does-hunspell-works-under-valgrind diff --git a/tests/does-hunspell-works-under-valgrind/runtest.sh b/tests/does-hunspell-works-under-valgrind/runtest.sh deleted file mode 100755 index 91caef3..0000000 --- a/tests/does-hunspell-works-under-valgrind/runtest.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Description: Testing sanity of valgrind by comparing outputs of hunspell with/without valgrind. -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 or later. -# -# 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 rhts environment -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -SPELL_CHECKER="${SPELL_CHECKER:-hunspell}" - -VALGRIND="${VALGRIND:-$(which valgrind)}" -PACKAGES="${PACKAGES:-$(rpm --qf '%{name}\n' -qf $(which $VALGRIND) | head -1)}" -REQUIRES="${REQUIRES:-$SPELL_CHECKER}" - -rlJournalStart - rlPhaseStartSetup - rlLogInfo "VALGRIND=$VALGRIND" - rlLogInfo "PACKAGES=$PACKAGES" - rlLogInfo "REQUIRES=$REQUIRES" - rlLogInfo "SPELL_CHECKER=$SPELL_CHECKER" - rlLogInfo "$(type valgrind)" - - rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory" - rlRun "pushd $TmpDir" - rlPhaseEnd - - rlPhaseStartTest - - rlRun "echo \"NEWSX\"|hunspell -a;echo -e '#include \nclock_t clock(void) { return 0; }'|gcc -o libclock.so -Wall -g -shared -fPIC -x c -;echo "NEWSX"|LD_PRELOAD=./libclock.so hunspell -a > out" - - rlRun "echo \"NEWSX\"|hunspell -a;echo -e '#include \nclock_t clock(void) { return 0; }'|gcc -o libclock.so -Wall -g -shared -fPIC -x c -;echo \"NEWSX\"|LD_PRELOAD=./libclock.so valgrind -q hunspell -a > valgrind_out" - - # Remove dictionary to avoid possibility of different results with - # already present dictionary. After this all commands start with - # the clean sheet. - rlRun "rm -f $HOME/.hunspell_en_US" - - rlAssertNotDiffer "out" "valgrind_out" - [ "$?" -ne 0 ] && rlLogWarning "$(diff out valgrind_out)" - rlPhaseEnd - - rlPhaseStartCleanup - rlRun "popd" # $TmpDir - rlRun "rm -r $TmpDir" 0 "Removing tmp directory" - rlPhaseEnd -rlJournalPrintText -rlJournalEnd diff --git a/tests/quick-valgrind-sanity/Makefile b/tests/quick-valgrind-sanity/Makefile deleted file mode 100644 index e708552..0000000 --- a/tests/quick-valgrind-sanity/Makefile +++ /dev/null @@ -1,64 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /tools/valgrind/Sanity/quick-valgrind-sanity -# Description: Very fast check that valgrind is working -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/tools/valgrind/Sanity/quick-valgrind-sanity -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE unitialized.c rv.c alloc.c - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Miroslav Franc " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Very fast check that valgrind is working" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 15m" >> $(METADATA) - @echo "RunFor: valgrind" >> $(METADATA) - @echo "Requires: gcc valgrind-devel" >> $(METADATA) - @echo "Requires: glibc-devel glibc-devel.ppc glibc-devel.s390 glibc-devel.i686" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/quick-valgrind-sanity/PURPOSE b/tests/quick-valgrind-sanity/PURPOSE deleted file mode 100644 index c87c6e6..0000000 --- a/tests/quick-valgrind-sanity/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /tools/valgrind/Sanity/quick-valgrind-sanity -Description: Very fast check that valgrind is working -Author: Miroslav Franc diff --git a/tests/quick-valgrind-sanity/alloc.c b/tests/quick-valgrind-sanity/alloc.c deleted file mode 100644 index 3c03816..0000000 --- a/tests/quick-valgrind-sanity/alloc.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - void *buffer = malloc(atoi(argv[1])); - VALGRIND_DO_LEAK_CHECK; - free(buffer); - return 0; -} diff --git a/tests/quick-valgrind-sanity/main.fmf b/tests/quick-valgrind-sanity/main.fmf deleted file mode 100644 index c80e992..0000000 --- a/tests/quick-valgrind-sanity/main.fmf +++ /dev/null @@ -1,16 +0,0 @@ -summary: Basic smoke test. -description: 'Very fast check that valgrind is working' -contact: -- Alexandra Petlanova Hajkova -component: -- valgrind -test: ./runtest.sh -framework: beakerlib -recommend: -- valgrind -- valgrind-devel -- gcc -- make -duration: 15m -extra-summary: /tools/valgrind/Sanity/quick-valgrind-sanity -extra-task: /tools/valgrind/Sanity/quick-valgrind-sanity diff --git a/tests/quick-valgrind-sanity/runtest.sh b/tests/quick-valgrind-sanity/runtest.sh deleted file mode 100755 index bbbeab1..0000000 --- a/tests/quick-valgrind-sanity/runtest.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /tools/valgrind/Sanity/quick-valgrind-sanity -# Description: Very fast check that valgrind is working -# Author: Miroslav Franc -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 - -VALGRIND="${VALGRIND:-$(which valgrind)}" -PACKAGES="${PACKAGES:-$(rpm --qf '%{name}\n' -qf $(which $VALGRIND) | head -1)}" - -rlJournalStart - rlPhaseStartSetup - rlLogInfo "VALGRIND=$VALGRIND" - rlLogInfo "PACKAGES=$PACKAGES" - rlLogInfo "REQUIRES=$REQUIRES" - rlLogInfo "$(type valgrind)" - rlLogInfo "$(type gcc)" - - rlLogInfo "SKIP_COLLECTION_METAPACKAGE_CHECK=$SKIP_COLLECTION_METAPACKAGE_CHECK" - - # We optionally need to skip checking for the presence of the metapackage - # because that would pull in all the dependent toolset subrpms. We do not - # always want that, especially in CI. - _COLLECTIONS="$COLLECTIONS" - if ! test -z $SKIP_COLLECTION_METAPACKAGE_CHECK; then - for c in $SKIP_COLLECTION_METAPACKAGE_CHECK; do - rlLogInfo "ignoring metapackage check for collection $c" - export COLLECTIONS=$(shopt -s extglob && echo ${COLLECTIONS//$c/}) - done - fi - - rlLogInfo "(without skipped) COLLECTIONS=$COLLECTIONS" - - rlAssertRpm --all - - export COLLECTIONS="$_COLLECTIONS" - - rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" - rlRun "cp unitialized.c rv.c alloc.c $TmpDir" - rlRun "pushd $TmpDir" - rlRun "gcc -g unitialized.c -o unitialized" - rlPhaseEnd - - rlPhaseStartTest "good" - rlRun "valgrind --log-file=./log0 ./unitialized 0" 42 - rlAssertNotGrep 'contains uninitialised byte' ./log0 - rlAssertGrep 'ERROR SUMMARY: 0' ./log0 - rlLog "$( with-valgrind" - rlAssertGrep "I'm running on valgrind" with-valgrind - rlLog "$( without-valgrind" - rlAssertGrep "I'm not running on valgrind" without-valgrind - rlLog "$( -#include - -int main() -{ - if(RUNNING_ON_VALGRIND) - puts("I'm running on valgrind \\o/"); - else - puts("I'm not running on valgrind /o\\"); - - return 0; -} diff --git a/tests/quick-valgrind-sanity/unitialized.c b/tests/quick-valgrind-sanity/unitialized.c deleted file mode 100644 index 99de47e..0000000 --- a/tests/quick-valgrind-sanity/unitialized.c +++ /dev/null @@ -1,30 +0,0 @@ -/* valgrind ./a.out 0 ~> no error */ -/* valgrind ./a.out 1 ~> error */ - -#include - -struct something { - char c; - int x; -}; -/* === 8 bytes === - * 42 - * garbage - * garbage - * garbage - * 42 - * 42 - * 42 - * 42 - */ - - -int main(int argc, char *argv[]) -{ - struct something st = { 0x2A, 0x2A2A2A2A }; - - struct something st_copy = st; - - return (int) *(&(st_copy.c)+atoi(argv[1])); -} -/* error generated after main returns */