Import a regression test from RHEL.
Sorry, no specific bug number, it wasn't recorded at that time and now I can't find it, at least easily.
This commit is contained in:
parent
f20f6a9ea6
commit
d73a4e1684
64
tests/Regression/pthread-program-assertion-failure/Makefile
Normal file
64
tests/Regression/pthread-program-assertion-failure/Makefile
Normal file
@ -0,0 +1,64 @@
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Makefile of /tools/ltrace/Regression/pthread-program-assertion-failure
|
||||
# Description: pthread-program-assertion-failure
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 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/Regression/pthread-program-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: Martin Cermak <mcermak@redhat.com>" > $(METADATA)
|
||||
@echo "Name: $(TEST)" >> $(METADATA)
|
||||
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
|
||||
@echo "Path: $(TEST_DIR)" >> $(METADATA)
|
||||
@echo "Description: pthread-program-assertion-failure" >> $(METADATA)
|
||||
@echo "Type: Regression" >> $(METADATA)
|
||||
@echo "TestTime: 10m" >> $(METADATA)
|
||||
@echo "RunFor: ltrace" >> $(METADATA)
|
||||
@echo "Requires: ltrace" >> $(METADATA)
|
||||
@echo "Requires: gcc" >> $(METADATA)
|
||||
@echo "Requires: glibc-devel" >> $(METADATA)
|
||||
@echo "Priority: Normal" >> $(METADATA)
|
||||
@echo "License: GPLv2+" >> $(METADATA)
|
||||
@echo "Confidential: no" >> $(METADATA)
|
||||
@echo "Destructive: no" >> $(METADATA)
|
||||
|
||||
rhts-lint $(METADATA)
|
||||
@ -0,0 +1,6 @@
|
||||
PURPOSE of /tools/ltrace/Regression/pthread-program-assertion-failure
|
||||
Description: pthread-program-assertion-failure
|
||||
Author: Martin Cermak <mcermak@redhat.com>
|
||||
|
||||
Issue reproduced using an f20 arm (32 bit) fedora system with ltrace-0.7.91-13.fc22.armv7hl.
|
||||
|
||||
16
tests/Regression/pthread-program-assertion-failure/main.fmf
Normal file
16
tests/Regression/pthread-program-assertion-failure/main.fmf
Normal file
@ -0,0 +1,16 @@
|
||||
summary: pthread-program-assertion-failure
|
||||
description: |+
|
||||
Issue reproduced using an f20 arm (32 bit) fedora system with ltrace-0.7.91-13.fc22.armv7hl.
|
||||
|
||||
contact: Martin Cermak <mcermak@redhat.com>
|
||||
component:
|
||||
- ltrace
|
||||
test: ./runtest.sh
|
||||
framework: beakerlib
|
||||
recommend:
|
||||
- ltrace
|
||||
- gcc
|
||||
- glibc-devel
|
||||
duration: 10m
|
||||
extra-summary: /tools/ltrace/Regression/pthread-program-assertion-failure
|
||||
extra-task: /tools/ltrace/Regression/pthread-program-assertion-failure
|
||||
83
tests/Regression/pthread-program-assertion-failure/runtest.sh
Executable file
83
tests/Regression/pthread-program-assertion-failure/runtest.sh
Executable file
@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# runtest.sh of /tools/ltrace/Regression/pthread-program-assertion-failure
|
||||
# Description: pthread-program-assertion-failure
|
||||
# Author: Martin Cermak <mcermak@redhat.com>
|
||||
#
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#
|
||||
# Copyright (c) 2015 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
|
||||
|
||||
PACKAGE="$(rpm -qf $(which ltrace))"
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm $PACKAGE
|
||||
rlAssertRpm $(rpm -qf $(which gcc))
|
||||
rlRun "TMP=\$(mktemp -d)"
|
||||
rlRun "pushd $TMP"
|
||||
cat > test.c <<EOF
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern void print (char *);
|
||||
|
||||
#define PRINT_LOOP 10
|
||||
|
||||
void *
|
||||
th_main (void *arg)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<PRINT_LOOP; i++)
|
||||
printf (arg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
pthread_t thread1;
|
||||
pthread_t thread2;
|
||||
pthread_t thread3;
|
||||
pthread_create (&thread1, NULL, th_main, "aaa");
|
||||
pthread_create (&thread2, NULL, th_main, "bbb");
|
||||
pthread_create (&thread3, NULL, th_main, "ccc");
|
||||
pthread_join (thread1, NULL);
|
||||
pthread_join (thread2, NULL);
|
||||
pthread_join (thread3, NULL);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
rlRun "gcc -lpthread test.c"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "ltrace -L ./a.out"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $TMP"
|
||||
rlPhaseEnd
|
||||
rlJournalPrintText
|
||||
rlJournalEnd
|
||||
Loading…
Reference in New Issue
Block a user