From 8d488dc38eff2ea62143977d8020dfb7739df04d Mon Sep 17 00:00:00 2001 From: Sergey Kolosov Date: Thu, 18 Nov 2021 16:45:23 +0100 Subject: [PATCH] introduce Fedora CI --- .fmf/version | 1 + gating.yaml | 1 + plans/ci.fmf | 6 ++ .../Makefile | 64 ++++++++++++++++++ .../PURPOSE | 5 ++ .../main.fmf | 22 ++++++ .../runtest.sh | 67 +++++++++++++++++++ .../testlib.cc | 17 +++++ 8 files changed, 183 insertions(+) create mode 100644 .fmf/version create mode 100644 plans/ci.fmf create mode 100644 tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/Makefile create mode 100644 tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/PURPOSE create mode 100644 tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/main.fmf create mode 100755 tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/runtest.sh create mode 100644 tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/testlib.cc diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/gating.yaml b/gating.yaml index 4776906..de6a6ec 100644 --- a/gating.yaml +++ b/gating.yaml @@ -7,6 +7,7 @@ decision_contexts: - bodhi_update_push_stable_critpath subject_type: koji_build rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} - !PassingTestCaseRule {test_case_name: baseos-qe.koji-build.scratch-build.validation} --- !Policy product_versions: diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..1ad2c12 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,6 @@ +summary: CI Gating Plan +discover: + how: fmf + directory: tests +execute: + how: beakerlib diff --git a/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/Makefile b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/Makefile new file mode 100644 index 0000000..2852f58 --- /dev/null +++ b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /tools/glibc/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has +# Description: Test for BZ#1882466 (RHEL8.2 - LD_PRELOAD of +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2021 Red Hat, Inc. +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see http://www.gnu.org/licenses/. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/tools/glibc/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE testlib.cc + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Sergey Kolosov " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Test for BZ#1882466 (RHEL8.2 - LD_PRELOAD of > $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 20m" >> $(METADATA) + @echo "RunFor: glibc" >> $(METADATA) + @echo "Requires: gcc-c++ glibc glibc-devel libstdc++ glibc.i686 glibc-devel.i686 libstdc++.i686 libgcc.i686" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2+" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + @echo "Bug: 1882466" >> $(METADATA) + @echo "Releases: RHEL8 RHEL9" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/PURPOSE b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/PURPOSE new file mode 100644 index 0000000..020631c --- /dev/null +++ b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/PURPOSE @@ -0,0 +1,5 @@ +PURPOSE of /tools/glibc/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has +Description: Test for BZ#1882466 (RHEL8.2 - LD_PRELOAD of +Bug summary: RHEL8.2 - LD_PRELOAD of /lib64/libc.so.6 will segfault (glibc) +Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1882466 diff --git a/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/main.fmf b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/main.fmf new file mode 100644 index 0000000..a6ec8e2 --- /dev/null +++ b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/main.fmf @@ -0,0 +1,22 @@ +summary: Test for BZ#1882466 (RHEL8.2 - LD_PRELOAD of /lib64/libc.so.6 will segfault (glibc) + Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1882466 +contact: +- Sergey Kolosov +component: +- glibc +test: ./runtest.sh +framework: beakerlib +recommend: +- gcc-c++ +- glibc +- glibc-devel +- libstdc++ +- glibc.i686 +- glibc-devel.i686 +- libstdc++.i686 +- libgcc.i686 +duration: 20m +extra-summary: /tools/glibc/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has +extra-task: /tools/glibc/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has diff --git a/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/runtest.sh b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/runtest.sh new file mode 100755 index 0000000..f6c6e2e --- /dev/null +++ b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/runtest.sh @@ -0,0 +1,67 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /tools/glibc/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has +# Description: Test for BZ#1882466 (RHEL8.2 - LD_PRELOAD of +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# 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="testlib" +TESTPRELOADLIBS="libpthread.so.0 libstdc++.so.6 libresolv.so.2" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + PACKNVR=$(rpm -q ${PACKAGE}.`arch`) + rlRun "TESTTMPDIR=$(mktemp -d)" + rlRun "cp ${TESTPROG}.cc $TESTTMPDIR" + rlRun "pushd $TESTTMPDIR" + rlPhaseEnd + + rlPhaseStartTest "basic" + rlRun -c "g++ -c -Wall -pedantic -fPIC -fno-exceptions -fno-rtti -fno-builtin ${TESTPROG}.cc -o ${TESTPROG}.o" + rlRun -c "g++ -shared -dynamiclib ${TESTPROG}.o -o lib${TESTPROG}.so.1.0" + rlAssertExists "lib${TESTPROG}.so.1.0" + rlRun -c "LD_PRELOAD=${TESTTMPDIR}/lib${TESTPROG}.so.1.0 /lib64/libc.so.6" + rlPhaseEnd + + rlPhaseStartTest "additional libs" + rlRun -c "LD_PRELOAD=${TESTTMPDIR}/lib${TESTPROG}.so.1.0 /lib64/libc.so.6" + for L in $TESTPRELOADLIBS + do + rlRun -c "LD_PRELOAD=/usr/lib64/$L /lib64/libc.so.6" + [[ $(rlGetArch) == "x86_64" ]] && rlRun -c "LD_PRELOAD=/usr/lib/$L /usr/lib/libc.so.6" + done + rlPhaseEnd + + + + rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TESTTMPDIR" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd diff --git a/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/testlib.cc b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/testlib.cc new file mode 100644 index 0000000..b8a08ec --- /dev/null +++ b/tests/Regression/bz1882466-RHEL8-2-LD-PRELOAD-of-some-lib-that-has/testlib.cc @@ -0,0 +1,17 @@ +#include +#include +#include + + +static int* internal_lock = NULL; + + +static void cuda_hook_init () +{ +printf("%s:%d\n",__func__,__LINE__); + if(internal_lock == NULL) + { +printf("%s:%d\n",__func__,__LINE__); + } +} +