Enable gating on RHEL-8

Libtracefs is used by rtla. Install rtla and run the same gating tests
as the rtla package.

Resolves: rhbz#2171394
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
This commit is contained in:
Jerome Marchand 2023-09-07 11:23:59 +02:00
parent de30a7b282
commit 82fe4685fd
4 changed files with 68 additions and 1 deletions

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -11,7 +11,7 @@
Name: libtracefs
Version: 1.3.1
Release: 2%{?dist}
Release: 3%{?dist}
License: LGPLv2+ and GPLv2+
Summary: Library for access kernel tracefs
@ -65,6 +65,9 @@ rm -rf %{buildroot}/%{_libdir}/libtracefs.a
%{_libdir}/%{name}.so
%changelog
* Thu Sep 07 2023 Jerome Marchand <jmarchan@redhat.com> - 1.3.1-3
- Add gating (rhbz#2171394)
* Thu Feb 2 2023 Michael Petlan <mpetlan@redhat.com> - 1.3.1-2
- Remove conflict with trace-cmd
Related: rhbz#2159965

47
tests/scripts/run_tests.sh Executable file
View File

@ -0,0 +1,47 @@
#!/usr/bin/bash
if rpm -q --quiet libtracefs; then
:
else
sudo dnf install -y libtracefs
if [[ $? != 0 ]]; then
echo "install of libtracefs failed!"
exit 1
fi
fi
echo "The libtracefs is meant to be used by rtla. Check installation."
if [[ ! -f /usr/lib64/libtracefs.so.1 ]]; then
echo "/usr/lib64/libtracefs.so.1 not found!"
exit 1
fi
echo "Check that rtla works."
if ! rpm -q --quiet rtla; then
sudo dnf install -y rtla
if [[ $? != 0 ]]; then
echo "install rtla failed when libtracefs exist!"
exit 1
fi
fi
rtla
if [[ $? != 1 ]]; then
# When you run rtla without a command, it exits with a failure
echo "rtla failed to run"
exit 1
fi
rtla timerlat -h
if [[ $? != 0 ]]; then
echo "rtla timerlat -h failed"
exit 1
fi
rtla osnoise -h
if [[ $? != 0 ]]; then
echo "rtla osnoise -h failed"
exit 1
fi
exit 0

11
tests/tests.yml Normal file
View File

@ -0,0 +1,11 @@
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- simple:
dir: scripts
run: ./run_tests.sh
required_packages:
- libtracefs trace-cmd