From f6b8fb4ddad5932c8da81af6c5749837e8185c69 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Tue, 9 May 2023 11:00:06 -0400 Subject: [PATCH] Forward port the tests directory for ci testing Resolves: rhbz#2196611 jiraProject == RHELPLAN-156801 Signed-off-by: John Kacur --- rtla.spec | 7 +++++- tests/scripts/run_tests.sh | 44 ++++++++++++++++++++++++++++++++++++++ tests/tests.yml | 9 ++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 tests/scripts/run_tests.sh create mode 100644 tests/tests.yml diff --git a/rtla.spec b/rtla.spec index 154d790..06d4c37 100644 --- a/rtla.spec +++ b/rtla.spec @@ -1,6 +1,6 @@ Name: rtla Version: 5.14.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Real-Time Linux Analysis tools License: GPLv2 @@ -67,6 +67,11 @@ make DESTDIR=%{buildroot} -C Documentation install %changelog +* Tue May 09 2023 John Kacur - 5.14.0-6 +- Forward port the tests directory for ci testing +Resolves: rhbz#2196611 +jiraProject == RHELPLAN-156801 + * Fri May 05 2023 John Kacur - 5.14.0-5 - Correct commandline example Resolves: rhbz#2189440 diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100755 index 0000000..915312e --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -0,0 +1,44 @@ +#!/usr/bin/bash + +# Make sure rtla is installed +if rpm -q rtla; then + : +else + # libtraceevent is a dependency of libtracefs too + sudo dnf install -y libtraceevent + if [[ $? != 0 ]]; then + echo "install of rtla dependency libtraceevent failed" + exit 1 + fi + sudo dnf install -y libtracefs + if [[ $? != 0 ]]; then + echo "install of rtla dependency libtracefs failed" + exit 1 + fi + sudo dnf install -y rtla + if [[ $? != 0 ]]; then + echo "install of rtla dependency libtracefs failed" + 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 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..6d2f53f --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,9 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - simple: + dir: scripts + run: ./run_tests.sh