diff --git a/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/Makefile b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/Makefile new file mode 100644 index 0000000..dc867e7 --- /dev/null +++ b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/ltrace/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support +# Description: Test for BZ#1449588 (Can ltrace be built with backtrace support?) +# Author: Edjunior Machado +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/ltrace/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.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: Edjunior Machado " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1449588 (Can ltrace be built with backtrace support?)" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: ltrace" >> $(METADATA) + @echo "Requires: ltrace" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1449588" >> $(METADATA) + @echo "Releases: -RHEL4 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/PURPOSE b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/PURPOSE new file mode 100644 index 0000000..6da4e88 --- /dev/null +++ b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/ltrace/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support +Description: Test for BZ#1449588 (Can ltrace be built with backtrace support?) +Author: Edjunior Machado +Bug summary: Can ltrace be built with backtrace support? +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1449588 diff --git a/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/main.fmf b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/main.fmf new file mode 100644 index 0000000..91de65d --- /dev/null +++ b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1449588 (Can ltrace be built with backtrace support?) +description: | + Bug summary: Can ltrace be built with backtrace support? + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1449588 +contact: Edjunior Machado +component: +- ltrace +test: ./runtest.sh +framework: beakerlib +recommend: +- ltrace +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1449588 +extra-summary: /tools/ltrace/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support +extra-task: /tools/ltrace/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support diff --git a/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/runtest.sh b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/runtest.sh new file mode 100755 index 0000000..829db70 --- /dev/null +++ b/tests/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support/runtest.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/ltrace/Sanity/bz1449588-Can-ltrace-be-built-with-backtrace-support +# Description: Test for BZ#1449588 (Can ltrace be built with backtrace support?) +# Author: Edjunior Machado +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2018 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# 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, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +CMD="ltrace" +PACKAGE=$(rpm -qf $(which $CMD)) + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + set -o pipefail + rlRun -l "ltrace --help |& tee help-output.log" 0 "Collecting help output" + rlRun -l "grep -- '-w, --where=NR.*print backtrace showing NR stack frames at most.' help-output.log" 0 "Checking if '-w, --where=NR' parameter is available on help output" + rlRun -l "ltrace -w 4 /bin/ls" 0 "Trivial smoke test" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd