diff --git a/tests/Sanity/Improve-test-coverage-for-open/main.fmf b/tests/Sanity/Improve-test-coverage-for-open/main.fmf new file mode 100644 index 0000000..21216a2 --- /dev/null +++ b/tests/Sanity/Improve-test-coverage-for-open/main.fmf @@ -0,0 +1,16 @@ +summary: Test FORTIFY handling of missing mode when O_CREAT or O_TMPFILE flags + are used. +description: '' +contact: Martin Coufal +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - gcc +duration: 5m +extra-summary: + /tools/glibc/Sanity/Improve-test-coverage-for-open +extra-task: + /tools/glibc/Sanity/Improve-test-coverage-for-open diff --git a/tests/Sanity/Improve-test-coverage-for-open/runtest.sh b/tests/Sanity/Improve-test-coverage-for-open/runtest.sh new file mode 100755 index 0000000..7f9066a --- /dev/null +++ b/tests/Sanity/Improve-test-coverage-for-open/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/Sanity/Improve-test-coverage-for-open +# Description: Test FORTIFY handling of missing mode when O_CREAT or O_TMPFILE flags are used. +# Author: Martin Coufal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2024 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" +TESTNAME="test" +ERROR_MESSAGE="error: call to .__open_missing_mode. declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp ${TESTNAME}.c $TmpDir" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -D_FORTIFY_SOURCE=1 -O1 ${TESTNAME}.c -o ${TESTNAME} 2> ${TESTNAME}.log" 1 + rlAssertNotExists "$TESTNAME" + rlLogInfo "${TESTNAME}.log:\n$(cat ${TESTNAME}.log)" + rlAssertGrep "${ERROR_MESSAGE}" ${TESTNAME}.log + rlAssertEquals "Number of mode missing errors should be 2." "$(cat ${TESTNAME}.log | grep "${ERROR_MESSAGE}" | wc -l)" "2" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/Improve-test-coverage-for-open/test.c b/tests/Sanity/Improve-test-coverage-for-open/test.c new file mode 100644 index 0000000..6feaa76 --- /dev/null +++ b/tests/Sanity/Improve-test-coverage-for-open/test.c @@ -0,0 +1,25 @@ +#define _GNU_SOURCE +#include +#include +#include +#include + +int main() { +int file; +static const char filename[] = "test.test"; + +if ((file = open(filename, O_CREAT)) == 1) +{ + perror("Error opening file."); + exit(EXIT_FAILURE); +} +close(file); + +if ((file = open(filename, O_TMPFILE)) == 1) +{ + perror("Error opening file."); + exit(EXIT_FAILURE); +} +close(file); +} + diff --git a/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/float128-test.c b/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/float128-test.c new file mode 100644 index 0000000..3623dff --- /dev/null +++ b/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/float128-test.c @@ -0,0 +1,5 @@ +int main() +{ + _Float128 a; + return 0; +} diff --git a/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/main.fmf b/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/main.fmf new file mode 100644 index 0000000..6224b46 --- /dev/null +++ b/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/main.fmf @@ -0,0 +1,17 @@ +summary: What the test does +description: '' +adjust: + - enabled: false + when: arch != ppc64le +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc + - glibc-devel + - gcc +duration: 5m +extra-summary: /tools/glibc/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition +extra-task: /tools/glibc/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition diff --git a/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/runtest.sh b/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/runtest.sh new file mode 100755 index 0000000..ac90018 --- /dev/null +++ b/tests/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition/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/Sanity/RHEL-10-IBM-POWER-float128-ABI-transition +# 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="float128-test" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "gcc -mfloat128 -mcpu=power10 ${TESTPROG}.c -o $TESTPROG" + rlAssertExists "$TESTPROG" + rlRun -c "./${TESTPROG}" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names/main.fmf b/tests/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names/main.fmf new file mode 100644 index 0000000..2806317 --- /dev/null +++ b/tests/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names/main.fmf @@ -0,0 +1,14 @@ +summary: iconv restore verbosity with unrecognized encoding names +description: '' +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc +duration: 10m +extra-summary: /tools/glibc/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names +extra-task: /tools/glibc/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names +link: + - verifies: https://issues.redhat.com/browse/RHEL-1018 diff --git a/tests/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names/runtest.sh b/tests/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names/runtest.sh new file mode 100755 index 0000000..c450ff2 --- /dev/null +++ b/tests/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names/runtest.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/RHEL-1018-iconv-restore-verbosity-with-unrecognized-encoding-names +# Description: +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2026 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" +NON_EXIST_ENC=NON_EXIST_ENC1 +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -l "echo AAA|LC_ALL=C iconv -f ASCII -t $NON_EXIST_ENC 2>log" 1 + rlAssertGrep "iconv: conversion to .${NON_EXIST_ENC}. is not supported" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc/main.fmf b/tests/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc/main.fmf new file mode 100644 index 0000000..5575950 --- /dev/null +++ b/tests/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc/main.fmf @@ -0,0 +1,17 @@ +summary: + 'Test for RHEL-106166 (glibc: Add Requires(pre) dependency on libgcc).' +description: '' +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc +duration: 10m +link: + - relates: https://issues.redhat.com/browse/RHEL-106166 + - relates: https://issues.redhat.com/browse/RHEL-110559 +extra-summary: /tools/glibc/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc +extra-task: /tools/glibc/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc +id: 331f2c44-de98-4b6f-be1e-191cc2a7854d diff --git a/tests/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc/runtest.sh b/tests/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc/runtest.sh new file mode 100755 index 0000000..7290ad4 --- /dev/null +++ b/tests/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc/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/Sanity/RHEL-106166-Add-Requires-pre-dependency-on-libgcc +# Description: Test for RHEL-106166 (glibc: Add Requires(pre) dependency on libgcc). +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2025 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 "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + RPMVER=$(rpm -q glibc.`arch` --qf "%{v}-%{r}\n") + if [ ! $RPMVER ] + then + rlFail "Cannot determinate package version" + fi + rlRpmDownload "${PACKAGE}-${RPMVER}.`arch`" + rlAssertExists "${PACKAGE}-${RPMVER}.`arch`.rpm" + rlRun -l "rpm -qp --qf '[%{REQUIREFLAGS} %{REQUIRES}\n]' "${PACKAGE}-${RPMVER}.`arch`.rpm"|grep \"^512 libgcc\"" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/basic-stap-dyninst/main.fmf b/tests/Sanity/basic-stap-dyninst/main.fmf new file mode 100644 index 0000000..666b8ef --- /dev/null +++ b/tests/Sanity/basic-stap-dyninst/main.fmf @@ -0,0 +1,19 @@ +summary: Basic stap test for glibc dynamic linker +description: '' +contact: Sergey Kolosov +adjust: + - enabled: false + when: arch = s390x +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - gcc + - glibc-common-debuginfo + - glibc-debuginfo + - systemtap + - systemtap-devel +duration: 10m +extra-summary: /tools/glibc/Sanity/basic-stap-dyninst +extra-task: /tools/glibc/Sanity/basic-stap-dyninst diff --git a/tests/Sanity/basic-stap-dyninst/runtest.sh b/tests/Sanity/basic-stap-dyninst/runtest.sh new file mode 100755 index 0000000..54ca286 --- /dev/null +++ b/tests/Sanity/basic-stap-dyninst/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/Sanity/basic-stap-dyninst +# Description: The test verifies the functionality of SystemTap's dynamic +# instrumentation when interacting with the Glibc dynamic linker. +# Author: Sergey Kolosov +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2025 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" +TESTUSER="slap_dyninst_test_user" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun -c "adduser $TESTUSER" + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -l "sudo -u $TESTUSER -- stap --dyninst -e 'probe process(\"/usr/bin/getent\").function(\"main\") { println(pn()) }' -c '/usr/bin/getent passwd root' &> log" + rlAssertGrep "^root:" log + rlAssertGrep '^process\("/usr/bin/getent"\)\.function\("main@.*glibc-.*nss/getent.*"\)' log "-P" + rlFileSubmit log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun -c "userdel -fr $TESTUSER" + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv/main.fmf b/tests/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv/main.fmf new file mode 100644 index 0000000..a49d51c --- /dev/null +++ b/tests/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv/main.fmf @@ -0,0 +1,20 @@ +summary: Test for BZ#1414263 (glibc add ibm-858 to list of charsets for iconv) +description: | + Bug summary: glibc: add ibm-858 to list of charsets for iconv + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1414263 +adjust: + - enabled: false + when: distro < rhel-7.8 +contact: Sergey Kolosov +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1414263 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc + - util-linux +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv +extra-task: /tools/glibc/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv diff --git a/tests/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv/runtest.sh b/tests/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv/runtest.sh new file mode 100755 index 0000000..0ad4e0c --- /dev/null +++ b/tests/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv/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/Sanity/bz1414263-glibc-add-ibm-858-to-list-of-charsets-for-iconv +# Description: Test for BZ#1414263 (glibc add ibm-858 to list of charsets for iconv) +# 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 + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -l "echo -e '\xd5' | iconv -f IBM858 -t UTF-8" + rlRun -l "echo -en '\xe2\x82\xac' | iconv -f UTF-8 -t IBM858 > ibm858.euro" + rlRun -l "hexdump ibm858.euro" + rlRun -c "printf '\xd5' > origin.euro" + rlRun -c "cmp ibm858.euro origin.euro" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1577333-Remove-abort-warning-in-manual/main.fmf b/tests/Sanity/bz1577333-Remove-abort-warning-in-manual/main.fmf new file mode 100644 index 0000000..2df1c33 --- /dev/null +++ b/tests/Sanity/bz1577333-Remove-abort-warning-in-manual/main.fmf @@ -0,0 +1,21 @@ +summary: Test for BZ#1577333 (Remove abort() warning in manual.) +description: |+ + Bug summary: Remove abort() warning in manual. + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1577333 + + The test should verify that manual doesn't content a joke about abort. + +contact: Sergey Kolosov +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1577333 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc + - glibc-doc + - info +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1577333-Remove-abort-warning-in-manual +extra-task: /tools/glibc/Sanity/bz1577333-Remove-abort-warning-in-manual diff --git a/tests/Sanity/bz1577333-Remove-abort-warning-in-manual/runtest.sh b/tests/Sanity/bz1577333-Remove-abort-warning-in-manual/runtest.sh new file mode 100755 index 0000000..b08ac5d --- /dev/null +++ b/tests/Sanity/bz1577333-Remove-abort-warning-in-manual/runtest.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz1577333-Remove-abort-warning-in-manual +# Description: Test for BZ#1577333 (Remove abort() warning in manual.) +# 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" + +rlJournalStart + rlPhaseStartSetup + rlMountAllCommon + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlRun "zgrep -qi 'The GNU C Library' /usr/share/info/libc.info*" 0 + rlRun "zcat /usr/share/info/libc.info* 2>/dev/null | grep -qi 'Proposed Federal censorship regulations'" 1 + rlRun "zcat /usr/share/info/libc.info* 2>/dev/null | grep -qi 'prohibit us from giving you information'" 1 + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/main.fmf b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/main.fmf new file mode 100644 index 0000000..cdbeeb6 --- /dev/null +++ b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#1592475 (glibc headers add ipc STAT_ANY constants) +description: | + Bug summary: glibc headers: add ipc STAT_ANY constants + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1592475 +contact: Sergey Kolosov +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1592475 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - gcc + - glibc + - glibc-devel +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants +extra-task: /tools/glibc/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants diff --git a/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/runtest.sh b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/runtest.sh new file mode 100755 index 0000000..a33b6bc --- /dev/null +++ b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/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/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants +# Description: Test for BZ#1592475 (glibc headers add ipc STAT_ANY constants) +# 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" +TESTPROGS="tst-msgctl tst-semctl tst-shmctl" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp tst-msgctl.c tst-semctl.c tst-shmctl.c $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + for PROG in $TESTPROGS + do + rlPhaseStartTest $PROG + rlRun -c "gcc ${PROG}.c -o $PROG" + rlAssertExists "$PROG" + rlPhaseEnd + done + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-msgctl.c b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-msgctl.c new file mode 100644 index 0000000..8ed2e08 --- /dev/null +++ b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-msgctl.c @@ -0,0 +1,25 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int idx,mid; + struct msqid_ds ds; + + + if (argc < 2) { + printf("Usage: ./prog \n\n"); + return 1; + } + + idx = atoi(argv[1]); + + mid = msgctl(idx, MSG_STAT_ANY, &ds); + if (mid == -1) { + perror("msgctl"); + exit(1); + } + return 0; +} + diff --git a/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-semctl.c b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-semctl.c new file mode 100644 index 0000000..1a7b54e --- /dev/null +++ b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-semctl.c @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int idx,sid; + + union semun { + int val; + struct semid_ds *buf; + unsigned short *array; + } semopts; + semopts.val=1; + if (argc < 2) { + printf("Usage: ./prog \n\n"); + return 1; + } + + idx = atoi(argv[1]); + + sid = semctl(idx, 0, SEM_STAT_ANY, semopts); + if( sid == -1) + { + perror("semctl"); + exit(1); + } + + return 0; +} + diff --git a/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-shmctl.c b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-shmctl.c new file mode 100644 index 0000000..0b49e50 --- /dev/null +++ b/tests/Sanity/bz1592475-glibc-headers-add-ipc-STAT-ANY-constants/tst-shmctl.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include +#include + +int main(int argc, char **argv) +{ + struct shmid_ds buf; + int shmid; + int ret; + + if (argc < 2) { + printf("Usage: prog2 \n\n"); + return 1; + } + shmid = atoi(argv[1]); + + ret = shmctl(shmid, SHM_STAT_ANY, &buf); + if (ret < 0) + perror("shmctl SHM_STAT_ANY"); + else + printf("shmctl(%d, SHM_STAT_ANY, ...)=%d\n", shmid, ret); + + return 0; +} diff --git a/tests/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes/main.fmf b/tests/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes/main.fmf new file mode 100644 index 0000000..11ad614 --- /dev/null +++ b/tests/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes/main.fmf @@ -0,0 +1,19 @@ +summary: Test for BZ#1661508 (glibc Adjust to rpm's find-debuginfo.sh changes,) +description: | + Bug summary: glibc: Adjust to rpm's find-debuginfo.sh changes, to keep stripping binaries [rhel-7.7] + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1661508 +contact: Sergey Kolosov +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1661508 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - binutils + - file + - glibc + - glibc-common +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes +extra-task: /tools/glibc/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes diff --git a/tests/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes/runtest.sh b/tests/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes/runtest.sh new file mode 100755 index 0000000..d2e9cf0 --- /dev/null +++ b/tests/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes/runtest.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz1661508-glibc-Adjust-to-rpm-s-find-debuginfo-sh-changes +# Description: Test for BZ#1661508 (glibc Adjust to rpm's find-debuginfo.sh changes,) +# 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" +SKIPLIST='/usr/bin/ld.so' + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + BINLIST=$(rpm -ql glibc-common glibc|grep bin|tr '\n' ' ') + for BIN in $BINLIST + do + rlAssertExists $BIN + readelf -h $BIN &> /dev/null + RES=$? + if [[ $RES -eq 1 ]] + then + rlLog "$BIN is not binary file" + continue + fi + echo $SKIPLIST | grep -q $BIN + RES=$? + if [[ $RES -eq 0 ]] + then + rlLog "$BIN is marked to be skipped" + continue + fi + rlRun -c "file $BIN > ${BIN}_out" + rlAssertGrep ", stripped" ${BIN}_out + rlAssertNotGrep ", not stripped" ${BIN}_out + done + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/main.fmf b/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/main.fmf new file mode 100644 index 0000000..dbdcff9 --- /dev/null +++ b/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/main.fmf @@ -0,0 +1,19 @@ +summary: Test for BZ#1699194 (glibc Address conflict between and) +description: | + Bug summary: glibc: Address conflict between and + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1699194 +contact: Sergey Kolosov +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1699194 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - gcc + - glibc + - glibc-devel + - kernel-headers +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and +extra-task: /tools/glibc/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and diff --git a/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/runtest.sh b/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/runtest.sh new file mode 100755 index 0000000..36c1616 --- /dev/null +++ b/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/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/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and +# Description: Test for BZ#1699194 (glibc Address conflict between and) +# 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" + +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" + rlAssertExists "$TESTPROG" + rlRun -c "./${TESTPROG}" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/tst.c b/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/tst.c new file mode 100644 index 0000000..38f5a20 --- /dev/null +++ b/tests/Sanity/bz1699194-glibc-Address-conflict-between-sys-stat-h-and/tst.c @@ -0,0 +1,15 @@ +#define _GNU_SOURCE +#include +#include +#include + +int main(){ + int dirfd = AT_FDCWD; + const char *pathname=""; + int flags = AT_SYMLINK_NOFOLLOW; + unsigned int mask = STATX_ALL; + struct statx buf; + int ret; + ret = statx(dirfd,pathname,flags,mask,&buf); + return 0; +} diff --git a/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/main.fmf b/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/main.fmf new file mode 100644 index 0000000..abfe96f --- /dev/null +++ b/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/main.fmf @@ -0,0 +1,18 @@ +summary: Test for BZ#1930302 (glibc provide IPPROTO_MPTCP definition) +description: | + Bug summary: glibc: provide IPPROTO_MPTCP definition + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1930302 +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1930302 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - gcc + - glibc + - glibc-devel +duration: 5m +extra-summary: /tools/glibc/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition +extra-task: /tools/glibc/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition diff --git a/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/runtest.sh b/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/runtest.sh new file mode 100755 index 0000000..1e7ca6d --- /dev/null +++ b/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/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/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition +# Description: Test for BZ#1930302 (glibc provide IPPROTO_MPTCP definition) +# 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-proto" + +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" + rlAssertExists "$TESTPROG" + #rlRun -c "./${TESTPROG}" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/tst-proto.c b/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/tst-proto.c new file mode 100644 index 0000000..b68026b --- /dev/null +++ b/tests/Sanity/bz1930302-glibc-provide-IPPROTO-MPTCP-definition/tst-proto.c @@ -0,0 +1,33 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include + +#ifndef IPPROTO_MPTCP +#pragma message "IPPROTO_MPTCP is not defined!" +#endif +#ifndef IPPROTO_ETHERNET +#pragma message "IPPROTO_ETHERNET is not defined!" +#endif + +int main() { + int res; + + int fd1 = socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP); + if (res<0) { + perror("IPPROTO_MPTCP"); + return 1; + } + close (fd1); + int fd2 = socket(AF_PACKET, SOCK_RAW, IPPROTO_ETHERNET); + if (fd2<0) { + perror("IPPROTO_ETHERNET"); + return 2; + } + close (fd2); + + return 0; +} + diff --git a/tests/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and/main.fmf b/tests/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and/main.fmf new file mode 100644 index 0000000..964c54f --- /dev/null +++ b/tests/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and/main.fmf @@ -0,0 +1,19 @@ +summary: Test for BZ#1940686 (glibc Remove glibc-headers-x86 and) +description: | + Bug summary: glibc: Remove glibc-headers-x86 and glibc-headers-s390 + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1940686 +adjust: + - enabled: false + when: arch != x86_64, s390x +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1940686 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and +extra-task: /tools/glibc/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and diff --git a/tests/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and/runtest.sh b/tests/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and/runtest.sh new file mode 100755 index 0000000..36ef331 --- /dev/null +++ b/tests/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and/runtest.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and +# Description: Test for BZ#1940686 (glibc Remove glibc-headers-x86 and) +# 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" +TESTPACKAGE="glibc-headers" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun -l "PACK_VERSION=$(rpm --qf "%{version}-%{release}\n" -q ${PACKAGE}.`arch`)" + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + if [[ $(rlGetPrimaryArch) == x86_64 ]] + then + rlRun "dnf repoquery ${TESTPACKAGE}-x86 >log" + rlAssertNotGrep ${TESTPACKAGE}-x86-0:${PACK_VERSION} log + elif [[ $(rlGetPrimaryArch) == s390x ]] + then + rlRun "dnf repoquery ${TESTPACKAGE}-s390 >log" + rlAssertNotGrep ${TESTPACKAGE}-s390-0:${PACK_VERSION} log + fi + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package/main.fmf b/tests/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package/main.fmf new file mode 100644 index 0000000..47ab7ca --- /dev/null +++ b/tests/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package/main.fmf @@ -0,0 +1,15 @@ +summary: What the test does +description: '' +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=1971664 +contact: Sergey Kolosov +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc + - glibc-gconv-extra +duration: 10m +extra-summary: /tools/glibc/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package +extra-task: /tools/glibc/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package diff --git a/tests/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package/runtest.sh b/tests/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package/runtest.sh new file mode 100755 index 0000000..de2be4a --- /dev/null +++ b/tests/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package/runtest.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz1971664-Split-extra-gconv-modules-into-a-separate-package +# Description: What the test does +# 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" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlPhaseEnd + + rlPhaseStartTest + rlAssertRpm glibc-gconv-extra + rlPhaseEnd + + rlPhaseStartCleanup + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/main.fmf b/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/main.fmf new file mode 100644 index 0000000..d447358 --- /dev/null +++ b/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/main.fmf @@ -0,0 +1,23 @@ +summary: 'Test for BZ#2011754 (RHEL9.0 - S390: Add PCI_MIO and SIE HWCAPs in glibc + header file)' +description: | + Bug summary: RHEL9.0 - S390: Add PCI_MIO and SIE HWCAPs in glibc header file + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2011754 +contact: Martin Coufal +adjust: + - enabled: false + when: arch != s390x +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2011754 +component: + - glibc + - glibc-devel + - gcc +test: ./runtest.sh +framework: beakerlib +require: + - glibc + - gcc +duration: 10m +extra-summary: /tools/glibc/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs +extra-task: /tools/glibc/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs diff --git a/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/runtest.sh b/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/runtest.sh new file mode 100755 index 0000000..5d0ca9a --- /dev/null +++ b/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/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/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs +# Description: Test for BZ#2011754 (RHEL9.0 - S390: Add PCI_MIO and SIE HWCAPs in glibc header file) +# 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" +TESTPROG="test" + +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" + rlAssertExists "$TESTPROG" + rlRun -l "./${TESTPROG}" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/test.c b/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/test.c new file mode 100644 index 0000000..b94d80c --- /dev/null +++ b/tests/Sanity/bz2011754-add-PCI_MIO-andSIE-HWCAPs/test.c @@ -0,0 +1,8 @@ +#include +#include + +int main (void) { + printf ("%d\n", HWCAP_S390_PCI_MIO); + printf ("%d\n", HWCAP_S390_SIE); + return 0; +} diff --git a/tests/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support/main.fmf b/tests/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support/main.fmf new file mode 100644 index 0000000..8d01c18 --- /dev/null +++ b/tests/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support/main.fmf @@ -0,0 +1,16 @@ +summary: Test for BZ#2021671 (glibc Backport glibc-docs subpackage to support) +description: | + Bug summary: glibc: Backport glibc-docs subpackage to support smaller production containers. + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2021671 +contact: Sergey Kolosov +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2021671 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc-doc +duration: 5m +extra-summary: /tools/glibc/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support +extra-task: /tools/glibc/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support diff --git a/tests/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support/runtest.sh b/tests/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support/runtest.sh new file mode 100755 index 0000000..457ce37 --- /dev/null +++ b/tests/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support/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/Sanity/bz2021671-glibc-Backport-glibc-docs-subpackage-to-support +# Description: Test for BZ#2021671 (glibc Backport glibc-docs subpackage to support) +# 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 + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + rlPhaseEnd + + rlPhaseStartTest + rlAssertRpm glibc-doc + rlRun -l "rpm -ql glibc-doc > log" + rlAssertGrep "/usr/share/doc/glibc/rtld-debugger-interface.txt" log + rlAssertGrep "/usr/share/info/libc.info-" log + rlAssertNotExists "/usr/share/doc/glibc/README" + rlAssertNotExists "/usr/share/doc/glibc/INSTALL" + rlAssertNotExists "/usr/share/doc/glibc/NEWS" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack/main.fmf b/tests/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack/main.fmf new file mode 100644 index 0000000..f11f615 --- /dev/null +++ b/tests/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack/main.fmf @@ -0,0 +1,20 @@ +summary: 'Test for BZ#2054790 (locale: de-duplicate LC_CTYPE files in glibc-langpack-* + by symlinking identical copies to C.utf8 variant)' +description: | + Bug summary: locale: de-duplicate LC_CTYPE files in glibc-langpack-* by symlinking identical copies to C.utf8 variant + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2054790 +contact: Martin Coufal +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2054790 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - glibc + - glibc-all-langpacks +duration: 10m +extra-summary: + /tools/glibc/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack +extra-task: + /tools/glibc/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack diff --git a/tests/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack/runtest.sh b/tests/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack/runtest.sh new file mode 100755 index 0000000..b8380b4 --- /dev/null +++ b/tests/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack/runtest.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz2054790-locale-de-duplicate-LC_CTYPE-files-in-glibc-langpack +# Description: Test for BZ#2054790 (locale: de-duplicate LC_CTYPE files in glibc-langpack-* by symlinking identical copies to C.utf8 variant) +# 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 + +PACKAGE="glibc" +LC_CTYPE_ORIG='/usr/lib/locale/C.utf8/LC_CTYPE' + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "PRESENT_LANGPACKS=\"$(rpm -qa | grep glibc-langpack | tr '\n' ' ')\"" + rlRun "yum -y install glibc-langpack-*" + rlRun "tmpdir=$(mktemp -d)" + rlRun "pushd $tmpdir" + rlRun -l "C_UTF8_LC_CTYPE_MD5SUM=$(md5sum ${LC_CTYPE_ORIG} | cut -d " " -f1)" + rlPhaseEnd + + rlPhaseStartTest + for file in $(find /usr/lib/locale/ -name LC_CTYPE); do + # skip original (dest of symlinks) + if [[ "${file}" == "${LC_CTYPE_ORIG}" ]]; then + rlLogInfo "Original can be skipped" + continue + # symlinks are expected + elif [[ -L ${file} ]]; then + rlLogInfo "Found LC_CTYPE symlink: ${file}" + # if not a symlink, then it shouldn't be identical to '/usr/lib/locale/C.utf8/LC_CTYPE' + else + FILE_MD5SUM=$(md5sum ${file} | cut -d " " -f1) + if [[ "${FILE_MD5SUM}" == "${C_UTF8_LC_CTYPE_MD5SUM}" ]]; then + rlFail "Found LC_CTYPE file that is identical to '${LC_CTYPE_ORIG}' and is not a symlink! (${file})" + fi + fi + done + # test identical files have been grouped via hardlinks - expectiong no output + lang_groups=$(ls -1 /usr/lib/locale | cut -d "_" -f1 | grep -v C.utf8 | grep -v locale-archive | sort -u) + for group in $lang_groups; do + if rlIsRHEL ">=9" || rlIsCentOS ">=9" + then + rlRun -c "hardlink -p -o -t -n -v /usr/lib/locale/${group}_* /usr/lib/locale/C.utf8 > hardlink.out" + # sanity check - at least one file found in each locale group + rlRun -c "grep -E '^Files:[[:space:]]*0' hardlink.out" 1 + rlRun -c "grep '\[DryRun\]' hardlink.out > log" 0,1 + # there are still two small files LC_MEASUREMENT and LC_PAPER in the rest. Talked with developer, that's ok + rlRun -c "grep -v 'LC_MEASUREMENT\|LC_PAPER' log" 1 + rlFileSubmit "hardlink.out" + rlFileSubmit "log" + else + rlRun "hardlink -c -n /usr/lib/locale/${group}_* /usr/lib/locale/C.utf8 > hardlink.out 2>&1" + [[ -s hardlink.out ]] && rlFail "Identical files should be grouped via hardlinks: $(cat hardlink.out)" + fi + done + rlPhaseEnd + + rlPhaseStartCleanup + # remove langpacks installed in setup phase + rpm -qa | grep glibc-langpack > langpack_list.txt + for langpack in $PRESENT_LANGPACKS; do + rlRun "sed -i 's/$langpack//' langpack_list.txt" + done + rlRun "yum -y remove $(cat langpack_list.txt | tr '\n' ' ')" + rlRun "popd" + rlRun "rm -rf $tmpdir" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers/main.fmf b/tests/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers/main.fmf new file mode 100644 index 0000000..55c6d7e --- /dev/null +++ b/tests/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers/main.fmf @@ -0,0 +1,20 @@ +summary: What the test does +description: '' +link: + - relates: https://bugzilla.redhat.com/show_bug.cgi?id=2063247 +contact: Sergey Kolosov +adjust: + - enabled: false + when: arch != x86_64 +component: + - glibc +test: ./runtest.sh +framework: beakerlib +require: + - binutils + - glibc +duration: 5m +extra-summary: + /tools/glibc/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers +extra-task: + /tools/glibc/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers diff --git a/tests/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers/runtest.sh b/tests/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers/runtest.sh new file mode 100755 index 0000000..b80185f --- /dev/null +++ b/tests/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers/runtest.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/bz2063247-Respin-glibc-with-new-systemtap-to-avoid-XMM-registers +# Description: What the test does +# 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" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest + rlRun -c "readelf -n /lib64/libc.so.6 > log" + rlAssertNotGrep "xmm" log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/main.fmf b/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/main.fmf new file mode 100644 index 0000000..3317abb --- /dev/null +++ b/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/main.fmf @@ -0,0 +1,13 @@ +summary: What the test does +description: '' +contact: Martin Coufal +component: + - glibc +test: ./runtest.sh +framework: beakerlib +recommend: + - glibc +duration: 5m +extra-summary: /tools/glibc/Sanity/sched_getcpu-returns-correct-pinned-CPU +extra-task: /tools/glibc/Sanity/sched_getcpu-returns-correct-pinned-CPU +id: 8d0f7a70-771d-43ff-964c-67c05b3935cb diff --git a/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/runtest.sh b/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/runtest.sh new file mode 100755 index 0000000..00205d8 --- /dev/null +++ b/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/runtest.sh @@ -0,0 +1,60 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Sanity/sched_getcpu-returns-correct-pinned-CPU +# Description: What the test does +# Author: Martin Coufal +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2024 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" +TEST_NAME="tst-bz31479" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "cp ${TEST_NAME}.c $TmpDir" + rlRun "pushd $TmpDir" + rlRun "gcc ${TEST_NAME}.c -o $TEST_NAME" + rlAssertExists $TEST_NAME + + # select random CPU + CPU_NUMBER=$(lscpu | grep "^CPU(s):" | cut -d ':' -f 2 | xargs) + rlAssertGreaterOrEqual "At least 2 CPUs are needed for this test" $CPU_NUMBER 2 + SELECTED_CPU=$((RANDOM % $CPU_NUMBER)) + rlPhaseEnd + + rlPhaseStartTest + rlRun "taskset -c $SELECTED_CPU ./$TEST_NAME &> ${TEST_NAME}.log" + rlAssertExists "${TEST_NAME}.log" + rlAssertGrep "CPU $SELECTED_CPU" ${TEST_NAME}.log + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/tst-bz31479.c b/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/tst-bz31479.c new file mode 100644 index 0000000..7a53a07 --- /dev/null +++ b/tests/Sanity/sched_getcpu-returns-correct-pinned-CPU/tst-bz31479.c @@ -0,0 +1,9 @@ +#define _GNU_SOURCE +#include +#include + +int main() { + printf("CPU %d\n",sched_getcpu()); + return 0; +} +