Skip to content

Commit 4bc978c

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 4bc978c

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'
@@ -157,6 +155,11 @@ def setUp(self):
157155
self.sourcedir = os.path.join(self.buldir, self.testdir)
158156
# cmsg_* tests from net/ subdirectory takes a lot of time to complete.
159157
# Until they have been root caused skip them.
158+
if self.subtest == 'pmu/event_code_tests':
159+
pmu_test_dir = os.path.join(
160+
self.sourcedir, 'powerpc/pmu/event_code_tests')
161+
if not os.path.exists(pmu_test_dir):
162+
self.cancel("selftest not supported on distro")
160163
if self.comp == 'net':
161164
make_path = self.sourcedir + "/net/Makefile"
162165
process.system("sed -i 's/^.*cmsg_so_mark.sh/#&/g' %s" % make_path,

0 commit comments

Comments
 (0)