Import RHEL's regression test for #1053765

This commit is contained in:
Václav Kadlčík 2021-05-19 13:16:01 +02:00
parent dc3264a1bc
commit cd59e55c7a
4 changed files with 140 additions and 0 deletions

View File

@ -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 <mpetlan@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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 <mpetlan@redhat.com>" > $(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)

View File

@ -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 <mpetlan@redhat.com>

View File

@ -0,0 +1,14 @@
summary: The test tries to ltrace a non-existing app, ltrace should handle that.
description: ''
contact: Michael Petlan <mpetlan@redhat.com>
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

View File

@ -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 <mpetlan@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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