Introduce Fedora CI gating.

Introduce CI gating.  This will introduce new testcase called
fedora-ci.koji-build.tier0.functional and will configure it
as a mandatory CI gating testcase for elfutils fedora builds.

The provided test case is executed by running ./runtest.sh.
The main.fmf file keeps the testcase metadata.  The plans and
.fmf folders contain configuration files needed for execution
of provided testcases within the Fedora CI infrastructure.

The provided testcase relies upon the debuginfod server
providing needed kernel-debuginfo.  It was tested with
staging instance of the debuginfod server running at
https://debuginfod.stg.fedoraproject.org/ .

Provided test uses Flexible Metadata Format, as documented in
https://fmf.readthedocs.io/ .
This commit is contained in:
Martin Cermak 2021-04-14 17:02:36 +02:00
parent 849807987a
commit bd7878dd23
9 changed files with 83 additions and 69 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

20
gating.yaml Normal file
View File

@ -0,0 +1,20 @@
--- !Policy
product_versions:
- fedora-*
decision_context: bodhi_update_push_stable
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:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

6
plans/ci.fmf Normal file
View File

@ -0,0 +1,6 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib

View File

@ -0,0 +1,15 @@
summary: Quick test that systemtap generally works
description: ''
contact:
- Petr Muller <pmuller@redhat.com>
component:
- systemtap
test: ./runtest.sh
framework: beakerlib
recommend:
- koji
- systemtap
- kernel-devel
duration: 1h
extra-summary: /tools/systemtap/Sanity/quick-smoke-test
extra-task: /tools/systemtap/Sanity/quick-smoke-test

View File

@ -0,0 +1,41 @@
#!/bin/bash
# runtest.sh of /tools/systemtap/Sanity/quick-smoke-test
. /usr/share/beakerlib/beakerlib.sh || exit 1
export DEBUGINFOD_URLS="https://debuginfod.stg.fedoraproject.org/ $DEBUGINFOD_URLS"
export DEBUGINFOD_TIMEOUT=300
# export DEBUGINFOD_PROGRESS=1
# 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 ()
{
set -xe
TMPD=$(mktemp -d)
pushd $TMPD
koji download-build --rpm kernel-`uname -r` --arch `uname -i`
koji download-build --rpm kernel-devel-`uname -r` --arch `uname -i`
koji download-build --rpm kernel-modules-`uname -r` --arch `uname -i`
dnf -y install kernel{,-devel,-modules}-`uname -r`.rpm
popd
rm -rf $TMPD
set +xe
}
rlJournalStart
rlPhaseStartTest
rlRun "rpm -qa | egrep '^(kernel|systemtap)' | sort"
rlRun "uname -r"
rlRun "stap-prep || __install_deps"
rlRun "stap-prep"
rlRun "stap -L 'process(\"stap\").mark(\"*\")' | grep pass"
rlRun "stap -v --example helloworld.stp"
rlRun "stap -v -T 10 -p4 -e 'probe kernel.function(\"do_exit\") {println(\$\$vars)}'"
rlRun "stap -v -T 60 -e 'probe kernel.function(\"vfs_read\"){ println(\$\$vars); exit() }'"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -1,38 +0,0 @@
TOPLEVEL_NAMESPACE=fedora
PACKAGE_NAME=systemtap
RELATIVE_PATH=Sanity/dejagnu-smoketest
export TESTVERSION=1.0
export TEST=/$(TOPLEVEL_NAMESPACE)/$(PACKAGE_NAME)/$(RELATIVE_PATH)
.PHONY: all install download clean
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
chmod a+x ./runtest.sh
clean:
rm -f *~ *.rpm $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
# Generate the testinfo.desc here:
$(METADATA): Makefile
@touch $(METADATA)
# Change to the test owner's name
@echo "Owner: Frank Ch. Eigler <fche@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "Description: smoke test" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: $(PACKAGE_NAME)" >> $(METADATA)
@echo "Requires: $(PACKAGE_NAME)" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
# You may need other fields here; see the documentation
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
Test Name: dejagnu-smoketest
Author:
Short Description: Run a minimal systemtap testsuite

View File

@ -1,17 +0,0 @@
#!/bin/sh
set -e
set -x
dnf debuginfo-install -y kernel
# on Fedora CI, can only assume about 1GB RAM to run these tests
stap -L 'process("stap").mark("*")' | grep pass
# stap -L 'kernel.trace("sys_enter")'
stap -v --example helloworld.stp
stap -v -T 10 -p4 -e 'probe kernel.function("do_exit") {println($$vars)}'
# stap -v -T 10 -e 'probe syscall.* ? {println(argstr)}'
echo
echo RESULT: PASS

View File

@ -1,11 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
tests:
- dejagnu-smoketest
required_packages:
- systemtap-testsuite
- kernel-devel