From f2e99b89d2a694c2a199c31a09c6bd4e04a0392e Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Tue, 6 Apr 2021 17:56:28 -0400 Subject: [tests] Add distro specific helper decorators Adds helper decorators to define specific test methods for use on specific distributions only. Currently two decorators are available: @redhat_only Only run on fedora, centos, or rhel @ubuntu_only Only run on ubuntu or debian Note that these decorators are only intended for individual `test_*` methods, and will not function to define distro-specific test classes. These should make it easier to write plugin test cases where packaging differences between distributions otherwise makes plugin tests either impossible needlessly complex to write generically. Related: #2431 Signed-off-by: Jake Hunsaker --- tests/report_tests/smoke_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/report_tests') diff --git a/tests/report_tests/smoke_tests.py b/tests/report_tests/smoke_tests.py index cc186a91..89d5e301 100644 --- a/tests/report_tests/smoke_tests.py +++ b/tests/report_tests/smoke_tests.py @@ -10,7 +10,7 @@ import re from avocado.utils import process -from sos_tests import StageOneReportTest, SOS_BIN, skipIf, RH_DIST +from sos_tests import StageOneReportTest, SOS_BIN, redhat_only # These are the header strings in --list-plugins output @@ -44,7 +44,7 @@ class AllPluginSmokeTest(StageOneReportTest): for plugin in self.plugs: self.assertPluginIncluded(plugin) - @skipIf(lambda x: x.local_distro not in RH_DIST, "Not distro relevant") + @redhat_only def test_expected_warnings_displayed(self): """We can expect specific plugins to always generate a warning during setup if they are enabled on systems that are not configured for those -- cgit