diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..648918d --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/README.md b/tests/README.md deleted file mode 100644 index f37b84e..0000000 --- a/tests/README.md +++ /dev/null @@ -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 -> diff --git a/tests/sanity/Makefile b/tests/sanity/Makefile deleted file mode 100644 index 7af6df1..0000000 --- a/tests/sanity/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Description: Basic sanity test for trace-cmd -# Author: Ziqian SUN (Zamir) -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 . -# -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -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) " > $(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) diff --git a/tests/sanity/PURPOSE b/tests/sanity/PURPOSE deleted file mode 100644 index ac1e2e4..0000000 --- a/tests/sanity/PURPOSE +++ /dev/null @@ -1 +0,0 @@ -Basic sanity test for trace-cmd diff --git a/tests/sanity/runtest.sh b/tests/sanity/runtest.sh deleted file mode 100755 index 1198f22..0000000 --- a/tests/sanity/runtest.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Description: Basic sanity test for trace-cmd -# Author: Ziqian SUN (Zamir) -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# 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 . -# -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# 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 diff --git a/tests/scripts/run_tests.sh b/tests/scripts/run_tests.sh new file mode 100644 index 0000000..e98d1b3 --- /dev/null +++ b/tests/scripts/run_tests.sh @@ -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 diff --git a/tests/tests.yml b/tests/tests.yml index e244be9..74425c8 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -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 -