CI Tests: Set DEBUGINFOD_URLS based on test FMF context.

Tests are supposed to be executed within defined context, such as e.g.
tmt --root . -c arch=x86_64 -c distro=fedora-38 -c trigger=build run ...

FTR: https://tmt.readthedocs.io/en/stable/spec/plans.html#context

This update sets DEBUGINFOD_URLS based on the provided distro
via the ci.fmf file.
This commit is contained in:
Martin Cermak 2023-05-19 10:34:46 +02:00
parent 3759fe484f
commit 91acc811a1
9 changed files with 30 additions and 36 deletions

View File

@ -3,13 +3,19 @@ adjust:
- when: distro == fedora
discover+:
filter: 'tier: 1'
environment+:
DEBUGINFOD_URLS: https://debuginfod.fedoraproject.org/
DEBUGINFOD_TIMEOUT: 300
- when: distro == rhel
environment+:
DEBUGINFOD_URLS: https://debuginfod.usersys.redhat.com/
DEBUGINFOD_TIMEOUT: 300
discover:
how: fmf
directory: tests
prepare:
how: install
exclude:
- glibc-headers-x86
- glibc-headers-s390
- name: prepare
how: shell
script: ./plans/prepare.sh
execute:
how: tmt

View File

@ -1,7 +0,0 @@
summary: Setup task
prepare:
script: ./plans/ci/prepare/prepare.sh
recommend:
- koji
- bind-utils
- avahi-tools

View File

@ -1,12 +1,9 @@
#!/bin/bash
export DEBUGINFOD_URLS="https://debuginfod.fedoraproject.org/ $DEBUGINFOD_URLS"
export DEBUGINFOD_TIMEOUT=300
# On Rawhide, the running kernel packages won't probably be avail in
# configured repos. Debuginfo isn't a problem, we access that using
# the debuginfod.
__install_deps ()
__fedora_install_deps ()
{
TMPD=$(mktemp -d)
pushd $TMPD
@ -20,8 +17,12 @@ __install_deps ()
set -xe
source /etc/os-release
# Install needed packages
stap-prep || __install_deps
if [ "$ID" == "fedora" ]; then
stap-prep || __fedora_install_deps
fi
stap-prep
# Report installed packages

View File

@ -50,8 +50,10 @@ rlJournalStart
rlRun "pushd $TmpDir"
# Install needed debuginfo, best effort
rlLogInfo "DEBUGINFOD_URLS=$DEBUGINFOD_URLS"
rlLogInfo "DEBUGINFOD_TIMEOUT=$DEBUGINFOD_TIMEOUT"
rlRun "L=$(stap -p2 -e 'probe python.function.entry {exit()}' | awk -F\" '/process/ {print $2}')" 0-255
rlRun "debuginfo-install -y $L" 0-255
rlRun "debuginfo-install -y $L /usr/bin/python\*" 0-255
rlPhaseEnd
rlPhaseStartTest "Verifying ELF file for presence of .probes section"

View File

@ -31,11 +31,6 @@
PACKAGE="systemtap"
if echo $ID | grep -Fq fedora; then
export DEBUGINFOD_URLS="https://debuginfod.fedoraproject.org/ $DEBUGINFOD_URLS"
export DEBUGINFOD_TIMEOUT=300
fi
_arch=$(arch)
function perf_probe_failed ()
@ -70,6 +65,8 @@ rlJournalStart
rlRun "rpm -qa | egrep '^(kernel|systemtap|perf)' | sort"
rlRun "uname -r"
rlRun "perf --version"
rlLogInfo "DEBUGINFOD_URLS=$DEBUGINFOD_URLS"
rlLogInfo "DEBUGINFOD_TIMEOUT=$DEBUGINFOD_TIMEOUT"
rlPhaseEnd
# bz1162939 ---------------------------------------------------

View File

@ -29,11 +29,11 @@
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
export DEBUGINFOD_URLS="https://debuginfod.fedoraproject.org/ $DEBUGINFOD_URLS"
export DEBUGINFOD_TIMEOUT=300
rlJournalStart
rlPhaseStartSetup
rlLogInfo "DEBUGINFOD_URLS=$DEBUGINFOD_URLS"
rlLogInfo "DEBUGINFOD_TIMEOUT=$DEBUGINFOD_TIMEOUT"
# At this point we simply rely on that the %triggerin scriptlet from
# systemtap-runtime-java did it's job well. There was a hack to force
# trigger it here, but commit respective to this comment removes it.

View File

@ -4,13 +4,10 @@
. /usr/share/beakerlib/beakerlib.sh || exit 1
export DEBUGINFOD_URLS="https://debuginfod.fedoraproject.org/ $DEBUGINFOD_URLS"
export DEBUGINFOD_TIMEOUT=300
# export DEBUGINFOD_PROGRESS=1
rlJournalStart
rlPhaseStartTest
rlLogInfo "DEBUGINFOD_URLS=$DEBUGINFOD_URLS"
rlLogInfo "DEBUGINFOD_TIMEOUT=$DEBUGINFOD_TIMEOUT"
rlRun "rpm -qa | egrep '^(kernel|systemtap)' | sort"
rlRun "uname -r"
rlRun "stap-prep"

View File

@ -33,9 +33,6 @@ CMD='stap'
BIN=$(which --skip-alias $CMD)
PACKAGE="${PACKAGE:-$(rpm -qf --qf='%{name}\n' $BIN | head -1)}"
export DEBUGINFOD_URLS="https://debuginfod.fedoraproject.org/ $DEBUGINFOD_URLS"
export DEBUGINFOD_TIMEOUT=300
function service_stap_server() {
action=$1
retval=${2:-0}
@ -57,6 +54,8 @@ _rhelmajor=$(rpm --eval '%{rhel}')
rlJournalStart
rlPhaseStartSetup
rlLogInfo "DEBUGINFOD_URLS=$DEBUGINFOD_URLS"
rlLogInfo "DEBUGINFOD_TIMEOUT=$DEBUGINFOD_TIMEOUT"
rlRun "TMPDIR=$(mktemp -d)"
rlRun "pushd $TMPDIR"
rlAssertRpm dbus

View File

@ -29,9 +29,6 @@
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
export DEBUGINFOD_URLS="https://debuginfod.fedoraproject.org/ $DEBUGINFOD_URLS"
export DEBUGINFOD_TIMEOUT=300
PACKAGE="$(rpm -qf $( which stap ) | head -n 1 )"
WORKDIR=$( mktemp -d )
TESTUSER=mytestuser
@ -40,6 +37,8 @@ TESTUSER=mytestuser
rlJournalStart
rlPhaseStart WARN "Check the environment"
rlLogInfo "DEBUGINFOD_URLS=$DEBUGINFOD_URLS"
rlLogInfo "DEBUGINFOD_TIMEOUT=$DEBUGINFOD_TIMEOUT"
if ! stap -V 2>&1 | grep -q 'enabled features:.*DYNINST'; then
rlLogWarning "No dyninst available in $PACKAGE"
rlPhaseEnd