CI Tests: Expand Sanity test suite with branch-specific cases

Add additional test cases to the tests/Sanity directory to expand test
coverage for this release branch.

RPM-Changelog: -
RPM-Skip-Release: yes
This commit is contained in:
Sergey Kolosov 2026-05-31 21:04:53 +02:00
parent 8f42d24c37
commit 46e756739a
45 changed files with 1518 additions and 0 deletions

View File

@ -0,0 +1,16 @@
summary: Test FORTIFY handling of missing mode when O_CREAT or O_TMPFILE flags
are used.
description: ''
contact: Martin Coufal <mcoufal@redhat.com>
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

View File

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

View File

@ -0,0 +1,25 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
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);
}

View File

@ -0,0 +1,5 @@
int main()
{
_Float128 a;
return 0;
}

View File

@ -0,0 +1,17 @@
summary: What the test does
description: ''
adjust:
- enabled: false
when: arch != ppc64le
contact: Sergey Kolosov <skolosov@redhat.com>
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

View File

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

View File

@ -0,0 +1,14 @@
summary: iconv restore verbosity with unrecognized encoding names
description: ''
contact: Sergey Kolosov <skolosov@redhat.com>
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

View File

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

View File

@ -0,0 +1,17 @@
summary:
'Test for RHEL-106166 (glibc: Add Requires(pre) dependency on libgcc).'
description: ''
contact: Sergey Kolosov <skolosov@redhat.com>
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

View File

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

View File

@ -0,0 +1,19 @@
summary: Basic stap test for glibc dynamic linker
description: ''
contact: Sergey Kolosov <skolosov@redhat.com>
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,25 @@
#include <stdlib.h>
#include <stdio.h>
#include <sys/msg.h>
int main(int argc, char *argv[])
{
int idx,mid;
struct msqid_ds ds;
if (argc < 2) {
printf("Usage: ./prog <idx>\n\n");
return 1;
}
idx = atoi(argv[1]);
mid = msgctl(idx, MSG_STAT_ANY, &ds);
if (mid == -1) {
perror("msgctl");
exit(1);
}
return 0;
}

View File

@ -0,0 +1,33 @@
#include <stdlib.h>
#include <stdio.h>
#include <sys/sem.h>
#include <sys/ipc.h>
#include <sys/types.h>
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 <idx>\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;
}

View File

@ -0,0 +1,26 @@
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
struct shmid_ds buf;
int shmid;
int ret;
if (argc < 2) {
printf("Usage: prog2 <shmid>\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;
}

View File

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

View File

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

View File

@ -0,0 +1,19 @@
summary: Test for BZ#1699194 (glibc Address conflict between <sys/stat.h> and)
description: |
Bug summary: glibc: Address conflict between <sys/stat.h> and <linux/stat.h>
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1699194
contact: Sergey Kolosov <skolosov@redhat.com>
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

View File

@ -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 <sys/stat.h> and)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -0,0 +1,15 @@
#define _GNU_SOURCE
#include <fcntl.h>
#include <linux/stat.h>
#include <sys/stat.h>
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;
}

View File

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

View File

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

View File

@ -0,0 +1,33 @@
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdio.h>
#include <netinet/in.h>
#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;
}

View File

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

View File

@ -0,0 +1,59 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/glibc/Sanity/bz1940686-glibc-Remove-glibc-headers-x86-and
# Description: Test for BZ#1940686 (glibc Remove glibc-headers-x86 and)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# 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

View File

@ -0,0 +1,15 @@
summary: What the test does
description: ''
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1971664
contact: Sergey Kolosov <skolosov@redhat.com>
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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,8 @@
#include <stdio.h>
#include <sys/auxv.h>
int main (void) {
printf ("%d\n", HWCAP_S390_PCI_MIO);
printf ("%d\n", HWCAP_S390_SIE);
return 0;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,20 @@
summary: What the test does
description: ''
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2063247
contact: Sergey Kolosov <skolosov@redhat.com>
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

View File

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

View File

@ -0,0 +1,13 @@
summary: What the test does
description: ''
contact: Martin Coufal <mcoufal@redhat.com>
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

View File

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

View File

@ -0,0 +1,9 @@
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
int main() {
printf("CPU %d\n",sched_getcpu());
return 0;
}