enable RHEL-9 gating for trace-cmd

Resolves: rhbz#1969277

Signed-off-by: Qiao Zhao <qzhao@redhat.com>
This commit is contained in:
Qiao Zhao 2021-06-02 15:26:20 +08:00
parent d90fb34b25
commit 0faa3f6b32
7 changed files with 29 additions and 168 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

@ -1,44 +0,0 @@
About
Trace-cmd tests according to the CI wiki specifically the standard test interface in the [spec](https://fedoraproject.org/wiki/Changes/InvokingTests).
The playbook includes Tier1 level test cases that have been tested in classic contexts and is passing reliably.
The following steps are used to execute the tests using the standard test interface:
Test environment
Make sure you have installed packages from the spec
`# dnf install ansible python2-dnf libselinux-python standard-test-roles ansible python2-dnf libselinux-python standard-test-roles`
Run tests for Classic
~~~~
# export TEST_SUBJECTS=
# sudo ansible-playbook --tags=classic tests.yml
~~~~
Snip of the example test run for Classic tests:
> TASK [standard-test-beakerlib : Run beakerlib tests] *****************************************************************************************************************************************
>
> changed: [localhost] => (item=sanity)
>
> TASK [standard-test-beakerlib : Make the master tests summary log artifact] ******************************************************************************************************************
>
> changed: [localhost] => (item=sanity)
>
> TASK [standard-test-beakerlib : Check the results] *******************************************************************************************************************************************
>
> changed: [localhost]
>
> TASK [standard-test-beakerlib : include_role] ************************************************************************************************************************************************
>
> TASK [str-common : Pull out the logs from test environment to test runner] *******************************************************************************************************************
>
> changed: [localhost]
>
> PLAY RECAP ***********************************************************************************************************************************************************************************
>
> localhost : ok=27 changed=16 unreachable=0 failed=0
>

View File

@ -1,59 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Description: Basic sanity test for trace-cmd
# Author: Ziqian SUN (Zamir) <zsun@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc. All rights reserved.
#
# 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 3 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/>.
#
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PACKAGE_NAME=trace-cmd
export TEST=/kernel/general/ftrace/tools/trace-cmd/upstream
export TESTVERSION=0.1
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build:
chmod a+x runtest.sh
clean:
rm -fr *~ tests-*.rpm
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Ziqian SUN (Zamir) <zsun@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Basic sanity test for trace-cmd" >> $(METADATA)
@echo "TestTime: 30m" >> $(METADATA)
@echo "RunFor: trace-cmd" >> $(METADATA)
@echo "Requires: @development" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv3" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1 +0,0 @@
Basic sanity test for trace-cmd

View File

@ -1,58 +0,0 @@
#!/bin/bash
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Description: Basic sanity test for trace-cmd
# Author: Ziqian SUN (Zamir) <zsun@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2018 Red Hat, Inc. All rights reserved.
#
# 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 3 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 rhts environment
. /usr/bin/rhts-environment.sh
. /usr/share/beakerlib/beakerlib.sh
if ! mount | grep -q debugfs ; then
mount -t debugfs nodev /sys/kernel/debug
fi
trace-cmd reset
rlJournalStart
for TRACER in $(cat /sys/kernel/debug/tracing/available_tracers) ; do
rlPhaseStartTest "Enable ${TRACER} using trace-cmd"
rlRun "trace-cmd start -p ${TRACER}"
rlAssertEquals "Check current tracer" "$(cat /sys/kernel/debug/tracing/current_tracer)" "${TRACER}"
rlAssertEquals "Check tracing status" "$(cat /sys/kernel/debug/tracing/tracing_on)" "1"
rlRun "trace-cmd stop"
rlAssertEquals "Check tracing status" "$(cat /sys/kernel/debug/tracing/tracing_on)" "0"
rlRun "trace-cmd reset"
rlPhaseEnd
if [[ "${TRACER}" == "function" ]]; then
rlPhaseStartTest "Test trace-cmd show"
rlRun "trace-cmd start -p ${TRACER}"
rlWatchdog "trace-cmd show | grep -v '^#' > trace-cmd-show-function.log" 5 INT
rlAssertGreater "At least one line of trace data" $(cat trace-cmd-show-function.log | wc -l) 1
rlRun "trace-cmd stop"
rlRun "trace-cmd reset"
rlFileSubmit trace-cmd-show-function.log
rm -f trace-cmd-show-function.log
rlPhaseEnd
fi
done
rlJournalEnd

View File

@ -0,0 +1,17 @@
#!/usr/bin/bash
# make sure we have trace-cmd installed
if rpm -q --quiet trace-cmd; then
:
else
sudo dnf install -y trace-cmd
if [[ $? != 0 ]]; then
echo "install of trace-cmd failed!"
exit 1
fi
fi
# run a simple command to list available tracers
trace-cmd list || exit 2
exit 0

View File

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