From cd59e55c7a893340174a308384eb29e6eef8deec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kadl=C4=8D=C3=ADk?= Date: Wed, 19 May 2021 13:16:01 +0200 Subject: [PATCH] Import RHEL's regression test for #1053765 --- .../Makefile | 64 +++++++++++++++++++ .../PURPOSE | 3 + .../main.fmf | 14 ++++ .../runtest.sh | 59 +++++++++++++++++ 4 files changed, 140 insertions(+) create mode 100644 tests/Regression/bz1053765-invalid-command-assertion-failure/Makefile create mode 100644 tests/Regression/bz1053765-invalid-command-assertion-failure/PURPOSE create mode 100644 tests/Regression/bz1053765-invalid-command-assertion-failure/main.fmf create mode 100755 tests/Regression/bz1053765-invalid-command-assertion-failure/runtest.sh diff --git a/tests/Regression/bz1053765-invalid-command-assertion-failure/Makefile b/tests/Regression/bz1053765-invalid-command-assertion-failure/Makefile new file mode 100644 index 0000000..d6c30c0 --- /dev/null +++ b/tests/Regression/bz1053765-invalid-command-assertion-failure/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/ltrace/Regression/bz1053765-invalid-command-assertion-failure +# Description: The test tries to ltrace a non-existing app, ltrace should handle that. +# Author: Michael Petlan +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 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/ltrace/Regression/bz1053765-invalid-command-assertion-failure +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: Michael Petlan " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: The test tries to ltrace a non-existing app, ltrace should handle that." >> $(METADATA) + @echo "Type: Regression" >> $(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: 1053765" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1053765-invalid-command-assertion-failure/PURPOSE b/tests/Regression/bz1053765-invalid-command-assertion-failure/PURPOSE new file mode 100644 index 0000000..9afbcc2 --- /dev/null +++ b/tests/Regression/bz1053765-invalid-command-assertion-failure/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/ltrace/Regression/bz1053765-invalid-command-assertion-failure +Description: The test tries to ltrace a non-existing app, ltrace should handle that. +Author: Michael Petlan diff --git a/tests/Regression/bz1053765-invalid-command-assertion-failure/main.fmf b/tests/Regression/bz1053765-invalid-command-assertion-failure/main.fmf new file mode 100644 index 0000000..75b068c --- /dev/null +++ b/tests/Regression/bz1053765-invalid-command-assertion-failure/main.fmf @@ -0,0 +1,14 @@ +summary: The test tries to ltrace a non-existing app, ltrace should handle that. +description: '' +contact: Michael Petlan +component: +- ltrace +test: ./runtest.sh +framework: beakerlib +recommend: +- ltrace +duration: 5m +link: +- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1053765 +extra-summary: /tools/ltrace/Regression/bz1053765-invalid-command-assertion-failure +extra-task: /tools/ltrace/Regression/bz1053765-invalid-command-assertion-failure diff --git a/tests/Regression/bz1053765-invalid-command-assertion-failure/runtest.sh b/tests/Regression/bz1053765-invalid-command-assertion-failure/runtest.sh new file mode 100755 index 0000000..1a18424 --- /dev/null +++ b/tests/Regression/bz1053765-invalid-command-assertion-failure/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/ltrace/Regression/bz1053765-invalid-command-assertion-failure +# Description: The test tries to ltrace a non-existing app, ltrace should handle that. +# Author: Michael Petlan +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2014 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 + +PACKAGE="$(rpm -qf $(which ltrace))" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "{ ltrace blahblahblah0123546213208412321 2> err.log > out.log; } 2> superr.log" 1 "Running ltrace with a non-existing binary." + rlAssertNotGrep "Aborted" superr.log + rlAssertNotGrep "destroy" err.log + rlAssertNotGrep "Assertion" err.log + rlAssertNotGrep "assertion" err.log + rlAssertNotGrep "relocs" err.log + rlAssertNotGrep "failed" err.log + echo "==== stderr ====" + cat err.log + echo "==== stdout ====" + cat out.log + echo "==== external stderr ====" + cat superr.log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm err.log out.log superr.log" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd