Skip to content

Commit 28d7150

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 28d7150

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'
@@ -155,6 +153,11 @@ def setUp(self):
155153
self.buldir = "/usr/src/linux"
156154

157155
self.sourcedir = os.path.join(self.buldir, self.testdir)
156+
if self.subtest == 'pmu/event_code_tests':
157+
pmu_test_dir = os.path.join(
158+
self.sourcedir, 'powerpc/pmu/event_code_tests')
159+
if not os.path.exists(pmu_test_dir):
160+
self.cancel("selftest not supported on distro")
158161
# cmsg_* tests from net/ subdirectory takes a lot of time to complete.
159162
# Until they have been root caused skip them.
160163
if self.comp == 'net':

0 commit comments

Comments
 (0)