Skip to contentSkip to conversation

selftests/damon/sysfs_memcg_path_leak: define ksft_skip

RFC PATCH In review SJ Park 3 participants 6 messages Oct 30 – Oct 31

Subsystems (4)
lore
Share & tools
lore

SJ Park

author maintainer
#0 lore raw

RFC PATCH 1/1 selftests/damon/sysfs_memcg_path_leak: define ksft_skip

sysfs_memcg_path_leak test uses $ksft_skip without defining it. As a result, the test is marked as passed while it was skipped, like below.

    $ ./sysfs_memcg_path_leak.sh
    Run as root
    $ echo $?
    0

Users who run the test could therefore wrongly believe the test was run and passed while it was skipped.

Define the value at the beginning of the test. After this patch, the exit code reflects the skip.

    $ ./sysfs_memcg_path_leak.sh
    Run as root
    $ echo $?
    4
Fixes dfa3cf0bc018 ("selftets/damon: add a test for memcg_path leak")
Cc <[email protected]> # 6.17.x
---
 tools/testing/selftests/damon/sysfs_memcg_path_leak.sh | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/damon/sysfs_memcg_path_leak.sh +3 -0
index 34c37129c49fe..d407dddb879ec 100755
@@ -1,6 +1,9 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
 if [ $EUID -ne 0 ]
 then
 	echo "Run as root"

base-commit: 20b1ca206f8a664a16ad3006262c63b5d37b1ecc

Signature · 1 line
2.47.3
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 19 lines

sysfs_memcg_path_leak test uses $ksft_skip without defining it. As a result, the test is marked as passed while it was skipped, like below.

    $ ./sysfs_memcg_path_leak.sh
    Run as root
    $ echo $?
    0

Users who run the test could therefore wrongly believe the test was run and passed while it was skipped.

Define the value at the beginning of the test. After this patch, the exit code reflects the skip.

    $ ./sysfs_memcg_path_leak.sh
    Run as root
    $ echo $?
    4
Quoted 4 lines
Fixes dfa3cf0bc018 ("selftets/damon: add a test for memcg_path leak")
Cc <[email protected]> # 6.17.x

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to SJ Park

Hi SJ,

Quoted 1 line · On Thu, 29 Oct 2026 21:46:42 -0700 SJ Park wrote:

Define the value at the beginning of the test.

Makes sense to me.

Thanks,
Aveline Noir

author maintainer
#3 lore raw
Quoted 7 lines · On Sat, 31 Oct 2026 15:36:00 +1100 Aveline Noir <[email protected]> wrote:

Hi SJ,

Quoted 1 line · On Thu, 29 Oct 2026 21:46:42 -0700 SJ Park wrote:

Define the value at the beginning of the test.

Makes sense to me.

Thank you for reviewing, Aveline. No pressure, but have you forgot giving your
Reviewed-by: tag?

Thanks,
SJ

[...]

Reviewed-by Tested-by
#4 lore raw

Hi SJ,

Quoted 1 line · On Sat, 31 Oct 2026 08:38:58 -0700 SJ Park wrote:

Thank you for reviewing, Aveline.

Oh, looks like I forgot that. Thanks for the reminder.

That also gives me an idea: maybe I could build a modular tool to help write emails. Building on b4 might be a good starting point.

Tested the non-root skip path on x86-64 Linux with Bash 5.3.20:
the exit status changed from 0 to 4.

Thanks,
Aveline Noir

author maintainer
#5 lore raw
Quoted 7 lines · On Sun, 01 Nov 2026 03:34:41 +1100 Aveline Noir <[email protected]> wrote:

Hi SJ,

Quoted 1 line · On Sat, 31 Oct 2026 08:38:58 -0700 SJ Park wrote:

Thank you for reviewing, Aveline.

Oh, looks like I forgot that. Thanks for the reminder.

No worries!

Quoted 3 lines

That also gives me an idea: maybe I could build a modular tool to help write emails. Building on b4 might be a good starting point.

Sounds like a good plan!

Quoted 6 lines

Tested the non-root skip path on x86-64 Linux with Bash 5.3.20:
the exit status changed from 0 to 4.

Thank you for reviewing and testing!

Thanks,
SJ

[...]