diff --git a/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/Makefile b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/Makefile new file mode 100644 index 0000000..3d930e4 --- /dev/null +++ b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE +# Description: Test for BZ#1330705 (open() and openat() ignore 'mode' with O_TMPFILE) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 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/glibc/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE o_tmpfile.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1330705 (open() and openat() ignore 'mode' with O_TMPFILE)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 2h" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1330705" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/PURPOSE b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/PURPOSE new file mode 100644 index 0000000..779fa7f --- /dev/null +++ b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/PURPOSE @@ -0,0 +1,8 @@ +PURPOSE of /tools/glibc/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE +Description: Test for BZ#1330705 (open() and openat() ignore 'mode' with O_TMPFILE) +Author: Sergey Kolosov +Bug summary: open() and openat() ignore 'mode' with O_TMPFILE on newer kernels +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1330705 + +The test program calls openat with __O_TMPFILE(O_TMPFILE) flag and checks if a file was created with right mode(0600). +The kernel must support O_TMPFILE(be >= 3.11, or with the backported feature). diff --git a/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/main.fmf b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/main.fmf new file mode 100644 index 0000000..973d679 --- /dev/null +++ b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/main.fmf @@ -0,0 +1,20 @@ +summary: Test for BZ#1330705 (open() and openat() ignore 'mode' with O_TMPFILE) +description: | + Bug summary: open() and openat() ignore 'mode' with O_TMPFILE on newer kernels + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1330705 + + The test program calls openat with __O_TMPFILE(O_TMPFILE) flag and checks if a file was created with right mode(0600). + The kernel must support O_TMPFILE(be >= 3.11, or with the backported feature). +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1330705 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - gcc +duration: 2h +extra-summary: /tools/glibc/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE +extra-task: /tools/glibc/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE diff --git a/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/o_tmpfile.c b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/o_tmpfile.c new file mode 100644 index 0000000..8b0ceda --- /dev/null +++ b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/o_tmpfile.c @@ -0,0 +1,58 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* from /usr/include/bits/fcntl-linux.h in newer glibc */ +#ifndef __O_TMPFILE +#pragma message "__O_TMPFILE is not defined!" +# define __O_TMPFILE (020000000 | __O_DIRECTORY) +//# define O_TMPFILE __O_TMPFILE /* Atomically create nameless file. */ +#endif + +int main() +{ + int fd, kfd; + char path[PATH_MAX], tmp[PATH_MAX]; + struct stat statbuf; + + kfd = syscall(SYS_openat, AT_FDCWD, ".", __O_TMPFILE | O_RDWR, 0600); + if (kfd == -1) { + if (errno == EISDIR || errno == ENOTSUP) { + printf("__O_TMPFILE not supported by kernel, next checks dont make sense!\n"); + exit(10); + } + } + + fd = openat(AT_FDCWD, ".", __O_TMPFILE | O_RDWR, 0600); + if (fd == -1) { + if (errno == EISDIR || errno == ENOTSUP) { + printf("__O_TMPFILE not supported by glibc\n"); + exit(EXIT_FAILURE); + } + } + + snprintf(path, PATH_MAX, "/proc/self/fd/%d", fd); + readlink(path, tmp, PATH_MAX); + printf("%s -> %s file created with __O_TMPFILE\n", path, tmp); + + if (stat(path, &statbuf) == -1) { + perror("stat"); + exit(EXIT_FAILURE); + } + + printf("%s has mode 0%o\n", path, statbuf.st_mode & ~S_IFMT); + + if ((statbuf.st_mode & ~S_IFMT) != 0600) { + printf("FAIL: mode is not 0600\n"); + exit(EXIT_FAILURE); + } + + return 0; +} diff --git a/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/runtest.sh b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/runtest.sh new file mode 100755 index 0000000..ed49a08 --- /dev/null +++ b/tests/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE/runtest.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1330705-open-and-openat-ignore-mode-with-O-TMPFILE +# Description: Test for BZ#1330705 (open() and openat() ignore 'mode' with O_TMPFILE) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 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="glibc" +TESTPROG="o_tmpfile" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlShowRunningKernel + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG &> log" + rlAssertNotGrep "__O_TMPFILE is not defined" log + rlAssertExists "$TESTPROG" + rlRun -l "./${TESTPROG}" 0,10 + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/Makefile b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/Makefile new file mode 100644 index 0000000..be55ec6 --- /dev/null +++ b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1561018-glibc-Enable-annobin-annotations +# Description: Test for BZ#1561018 (glibc Enable annobin annotations) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/glibc/Regression/bz1561018-glibc-Enable-annobin-annotations +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: Alexandra Hájková " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1561018 (glibc Enable annobin annotations)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1561018" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/PURPOSE b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/PURPOSE new file mode 100644 index 0000000..f327055 --- /dev/null +++ b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1561018-glibc-Enable-annobin-annotations +Description: Test for BZ#1561018 (glibc Enable annobin annotations) +Author: Alexandra Hájková +Bug summary: glibc: Enable annobin annotations +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1561018 diff --git a/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/main.fmf b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/main.fmf new file mode 100644 index 0000000..68c42bd --- /dev/null +++ b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#1561018 (glibc Enable annobin annotations) +description: | + Bug summary: glibc: Enable annobin annotations + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1561018 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1561018 +contact: Alexandra Hájková +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc +duration: 1h +extra-summary: /tools/glibc/Regression/bz1561018-glibc-Enable-annobin-annotations +extra-task: /tools/glibc/Regression/bz1561018-glibc-Enable-annobin-annotations diff --git a/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/runtest.sh b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/runtest.sh new file mode 100755 index 0000000..9ce516a --- /dev/null +++ b/tests/Regression/bz1561018-glibc-Enable-annobin-annotations/runtest.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1561018-glibc-Enable-annobin-annotations +# Description: Test for BZ#1561018 (glibc Enable annobin annotations) +# Author: Alexandra Hájková +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +PACKAGE="glibc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "eu-readelf -S /usr/lib64/libc.so.6 | grep "gnu.build.attributes"" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/Makefile b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/Makefile new file mode 100644 index 0000000..7b74519 --- /dev/null +++ b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in +# Description: Test for BZ#1579451 (glibc IP_BIND_ADDRESS_NO_PORT is not defined in) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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/glibc/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE bug.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1579451 (glibc IP_BIND_ADDRESS_NO_PORT is not defined in)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-devel gcc" >> $(METADATA) + @echo "RhtsRequires: library(glibc/chrft)" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1579451" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/PURPOSE b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/PURPOSE new file mode 100644 index 0000000..a41980e --- /dev/null +++ b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in +Description: Test for BZ#1579451 (glibc IP_BIND_ADDRESS_NO_PORT is not defined in) +Author: Sergey Kolosov +Bug summary: glibc: IP_BIND_ADDRESS_NO_PORT is not defined in +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1579451 diff --git a/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/bug.c b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/bug.c new file mode 100644 index 0000000..4e1d440 --- /dev/null +++ b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/bug.c @@ -0,0 +1,9 @@ +#include +#include +#include +#include + +int main(void) { + setsockopt(0, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT, NULL, 0); + return 0; +} diff --git a/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/main.fmf b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/main.fmf new file mode 100644 index 0000000..26e6f9d --- /dev/null +++ b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/main.fmf @@ -0,0 +1,20 @@ +summary: Test for BZ#1579451 (glibc IP_BIND_ADDRESS_NO_PORT is not defined in) +description: | + Bug summary: glibc: IP_BIND_ADDRESS_NO_PORT is not defined in + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1579451 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1579451 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - library(glibc/chrft) +recommend: + - glibc + - glibc-devel + - gcc +duration: 10m +extra-summary: /tools/glibc/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in +extra-task: /tools/glibc/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in diff --git a/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/runtest.sh b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/runtest.sh new file mode 100755 index 0000000..5d3d21b --- /dev/null +++ b/tests/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in/runtest.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1579451-glibc-IP-BIND-ADDRESS-NO-PORT-is-not-defined-in +# Description: Test for BZ#1579451 (glibc IP_BIND_ADDRESS_NO_PORT is not defined in) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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="glibc" +TESTPROG="bug" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlRun -c "./${TESTPROG}" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/Makefile b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/Makefile new file mode 100644 index 0000000..7f1b025 --- /dev/null +++ b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to +# Description: Test for BZ#1591268 (glibc Problem with iconv converting ISO8859-1 to) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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/glibc/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to +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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1591268 (glibc Problem with iconv converting ISO8859-1 to)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc vim-common" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1591268" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/PURPOSE b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/PURPOSE new file mode 100644 index 0000000..73b2216 --- /dev/null +++ b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to +Description: Test for BZ#1591268 (glibc Problem with iconv converting ISO8859-1 to) +Author: Sergey Kolosov +Bug summary: glibc: Problem with iconv converting ISO8859-1 to IBM273 [rhel-7] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1591268 diff --git a/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/main.fmf b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/main.fmf new file mode 100644 index 0000000..c758153 --- /dev/null +++ b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/main.fmf @@ -0,0 +1,17 @@ +summary: Test for BZ#1591268 (glibc Problem with iconv converting ISO8859-1 to) +description: | + Bug summary: glibc: Problem with iconv converting ISO8859-1 to IBM273 [rhel-7] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1591268 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1591268 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - vim-common +duration: 5m +extra-summary: /tools/glibc/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to +extra-task: /tools/glibc/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to diff --git a/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/runtest.sh b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/runtest.sh new file mode 100755 index 0000000..576f18b --- /dev/null +++ b/tests/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to/runtest.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1591268-glibc-Problem-with-iconv-converting-ISO8859-1-to +# Description: Test for BZ#1591268 (glibc Problem with iconv converting ISO8859-1 to) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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="glibc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlAssertRpm glibc-common + rlAssertRpm vim-common + rlRun "TESTTMPDIR=$(mktemp -d)" + rlPhaseEnd + + rlPhaseStartTest + rlAssertExists "/usr/bin/iconv" + rlAssertExists "/usr/bin/xxd" + rlRun -c "echo "AF" | xxd -r -p | iconv -f iso8859-1 -t ibm273" + rlRun -c "echo "AF" | xxd -r -p | iconv -f iso8859-1 -t ibm1141" + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/Makefile b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/Makefile new file mode 100644 index 0000000..3bb1315 --- /dev/null +++ b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index +# Description: Test for BZ#1612448 (glibc debuginfo does not have .gdb_index) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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/glibc/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index +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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1612448 (glibc debuginfo does not have .gdb_index)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-debuginfo glibc-debuginfo-common glibc-common-debuginfo binutils" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1612448" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/PURPOSE b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/PURPOSE new file mode 100644 index 0000000..9a97bda --- /dev/null +++ b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index +Description: Test for BZ#1612448 (glibc debuginfo does not have .gdb_index) +Author: Sergey Kolosov +Bug summary: glibc: debuginfo does not have .gdb_index (gdb-add-index) +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1612448 diff --git a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/main.fmf b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/main.fmf new file mode 100644 index 0000000..0171c47 --- /dev/null +++ b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/main.fmf @@ -0,0 +1,20 @@ +summary: Test for BZ#1612448 (glibc debuginfo does not have .gdb_index) +description: | + Bug summary: glibc: debuginfo does not have .gdb_index (gdb-add-index) + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1612448 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1612448 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - glibc-debuginfo + - glibc-debuginfo-common + - glibc-common-debuginfo + - binutils +duration: 20m +extra-summary: /tools/glibc/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index +extra-task: /tools/glibc/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index diff --git a/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/runtest.sh b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/runtest.sh new file mode 100755 index 0000000..dfbd53f --- /dev/null +++ b/tests/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index/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/glibc/Regression/bz1612448-glibc-debuginfo-does-not-have-gdb-index +# Description: Test for BZ#1612448 (glibc debuginfo does not have .gdb_index) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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="glibc" +TESTPROG="put_test_prog_here" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlAssertRpm glibc-debuginfo + rlAssertRpm binutils + rlRun "LIBC_SO_DEBUGS=\"$(find /usr -name 'libc*.so*.debug')\"" + rlPhaseEnd + + rlPhaseStartTest + for LIBC_SO_DEBUG in $LIBC_SO_DEBUGS; do + rlAssertExists "$LIBC_SO_DEBUG" + rlRun -l "readelf -S $LIBC_SO_DEBUG | grep -w gdb_index" + done + rlPhaseEnd + + rlPhaseStartCleanup + + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/Makefile b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/Makefile new file mode 100644 index 0000000..39e617d --- /dev/null +++ b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on +# Description: Test for BZ#1661244 (glibc Disable lazy binding of TLS descriptors on) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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/glibc/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE audit.c au-test.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1661244 (glibc Disable lazy binding of TLS descriptors on)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-devel gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1661244" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/PURPOSE b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/PURPOSE new file mode 100644 index 0000000..a12cffb --- /dev/null +++ b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on +Description: Test for BZ#1661244 (glibc Disable lazy binding of TLS descriptors on) +Author: Sergey Kolosov +Bug summary: glibc: Disable lazy binding of TLS descriptors on aarch64 [rhel-7.6.z] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1661244 diff --git a/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/au-test.c b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/au-test.c new file mode 100644 index 0000000..c6d635d --- /dev/null +++ b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/au-test.c @@ -0,0 +1,11 @@ +#include +#include +#include + +struct in_addr a; + +int main(int argc, char *argv[]) +{ + inet_ntoa(a); + return 0; +} diff --git a/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/audit.c b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/audit.c new file mode 100644 index 0000000..9d850d1 --- /dev/null +++ b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/audit.c @@ -0,0 +1,8 @@ +#define _GNU_SOURCE +#include + + +unsigned int la_version(unsigned int ver) +{ + return 1; +} diff --git a/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/main.fmf b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/main.fmf new file mode 100644 index 0000000..ff3273f --- /dev/null +++ b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#1661244 (glibc Disable lazy binding of TLS descriptors on) +description: | + Bug summary: glibc: Disable lazy binding of TLS descriptors on aarch64 [rhel-7.6.z] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1661244 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1661244 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - glibc-devel + - gcc +duration: 20m +extra-summary: /tools/glibc/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on +extra-task: /tools/glibc/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on diff --git a/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/runtest.sh b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/runtest.sh new file mode 100755 index 0000000..9d3cc22 --- /dev/null +++ b/tests/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1661244-glibc-Disable-lazy-binding-of-TLS-descriptors-on +# Description: Test for BZ#1661244 (glibc Disable lazy binding of TLS descriptors on) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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="glibc" +TESTPROG="au-test" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp audit.c $TESTTMPDIR" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -o libaudit.so audit.c -fPIC -shared" + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlAssertExists "libaudit.so" + rlRun -c "LD_AUDIT=${TESTTMPDIR}/libaudit.so ./${TESTPROG}" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/Makefile b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/Makefile new file mode 100644 index 0000000..28bbf08 --- /dev/null +++ b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries +# Description: Test for BZ#1661513 (glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries) +# Author: Martin Coufal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries +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 Coufal " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1661513 (glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc gdb" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1661513" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/PURPOSE b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/PURPOSE new file mode 100644 index 0000000..7b94f6d --- /dev/null +++ b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries +Description: Test for BZ#1661513 (glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries) +Author: Martin Coufal +Bug summary: glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1661513 diff --git a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/main.fmf b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/main.fmf new file mode 100644 index 0000000..31302be --- /dev/null +++ b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/main.fmf @@ -0,0 +1,18 @@ +summary: "Test for BZ#1661513 (glibc: Adjust to rpm's find-debuginfo.sh changes, to\ + \ keep stripping binaries)" +description: | + Bug summary: glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1661513 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1661513 +contact: Martin Coufal +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - gdb +duration: 15m +extra-summary: /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries +extra-task: /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries diff --git a/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/runtest.sh b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/runtest.sh new file mode 100755 index 0000000..e40714d --- /dev/null +++ b/tests/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries/runtest.sh @@ -0,0 +1,68 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries +# Description: Test for BZ#1661513 (glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries) +# Author: Martin Coufal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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 + + +rlJournalStart + rlPhaseStartSetup + + rlRun "tmpdir=$(mktemp -d)" + rlRun "pushd $tmpdir" + # make sure glibc-debuginfo is not installed + if rlCheckRpm glibc-debuginfo; then + rlRun "yum -y remove glibc-debuginfo" + fi + + rlPhaseEnd + + rlPhaseStartTest + + # All programs (ldconfig, iconvconfig etc.) should be stripped, the dynamic loader (the target of the /usr/bin/ld.so symbolic link) should be unstripped + rlRun "file /sbin/ldconfig /sbin/iconvconfig /usr/bin/localedef $(readlink -f /usr/bin/ld.so) > output.log 2>&1" + rlAssertGrep "ldconfig.*, stripped" output.log + rlAssertGrep "iconvconfig.*, stripped" output.log + rlAssertGrep "localedef.*, stripped" output.log + rlAssertGrep "ld-.*, not stripped" output.log + rlLogInfo "Content of output.log:\n$(cat output.log)" + + # some debugging info (e.g. pthread struct) should be accessible even without installed debuginfo packages + rlRun "gdb --batch -ex 'ptype struct pthread' /usr/bin/ld.so > gdb.log 2>&1" + rlAssertGrep "type = struct pthread" gdb.log + rlAssertNotGrep "No struct type named pthread" gdb.log + + rlPhaseEnd + + rlPhaseStartCleanup + + rlRun "popd" + rlRun "rm -rf $tmpdir" + + rlPhaseEnd + rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/Makefile b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/Makefile new file mode 100644 index 0000000..482a9ab --- /dev/null +++ b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers +# Description: Test for BZ#1717438 (glibc __libc_freeres (under valgrind) triggers bad) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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/glibc/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE tst-libidl.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1717438 (glibc __libc_freeres (under valgrind) triggers bad)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-devel valgrind" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1717438" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/PURPOSE b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/PURPOSE new file mode 100644 index 0000000..e727108 --- /dev/null +++ b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers +Description: Test for BZ#1717438 (glibc __libc_freeres (under valgrind) triggers bad) +Author: Sergey Kolosov +Bug summary: glibc: __libc_freeres (under valgrind) triggers bad free in libdl if dlerror was not used +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1717438 diff --git a/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/main.fmf b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/main.fmf new file mode 100644 index 0000000..692be22 --- /dev/null +++ b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#1717438 (glibc __libc_freeres (under valgrind) triggers bad) +description: | + Bug summary: glibc: __libc_freeres (under valgrind) triggers bad free in libdl if dlerror was not used + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1717438 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1717438 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - glibc-devel + - valgrind +duration: 20m +extra-summary: /tools/glibc/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers +extra-task: /tools/glibc/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers diff --git a/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/runtest.sh b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/runtest.sh new file mode 100755 index 0000000..1afe812 --- /dev/null +++ b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/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/glibc/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers +# Description: Test for BZ#1717438 (glibc __libc_freeres (under valgrind) triggers bad) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2019 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="glibc" +TESTPROG="tst-libidl" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG -ldl -pthread" + rlAssertExists "$TESTPROG" + rlRun -l "valgrind --error-exitcode=111 -q ./${TESTPROG} no_dlerror" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/tst-libidl.c b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/tst-libidl.c new file mode 100644 index 0000000..b7cbe85 --- /dev/null +++ b/tests/Regression/bz1717438-glibc-libc-freeres-under-valgrind-triggers/tst-libidl.c @@ -0,0 +1,102 @@ +/* +To build: + +With system libc: + gcc -o libdl_bug libdl_bug.c -ldl -pthread + +With custom libc + libc_dir=/path/to/glibc/install + gcc -o libdl_bug libdl_bug.c -L$libc_dir/lib -Wl,--rpath=$libc_dir/lib \ + -Wl,--dynamic-linker=$libc_dir/lib/ld-linux-x86-64.so.2 -ldl -pthread + +./libdl_bug bad_free is just a sanity check that valgrind will notice if +|&do_not_free_this| is accidentally passed to |free|. + +Otherwise, this tool will allocate a |pthread_key_t| (which will likely be zero) +and store |&do_not_free_this| in it. The |pthread_key_t| has no destructor, so +this is perfectly valid. + +It will then optionally call |dlerror| (pass dlerror vs no_dlerror to the tool), +and then return from |main| cleanly. At this point, when running under valgrind, +vg_preloaded.c will call |__libc_freeres|. + +In glibc after 2827ab990aefbb0e53374199b875d98f116d6390 (2.28 and later), +|__libc_freeres| will call |__libdl_freeres|, which calls |free_key_mem| in +dlerror.c. That function cleans up |dlerror|'s thread-local state, but has a +bug: if nothing has called |dlerror|, there is no thread-local state and the +|pthread_key_t| is uninitialized! It then blindly calls |free| on the zero key, +and hits our |&do_not_free_this|. That results in an error in valgrind: + +$ valgrind -q ./libdl_bug dlerror +Initializing a pthread_key_t. +key = 0 +Setting thread local to &do_not_free_this. +Calling dlerror. +Exiting + +$ valgrind -q ./libdl_bug no_dlerror +Initializing a pthread_key_t. +key = 0 +Setting thread local to &do_not_free_this. +Exiting +==139993== Invalid free() / delete / delete[] / realloc() +==139993== at 0x4C2FFA8: free (vg_replace_malloc.c:540) +==139993== by 0x4E3D6D9: free_key_mem (dlerror.c:223) +==139993== by 0x4E3D6D9: __dlerror_main_freeres (dlerror.c:239) +==139993== by 0x53BFDC9: __libc_freeres (in /[...]/lib/libc-2.29.9000.so) +==139993== by 0x4A296DB: _vgnU_freeres (vg_preloaded.c:77) +==139993== by 0x5296381: __run_exit_handlers (exit.c:132) +==139993== by 0x52963A9: exit (exit.c:139) +==139993== by 0x528105D: (below main) (libc-start.c:342) +==139993== Address 0x30a08c is 0 bytes inside data symbol "do_not_free_this" +==139993== +*/ + +#include +#include +#include +#include +#include + +static void usage(const char *prog_name) { + fprintf(stderr, "Usage: %s [bad_free|no_dlerror|dlerror]\n", prog_name); + exit(1); +} + +static int do_not_free_this; +static pthread_key_t key; + +int main(int argc, char **argv) { + if (argc != 2) { + usage(argv[0]); + } + + if (strcmp(argv[1], "bad_free") == 0) { + printf("Calling free(&do_not_free_this). Valgrind should notice.\n"); + free(&do_not_free_this); + } else if (strcmp(argv[1], "no_dlerror") == 0 || + strcmp(argv[1], "dlerror") == 0) { + printf("Initializing a pthread_key_t.\n"); + if (pthread_key_create(&key, NULL)) { + perror("pthread_key_create"); + exit(1); + } + + printf("key = %d\n", key); + + printf("Setting thread local to &do_not_free_this.\n"); + if (pthread_setspecific(key, &do_not_free_this) != 0) { + perror("pthread_setspecific"); + exit(1); + } + + if (strcmp(argv[1], "dlerror") == 0) { + printf("Calling dlerror.\n"); + dlerror(); + } + } else { + usage(argv[0]); + } + printf("Exiting\n"); + return 0; +} diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/Makefile b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/Makefile new file mode 100644 index 0000000..d68430c --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements +# Description: Test for BZ#1746933 (glibc Backport malloc tcache enhancements ) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 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/glibc/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE m1.stp m1_p9.stp t.c trigger.sh + +.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1746933 (glibc Backport malloc tcache enhancements)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: gcc glibc glibc-devel systemtap" >> $(METADATA) + @echo "RhtsRequires: library(glibc/chrft)" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1746933" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/PURPOSE b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/PURPOSE new file mode 100644 index 0000000..262ea54 --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/PURPOSE @@ -0,0 +1,8 @@ +PURPOSE of /tools/glibc/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements +Description: Test for BZ#1746933 (glibc Backport malloc tcache enhancements ) +Author: Sergey Kolosov +Bug summary: glibc: Backport malloc tcache enhancements (swbz#24531) +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1746933 + +TODO +Use correct path to libc in case of power9/power8 diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/m1.stp b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/m1.stp new file mode 100644 index 0000000..5ffe276 --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/m1.stp @@ -0,0 +1,4 @@ +probe process("/lib64/libc.so.6").mark("memory_tunable_tcache_count") +{ + printf("PID=%d New tcache_count:%ld, old tcache_count:%ld\n",pid(), $arg1, $arg2) +} diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/m1_p9.stp b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/m1_p9.stp new file mode 100644 index 0000000..3c63874 --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/m1_p9.stp @@ -0,0 +1,4 @@ +probe process("/lib64/glibc-hwcaps/power9/libc.so.6").mark("memory_tunable_tcache_count") +{ + printf("PID=%d New tcache_count:%ld, old tcache_count:%ld\n",pid(), $arg1, $arg2) +} diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/main.fmf b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/main.fmf new file mode 100644 index 0000000..1537a32 --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/main.fmf @@ -0,0 +1,24 @@ +summary: Test for BZ#1746933 (glibc Backport malloc tcache enhancements) +description: | + Bug summary: glibc: Backport malloc tcache enhancements (swbz#24531) + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1746933 + + TODO + Use correct path to libc in case of power9/power8 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1746933 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - library(glibc/chrft) +recommend: + - gcc + - glibc + - glibc-devel + - systemtap +duration: 10m +extra-summary: /tools/glibc/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements +extra-task: /tools/glibc/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/runtest.sh b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/runtest.sh new file mode 100755 index 0000000..5b08f7d --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/runtest.sh @@ -0,0 +1,70 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements +# Description: Test for BZ#1746933 (glibc Backport malloc tcache enhancements ) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2020 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="glibc" +TESTPROG="t" +TRIG="trigger.sh" +SSCRIPT="m1.stp" +SSCRIPTP9="m1_p9.stp" +SREPORT="report.txt" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TRIG $SSCRIPT $SSCRIPTP9 $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + if [ `arch` = "ppc64le" ] && rlIsRHEL 8; then + rlRun -l "stap -v $SSCRIPTP9 -c ./${TRIG} > $SREPORT" + else + rlRun -l "stap -v $SSCRIPT -c ./${TRIG} > $SREPORT" + fi + rlAssertGrep "tcache_count:11111" $SREPORT + rlAssertGrep "tcache_count:65" $SREPORT + rlAssertGrep "tcache_count:0" $SREPORT + rlAssertGrep "tcache_count:65535" $SREPORT + rlAssertNotGrep "tcache_count:65536" $SREPORT + rlAssertNotGrep "tcache_count:5555555" $SREPORT + rlAssertNotGrep "tcache_count:-20" $SREPORT + rlFileSubmit $SREPORT + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/t.c b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/t.c new file mode 100644 index 0000000..6b89fc0 --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/t.c @@ -0,0 +1,12 @@ +#include +#include + +int main() { + void *m; + printf("Malloc test\n"); + if(!malloc(100)) { + perror("malloc"); + return 1; + } + return 0; +} diff --git a/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/trigger.sh b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/trigger.sh new file mode 100755 index 0000000..f8c41c9 --- /dev/null +++ b/tests/Regression/bz1746933-glibc-Backport-malloc-tcache-enhancements/trigger.sh @@ -0,0 +1,16 @@ +#!/bin/bash +export "GLIBC_TUNABLES=glibc.malloc.tcache_count=11111" +./t +export "GLIBC_TUNABLES=glibc.malloc.tcache_count=65" +./t +export "GLIBC_TUNABLES=glibc.malloc.tcache_count=0" +./t +export "GLIBC_TUNABLES=glibc.malloc.tcache_count=65535" +./t +export "GLIBC_TUNABLES=glibc.malloc.tcache_count=65536" +./t +export "GLIBC_TUNABLES=glibc.malloc.tcache_count=-20" +./t +export "GLIBC_TUNABLES=glibc.malloc.tcache_count=5555555" +./t + diff --git a/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/Makefile b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/Makefile new file mode 100644 index 0000000..1340408 --- /dev/null +++ b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on +# Description: Test for BZ#1988382 (annocheck reports pie/pic test failures on) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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/glibc/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on +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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1988382 (annocheck reports pie/pic test failures on)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 1h" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: annobin-annocheck glibc" >> $(METADATA) + @echo "RhtsRequires: library(glibc/chrft)" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1988382" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7 -RHEL8" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/PURPOSE b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/PURPOSE new file mode 100644 index 0000000..bc2419e --- /dev/null +++ b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on +Description: Test for BZ#1988382 (annocheck reports pie/pic test failures on) +Author: Sergey Kolosov +Bug summary: annocheck reports pie/pic test failures on non-x86_64 architectures +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1988382 diff --git a/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/main.fmf b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/main.fmf new file mode 100644 index 0000000..084643d --- /dev/null +++ b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/main.fmf @@ -0,0 +1,19 @@ +summary: Test for BZ#1988382 (annocheck reports pie/pic test failures on) +description: | + Bug summary: annocheck reports pie/pic test failures on non-x86_64 architectures + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1988382 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1988382 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - library(glibc/chrft) +recommend: + - annobin-annocheck + - glibc +duration: 1h +extra-summary: /tools/glibc/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on +extra-task: /tools/glibc/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on diff --git a/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/runtest.sh b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/runtest.sh new file mode 100755 index 0000000..d1b98f2 --- /dev/null +++ b/tests/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on/runtest.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1988382-annocheck-reports-pie-pic-test-failures-on +# Description: Test for BZ#1988382 (annocheck reports pie/pic test failures on) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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="glibc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlImport glibc/chrft + checkRelevancyAndExit $PACKNVR $(rlGetDistroRelease) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -l "rpm -qal 'glibc*' | while read f ; do if test -f \"\$f\" -a ! -L \"\$f\" ; then echo \$f ; fi ; done | xargs -L 200 annocheck --verbose --verbose --ignore-gaps --skip-all --test-pic --test-pie 2> /dev/null > log" 0,123 + rlFileSubmit log + rlAssertNotGrep "FAIL" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/Makefile b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/Makefile new file mode 100644 index 0000000..f24e81c --- /dev/null +++ b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using +# Description: Test for BZ#2024347 (glibc Optional sched_getcpu acceleration using) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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/glibc/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE tst.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#2024347 (glibc Optional sched_getcpu acceleration using)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 15m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: gcc glibc glibc-devel strace" >> $(METADATA) + @echo "RhtsRequires: library(glibc/chrft)" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 2024347" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7 -RHEL8" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/PURPOSE b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/PURPOSE new file mode 100644 index 0000000..35c0778 --- /dev/null +++ b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using +Description: Test for BZ#2024347 (glibc Optional sched_getcpu acceleration using) +Author: Sergey Kolosov +Bug summary: glibc: Optional sched_getcpu acceleration using rseq +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2024347 diff --git a/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/main.fmf b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/main.fmf new file mode 100644 index 0000000..778d0c9 --- /dev/null +++ b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/main.fmf @@ -0,0 +1,21 @@ +summary: Test for BZ#2024347 (glibc Optional sched_getcpu acceleration using) +description: | + Bug summary: glibc: Optional sched_getcpu acceleration using rseq + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2024347 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2024347 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - library(glibc/chrft) +recommend: + - gcc + - glibc + - glibc-devel + - strace +duration: 15m +extra-summary: /tools/glibc/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using +extra-task: /tools/glibc/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using diff --git a/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/runtest.sh b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/runtest.sh new file mode 100755 index 0000000..948f902 --- /dev/null +++ b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/runtest.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using +# Description: Test for BZ#2024347 (glibc Optional sched_getcpu acceleration using) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2022 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="glibc" +TESTPROG="tst" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlRun -c "strace -E GLIBC_TUNABLES=glibc.pthread.rseq=1 ./${TESTPROG} 2> log" + rlAssertGrep rseq log + rlAssertNotGrep getcpu log + rlFileSubmit log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/tst.c b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/tst.c new file mode 100644 index 0000000..974bf98 --- /dev/null +++ b/tests/Regression/bz2024347-glibc-Optional-sched-getcpu-acceleration-using/tst.c @@ -0,0 +1,9 @@ +#define _GNU_SOURCE +#include +#include + +int +main (void) +{ + printf ("%d\n", sched_getcpu ()); +} diff --git a/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/Makefile b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/Makefile new file mode 100644 index 0000000..def913a --- /dev/null +++ b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on +# Description: Test for BZ#2027789 (glibc backtrace function crashes without vdso on) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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/glibc/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE tst.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#2027789 (glibc backtrace function crashes without vdso on)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: gcc glibc glibc-devel valgrind" >> $(METADATA) + @echo "RhtsRequires: library(glibc/chrft)" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 2027789" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7 -RHEL8" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/PURPOSE b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/PURPOSE new file mode 100644 index 0000000..fc8e6a5 --- /dev/null +++ b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on +Description: Test for BZ#2027789 (glibc backtrace function crashes without vdso on) +Author: Sergey Kolosov +Bug summary: glibc: backtrace function crashes without vdso on ppc64le +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2027789 diff --git a/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/main.fmf b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/main.fmf new file mode 100644 index 0000000..0e61467 --- /dev/null +++ b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/main.fmf @@ -0,0 +1,21 @@ +summary: Test for BZ#2027789 (glibc backtrace function crashes without vdso on) +description: | + Bug summary: glibc: backtrace function crashes without vdso on ppc64le + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2027789 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2027789 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - library(glibc/chrft) +recommend: + - gcc + - glibc + - glibc-devel + - valgrind +duration: 10m +extra-summary: /tools/glibc/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on +extra-task: /tools/glibc/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on diff --git a/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/runtest.sh b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/runtest.sh new file mode 100755 index 0000000..2c9c6dc --- /dev/null +++ b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/runtest.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on +# Description: Test for BZ#2027789 (glibc backtrace function crashes without vdso on) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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="glibc" +TESTPROG="tst" +VALLOG="vallog" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc ${TESTPROG}.c -g -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlRun -l "valgrind --error-exitcode=111 ./${TESTPROG} 2>$VALLOG" + rlFileSubmit $VALLOG + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/tst.c b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/tst.c new file mode 100644 index 0000000..88d0036 --- /dev/null +++ b/tests/Regression/bz2027789-glibc-backtrace-function-crashes-without-vdso-on/tst.c @@ -0,0 +1,12 @@ +#include +#include + +void call_backtrace(){ + void * callstack[128]; + backtrace(callstack, 128); +} + +int main(){ + call_backtrace(); + return 0; +} diff --git a/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/Makefile b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/Makefile new file mode 100644 index 0000000..7a49c36 --- /dev/null +++ b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and +# Description: Test for BZ#1476120 (glibc headers don't include linux/falloc.h, and) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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/glibc/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE tst-falloc.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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1476120 (glibc headers don't include linux/falloc.h, and)" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-devel gcc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1476120" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/PURPOSE b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/PURPOSE new file mode 100644 index 0000000..a137292 --- /dev/null +++ b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and +Description: Test for BZ#1476120 (glibc headers don't include linux/falloc.h, and) +Author: Sergey Kolosov +Bug summary: glibc headers don't include linux/falloc.h, and therefore doesn't include fallocate() flags +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1476120 diff --git a/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/main.fmf b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/main.fmf new file mode 100644 index 0000000..68f887d --- /dev/null +++ b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#1476120 (glibc headers don't include linux/falloc.h, and) +description: | + Bug summary: glibc headers don't include linux/falloc.h, and therefore doesn't include fallocate() flags + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1476120 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1476120 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - glibc-devel + - gcc +duration: 20m +extra-summary: /tools/glibc/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and +extra-task: /tools/glibc/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and diff --git a/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/runtest.sh b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/runtest.sh new file mode 100755 index 0000000..672cdfa --- /dev/null +++ b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/runtest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and +# Description: Test for BZ#1476120 (glibc headers don't include linux/falloc.h, and) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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 + +PACKAGE="glibc" +TESTPROG="tst-falloc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc -c ${TESTPROG}.c" + rlAssertExists "${TESTPROG}.o" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/tst-falloc.c b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/tst-falloc.c new file mode 100644 index 0000000..600ecac --- /dev/null +++ b/tests/Sanity/bz1476120-glibc-headers-don-t-include-linux-falloc-h-and/tst-falloc.c @@ -0,0 +1,7 @@ +#define _GNU_SOURCE +#include +int test(int fd) +{ + return fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, + 0, 1024 * 1024); +} diff --git a/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/Makefile b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/Makefile new file mode 100644 index 0000000..04d8273 --- /dev/null +++ b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/Makefile @@ -0,0 +1,65 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to +# Description: Test for BZ#1915330 (glibc Implement find-debuginfo.sh changes to avoid) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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/glibc/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to +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: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1915330 (glibc Implement find-debuginfo.sh changes to avoid)" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc glibc-debuginfo glibc-debuginfo.i686 glibc-debuginfo.x86_64" >> $(METADATA) + @echo "RhtsRequires: library(glibc/chrft)" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1915330" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7 -RHEL8" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/PURPOSE b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/PURPOSE new file mode 100644 index 0000000..b076330 --- /dev/null +++ b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to +Description: Test for BZ#1915330 (glibc Implement find-debuginfo.sh changes to avoid) +Author: Sergey Kolosov +Bug summary: glibc: Implement find-debuginfo.sh changes to avoid file conflicts +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1915330 diff --git a/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/main.fmf b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/main.fmf new file mode 100644 index 0000000..f7088d5 --- /dev/null +++ b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/main.fmf @@ -0,0 +1,21 @@ +summary: Test for BZ#1915330 (glibc Implement find-debuginfo.sh changes to avoid) +description: | + Bug summary: glibc: Implement find-debuginfo.sh changes to avoid file conflicts + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1915330 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1915330 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - library(glibc/chrft) +recommend: + - glibc + - glibc-debuginfo + - glibc-debuginfo.i686 + - glibc-debuginfo.x86_64 +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to +extra-task: /tools/glibc/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to diff --git a/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/runtest.sh b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/runtest.sh new file mode 100755 index 0000000..c232326 --- /dev/null +++ b/tests/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to/runtest.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz1915330-glibc-Implement-find-debuginfo-sh-changes-to +# Description: Test for BZ#1915330 (glibc Implement find-debuginfo.sh changes to avoid) +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 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="glibc" +DEBUGPACKAGE="glibc-debuginfo" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlPhaseEnd + + rlPhaseStartTest + rlAssertRpm ${DEBUGPACKAGE}.$(rlGetPrimaryArch) + if [[ $(rlGetSecondaryArch) ]] + then + rlAssertRpm ${DEBUGPACKAGE}.$(rlGetSecondaryArch) + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/Makefile b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/Makefile new file mode 100644 index 0000000..88cef9d --- /dev/null +++ b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics +# Description: Test for BZ#2023420 (glibc: Backport ld.so --list-diagnostics) +# Author: Martin Coufal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 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/glibc/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics +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 Coufal " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#2023420 (glibc: Backport ld.so --list-diagnostics)" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: glibc" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 2023420" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/PURPOSE b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/PURPOSE new file mode 100644 index 0000000..a058fb4 --- /dev/null +++ b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics +Description: Test for BZ#2023420 (glibc: Backport ld.so --list-diagnostics) +Author: Martin Coufal +Bug summary: glibc: Backport ld.so --list-diagnostics [rhel-8.6] +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2023420 diff --git a/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/main.fmf b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/main.fmf new file mode 100644 index 0000000..13cda56 --- /dev/null +++ b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/main.fmf @@ -0,0 +1,16 @@ +summary: 'Test for BZ#2023420 (glibc: Backport ld.so --list-diagnostics)' +description: | + Bug summary: glibc: Backport ld.so --list-diagnostics [rhel-8.6] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2023420 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2023420 +contact: Martin Coufal +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc +duration: 10m +extra-summary: /tools/glibc/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics +extra-task: /tools/glibc/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics diff --git a/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/runtest.sh b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/runtest.sh new file mode 100755 index 0000000..83b675a --- /dev/null +++ b/tests/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics/runtest.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz2023420-glibc-Backport-ld-so-list-diagnostics +# Description: Test for BZ#2023420 (glibc: Backport ld.so --list-diagnostics) +# Author: Martin Coufal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2017 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="glibc" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "LDSO_PATH=$(rpm -ql ${PACKAGE}-common | grep ld.so)" + rlRun "tmpdir=$(mktemp -d)" + rlRun "pushd $tmpdir" + rlPhaseEnd + + rlPhaseStartTest + if [[ -z "$LDSO_PATH" ]]; then + rlFail "Shared library 'ld.so' not found!" + elif [[ ! -L "$LDSO_PATH" ]]; then + rlFail "$LDSO_PATH should be a symbolic link!" + else + rlRun "$LDSO_PATH --help >> help.log" + rlAssertGrep "Usage:.*ld\.so" help.log + rlAssertGrep "--list-diagnostics" help.log + rlRun "$LDSO_PATH --list-diagnostics >> list-diagnostics.log" + rlAssertGreaterOrEqual "Basic sanity line count check" $(cat list-diagnostics.log | wc -l) 10 + rlAssertGrep "dso" list-diagnostics.log + rlAssertGrep "env_filtered" list-diagnostics.log + rlAssertGrep "auxv" list-diagnostics.log + rlAssertGrep "uname" list-diagnostics.log + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -rf $tmpdir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd