From b07a1b7660bb527ce0f65e5fad54e115682d20a9 Mon Sep 17 00:00:00 2001 From: Sergey Kolosov Date: Mar 05 2024 10:43:40 +0000 Subject: CI Tests: test coverage improvement --- diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/Makefile b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/Makefile new file mode 100644 index 0000000..c003abc --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/Makefile @@ -0,0 +1,63 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +# Description: What the test does +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2023 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/ESTALE-error-message-translation-regression-from-RHEL7 +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE estale-test.c refs + +.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: What the test does" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: gcc glibc-devel glibc-langpack-es glibc-langpack-ja glibc-langpack-fr glibc-langpack-de glibc-langpack-it glibc-langpack-ko glibc-langpack-pt glibc-langpack-ru glibc-langpack-zh" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Releases: -RHEL6 -RHEL7" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/PURPOSE b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/PURPOSE new file mode 100644 index 0000000..64f3c96 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +Description: What the test does +Author: Sergey Kolosov diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/estale-test.c b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/estale-test.c new file mode 100644 index 0000000..1a8efe2 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/estale-test.c @@ -0,0 +1,14 @@ +#include +#include +#include + +int +main (void) +{ + setlocale (LC_ALL, ""); + errno = ESTALE; + perror ("ESTALE"); + errno = EAGAIN; + perror ("EAGAIN"); + return 0; +} diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/main.fmf b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/main.fmf new file mode 100644 index 0000000..ef964a9 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/main.fmf @@ -0,0 +1,22 @@ +summary: What the test does +description: '' +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - gcc + - glibc-devel + - glibc-langpack-es + - glibc-langpack-ja + - glibc-langpack-fr + - glibc-langpack-de + - glibc-langpack-it + - glibc-langpack-ko + - glibc-langpack-pt + - glibc-langpack-ru + - glibc-langpack-zh +duration: 10m +extra-summary: /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +extra-task: /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_AT b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_AT new file mode 100644 index 0000000..3719e16 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_AT @@ -0,0 +1,2 @@ +ESTALE: Veraltete Dateizugriffsnummer (file handle) +EAGAIN: Die Ressource ist zur Zeit nicht verf�gbar diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_DE b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_DE new file mode 100644 index 0000000..3719e16 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_de_DE @@ -0,0 +1,2 @@ +ESTALE: Veraltete Dateizugriffsnummer (file handle) +EAGAIN: Die Ressource ist zur Zeit nicht verf�gbar diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_en_US b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_en_US new file mode 100644 index 0000000..0074184 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_en_US @@ -0,0 +1,2 @@ +ESTALE: Stale file handle +EAGAIN: Resource temporarily unavailable diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_es_ES b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_es_ES new file mode 100644 index 0000000..99ba394 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_es_ES @@ -0,0 +1,2 @@ +ESTALE: `handle' de fichero en desuso +EAGAIN: Recurso no disponible temporalmente diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR new file mode 100644 index 0000000..cb93f19 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR @@ -0,0 +1,2 @@ +ESTALE: Panne d'acc�s au fichier +EAGAIN: Ressource temporairement non disponible diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR.utf8 new file mode 100644 index 0000000..19bb87f --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_fr_FR.utf8 @@ -0,0 +1,2 @@ +ESTALE: Panne d'accès au fichier +EAGAIN: Ressource temporairement non disponible diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_it_IT b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_it_IT new file mode 100644 index 0000000..20e9f4b --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_it_IT @@ -0,0 +1,2 @@ +ESTALE: Riferimento al file obsoleto +EAGAIN: Risorsa temporaneamente non disponibile diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP new file mode 100644 index 0000000..eb01dfe --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP @@ -0,0 +1,2 @@ +ESTALE: �Ť��ե�����ϥ�ɥ�Ǥ� +EAGAIN: �꥽���������Ū�����ѤǤ��ޤ��� diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP.utf8 new file mode 100644 index 0000000..1a4a02c --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ja_JP.utf8 @@ -0,0 +1,2 @@ +ESTALE: 古いファイルハンドルです +EAGAIN: リソースが一時的に利用できません diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ko_KR.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ko_KR.utf8 new file mode 100644 index 0000000..7855938 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ko_KR.utf8 @@ -0,0 +1,2 @@ +ESTALE: 끊어진 파일 핸들 +EAGAIN: 자원이 일시적으로 사용 불가능함 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_pt_BR.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_pt_BR.utf8 new file mode 100644 index 0000000..acb9aaa --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_pt_BR.utf8 @@ -0,0 +1,2 @@ +ESTALE: Manipulador de arquivo corrompido +EAGAIN: Recurso temporariamente indisponível diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ru_UA.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ru_UA.utf8 new file mode 100644 index 0000000..82324e0 --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_ru_UA.utf8 @@ -0,0 +1,2 @@ +ESTALE: Устаревший дескриптор файла +EAGAIN: Ресурс временно недоступен diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8 new file mode 100644 index 0000000..147901b --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_CN.utf8 @@ -0,0 +1,2 @@ +ESTALE: 过旧的文件控柄 +EAGAIN: 资源暂时不可用 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_TW.utf8 b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_TW.utf8 new file mode 100644 index 0000000..212c34d --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/refs/orig_zh_TW.utf8 @@ -0,0 +1,2 @@ +ESTALE: 過舊的檔案控柄 +EAGAIN: 資源暫時無法取得 diff --git a/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/runtest.sh b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/runtest.sh new file mode 100755 index 0000000..f0704ca --- /dev/null +++ b/tests/Regression/ESTALE-error-message-translation-regression-from-RHEL7/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/Regression/ESTALE-error-message-translation-regression-from-RHEL7 +# Description: What the test does +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2023 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="estale-test" +TESTED_LANGS="de_AT de_DE en_US es_ES fr_FR fr_FR.utf8 it_IT ja_JP ja_JP.utf8 ko_KR.utf8 pt_BR.utf8 ru_UA.utf8 zh_CN.utf8 zh_TW.utf8" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "cp refs/orig_* $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest prepare + rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlPhaseEnd + + for L in $TESTED_LANGS + do + rlPhaseStartTest estale-test-$L + rlRun -c "LANG=$L ./${TESTPROG} 2> out_$L" + rlAssertNotDiffer out_$L orig_$L + rlLogInfo "out_$L:\n$(cat out_$L)" + rlPhaseEnd + done + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/Makefile b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/Makefile new file mode 100644 index 0000000..33f1a75 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +# Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +# 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/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE tst-mktime.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#2110357 (glibc mktime() fails with -EOVERFLOW when)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 10m" >> $(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: 2110357" >> $(METADATA) + @echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/PURPOSE b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/PURPOSE new file mode 100644 index 0000000..a5ccc83 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +Author: Sergey Kolosov +Bug summary: glibc: mktime() fails with -EOVERFLOW when tm_isdst=1 and a neighboring DST boundary is far from tm_year +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2110357 diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/main.fmf b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/main.fmf new file mode 100644 index 0000000..b4a5b47 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +description: | + Bug summary: glibc: mktime() fails with -EOVERFLOW when tm_isdst=1 and a neighboring DST boundary is far from tm_year + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2110357 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2110357 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - glibc-devel + - gcc +duration: 10m +extra-summary: /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +extra-task: /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when diff --git a/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/runtest.sh b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/runtest.sh new file mode 100755 index 0000000..77aaf34 --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/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/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when +# Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when) +# 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-mktime" + +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/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/tst-mktime.c b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/tst-mktime.c new file mode 100644 index 0000000..d73c97d --- /dev/null +++ b/tests/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when/tst-mktime.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + time_t t; + struct tm tm; + + setenv("TZ", "Asia/Tokyo", 1); + + memset(&tm, 0, sizeof(tm)); + tm.tm_mday = 1; + tm.tm_mon = 1; + tm.tm_year = 2023; + tm.tm_isdst = 1; + + t = mktime(&tm); + printf("mktime(&tm) = %d\n", t); + if (t < 0) + exit(1); + + return 0; +} diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/Makefile b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/Makefile new file mode 100644 index 0000000..2840e52 --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +# Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +# 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/bz2115831-glibc-missing-gnu-debuglink-section-in +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#2115831 (glibc missing .gnu_debuglink section in libc.so.6,)" >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: elfutils glibc glibc-debuginfo" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 2115831" >> $(METADATA) + @echo "Releases: RHEL8 RHEL9" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/PURPOSE b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/PURPOSE new file mode 100644 index 0000000..85effc3 --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +Author: Sergey Kolosov +Bug summary: glibc: missing .gnu_debuglink section in libc.so.6, redundant annobin symbols and debufginfo for ld.so +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2115831 diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/main.fmf b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/main.fmf new file mode 100644 index 0000000..c0453f6 --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +description: | + Bug summary: glibc: missing .gnu_debuglink section in libc.so.6, redundant annobin symbols and debufginfo for ld.so + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2115831 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2115831 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - elfutils + - glibc + - glibc-debuginfo +duration: 20m +extra-summary: /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in +extra-task: /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in diff --git a/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/runtest.sh b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/runtest.sh new file mode 100755 index 0000000..f534c2c --- /dev/null +++ b/tests/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in/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/bz2115831-glibc-missing-gnu-debuglink-section-in +# Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,) +# 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" +LIBC_SO_6_LIBS=$(find /usr/ -name libc.so.6) +TESTL2="/usr/bin/ld.so" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlAssertRpm ${PACKAGE}-debuginfo + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + for LIB in $LIBC_SO_6_LIBS; do + rlRun -l "eu-readelf -S $LIB | grep -q .debug_" 1 + rlRun -l "eu-readelf -S $LIB | grep -q .gnu_debuglink" 0 + done + rlRun -l "eu-readelf -S $TESTL2 | grep -q .debug_" 0 + rlRun -l "eu-readelf -S $TESTL2 | grep -q .gnu_debuglink" 1 + rlRun -l "eu-readelf -s $TESTL2 | grep -q annobin" 1 + if rlIsRHEL "8"; then + rlRun -l "rpm -ql glibc-debuginfo|sort|grep '/ld-$(rpm -q --qf "%{VERSION}" ${PACKAGE}.`arch`)'" 1 + rlRun -l "rpm -ql glibc-debuginfo|sort|grep '/libc-$(rpm -q --qf "%{VERSION}" ${PACKAGE}.`arch`)'" 0 + elif rlIsRHEL "9"; then + rlRun -l "rpm -ql glibc-debuginfo|sort|grep ld-linux-" 1 + rlRun -l "rpm -ql glibc-debuginfo|sort|grep libc.so.6-" 0 + else + rlFail "Test does not support current distro (yet?)!" + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd