Skip to content

Commit 0f7d506

Browse files
committed
kernel/kselftest.py: fix cancellation check for pmu event_code_tests
Move the cancellation check for pmu/event_code_tests to the test execution block to ensure it correctly verifies the existence of the required directory and avoids early cancellation. Signed-off-by: Disha Goel <disgoel@linux.ibm.com>
1 parent d74c03e commit 0f7d506

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

kernel/kselftest.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ def setUp(self):
129129
process.system("make install -C %s" % self.sourcedir,
130130
shell=True, sudo=True)
131131
else:
132-
if self.subtest == 'pmu/event_code_tests':
133-
self.cancel("selftest not supported on distro")
134132
# Make sure kernel source repo is configured
135133
if detected_distro.name in ['centos', 'fedora', 'rhel']:
136134
src_name = 'kernel'
@@ -183,6 +181,11 @@ def test(self):
183181
if self.subtest == "ksm_tests":
184182
self.ksmtest()
185183
else:
184+
if self.subtest == 'pmu/event_code_tests':
185+
pmu_test_dir = os.path.join(self.sourcedir,
186+
'powerpc/pmu/event_code_tests')
187+
if not os.path.exists(pmu_test_dir):
188+
self.cancel("selftest not supported on distro")
186189
if self.subtest:
187190
test_comp = self.comp + "/" + self.subtest
188191
else:

0 commit comments

Comments
 (0)