Init commit

This commit is contained in:
Martin Cermak 2024-07-30 10:02:18 +02:00
commit c2ac856632
6 changed files with 139 additions and 0 deletions

1
.fmf/version Normal file
View file

@ -0,0 +1 @@
1

5
plans/ci.fmf Normal file
View file

@ -0,0 +1,5 @@
summary: CI Gating Plan
discover:
how: fmf
execute:
how: tmt

View file

@ -0,0 +1,13 @@
summary: Unknown-DWARF-DW_FORM_0x25
description: ''
contact: Martin Cermak <mcermak@redhat.com>
component:
- debugedit
test: ./runtest.sh
framework: beakerlib
recommend:
- debugedit
- clang
duration: 48h
extra-summary: /tools/tmp1702384783/Regression/Unknown-DWARF-DW_FORM_0x25
extra-task: /tools/tmp1702384783/Regression/Unknown-DWARF-DW_FORM_0x25

View file

@ -0,0 +1,58 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/tmp1702384783/Regression/Unknown-DWARF-DW_FORM_0x25
# Description: Unknown-DWARF-DW_FORM_0x25
# Author: Martin Cermak <mcermak@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="debugedit"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)"
rlRun "pushd $TmpDir"
rlRun "rpm -qf $(which debugedit) $(which clang)"
rlRun "echo 'int main(){}' | clang -x c - -g -gdwarf-5"
rlRun "./a.out"
rlPhaseEnd
rlPhaseStartTest
# https://issues.redhat.com/browse/RHEL-7315
# Actual results: debugedit: a.out: Unknown DWARF DW_FORM_0x25
# Expected results: Program exits with error:
# Reproduced with debugedit-5.0-4.el9
# Verified with debugedit-5.0-5.el9
rlRun "debugedit ./a.out |& tee o"
rlRun "grep -F 'Unknown DWARF DW_FORM_0x25' o" 1
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

15
tests/testsuite/main.fmf Normal file
View file

@ -0,0 +1,15 @@
summary: This test runs upstream testsuite for debugedit
description: |
Testsuite encapsulating upstream tests for debugedit, which are included in debugedit src.rpm package.
This test always fetches (from /mnt/redhat/) appropriate version of that src.rpm for installed debugedit.
contact: Martin Coufal <mcoufal@redhat.com>
component:
- debugedit
test: ./runtest.sh
framework: beakerlib
recommend:
- debugedit
- rpm-build
duration: 99m
extra-summary: /tools/debugedit/testsuite
extra-task: /tools/debugedit/testsuite

47
tests/testsuite/runtest.sh Executable file
View file

@ -0,0 +1,47 @@
#!/bin/bash
. /usr/share/beakerlib/beakerlib.sh
. /usr/bin/rhts_environment.sh
rlJournalStart
rlPhaseStartSetup
rlRun "BIN=`which debugedit`"
rlRun "RPM=`rpm --queryformat='%{name}\n' -qf $BIN`"
rlRun "TMP=$(mktemp -d)"
rlRun "pushd $TMP"
rlFetchSrcForInstalled $RPM
rlRun "rpm --define='_topdir $TMP' -Uhv *debugedit*.src.rpm"
rlRun "yum-builddep --enablerepo=\* -y $TMP/SPECS/debugedit.spec"
rlRun "rpmbuild --define='_topdir $TMP' -bc SPECS/debugedit.spec"
rlRun "b=$(find BUILD -maxdepth 1 -mindepth 1 -type d ! -name '*-SPECPARTS')"
# shellcheck disable=SC2154
rlRun "pushd $b"
rlRun "useradd debugedittest" 0,9
rlRun "chown -R debugedittest $TMP"
rlPhaseEnd
rlPhaseStartTest
wd=$(pwd)
rlRun "su - debugedittest -c \"make -C $wd check\" |& tee $wd/test.log"
rlRun "PASSED=$(grep -c "\sok$" test.log )"
rlRun "FAILED=$(grep -c "\sFAILED\s" test.log )"
rlRun "[[ $PASSED -gt 0 ]]"
rlRun "[[ $FAILED -eq 0 ]]"
# Archive artifacts
tarball='/tmp/artifacts.tar.xz'
rlRun "rm -rf $tarball"
rlRun "tar cfJ $tarball $TMP"
rlFileSubmit "$tarball"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TMP $tarball"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd