Skip to content

Commit 1106680

Browse files
committed
Merge tag 'linux_kselftest-fixes-6.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull Kselftest fixes from Shuah Khan: - fix syntax error in frequency calculation arithmetic expression in intel_pstate run.sh - add missing cpupower dependency check intel_pstate run.sh - fix idmap_mount_tree_invalid test failure due to incorrect argument - fix watchdog-test run leaving the watchdog timer enabled causing system reboot. With this fix, the test disables the watchdog timer when it gets terminated with SIGTERM, SIGKILL, and SIGQUIT in addition to SIGINT * tag 'linux_kselftest-fixes-6.12-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/watchdog-test: Fix system accidentally reset after watchdog-test selftests/intel_pstate: check if cpupower is installed selftests/intel_pstate: fix operand expected error selftests/mount_setattr: fix idmap_mount_tree_invalid failed to run
2 parents f7292c0 + dc1308b commit 1106680

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

tools/testing/selftests/intel_pstate/run.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ if [ $UID != 0 ] && [ $EVALUATE_ONLY == 0 ]; then
4444
exit $ksft_skip
4545
fi
4646

47+
if ! command -v cpupower &> /dev/null; then
48+
echo $msg cpupower could not be found, please install it >&2
49+
exit $ksft_skip
50+
fi
51+
4752
max_cpus=$(($(nproc)-1))
4853

4954
function run_test () {
@@ -87,9 +92,9 @@ mkt_freq=${_mkt_freq}0
8792

8893
# Get the ranges from cpupower
8994
_min_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $1 } ')
90-
min_freq=$(($_min_freq / 1000))
95+
min_freq=$((_min_freq / 1000))
9196
_max_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $2 } ')
92-
max_freq=$(($_max_freq / 1000))
97+
max_freq=$((_max_freq / 1000))
9398

9499

95100
[ $EVALUATE_ONLY -eq 0 ] && for freq in `seq $max_freq -100 $min_freq`

tools/testing/selftests/mount_setattr/mount_setattr_test.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,13 @@ TEST_F(mount_setattr_idmapped, idmap_mount_tree_invalid)
14141414
ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/b", 0, 0, 0), 0);
14151415
ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/BB/b", 0, 0, 0), 0);
14161416

1417+
ASSERT_EQ(mount("testing", "/mnt/A", "ramfs", MS_NOATIME | MS_NODEV,
1418+
"size=100000,mode=700"), 0);
1419+
1420+
ASSERT_EQ(mkdir("/mnt/A/AA", 0777), 0);
1421+
1422+
ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0);
1423+
14171424
open_tree_fd = sys_open_tree(-EBADF, "/mnt/A",
14181425
AT_RECURSIVE |
14191426
AT_EMPTY_PATH |
@@ -1433,6 +1440,8 @@ TEST_F(mount_setattr_idmapped, idmap_mount_tree_invalid)
14331440
ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/BB/b", 0, 0, 0), 0);
14341441
ASSERT_EQ(expected_uid_gid(open_tree_fd, "B/b", 0, 0, 0), 0);
14351442
ASSERT_EQ(expected_uid_gid(open_tree_fd, "B/BB/b", 0, 0, 0), 0);
1443+
1444+
(void)umount2("/mnt/A", MNT_DETACH);
14361445
}
14371446

14381447
TEST_F(mount_setattr, mount_attr_nosymfollow)

tools/testing/selftests/watchdog/watchdog-test.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,13 @@ int main(int argc, char *argv[])
334334

335335
printf("Watchdog Ticking Away!\n");
336336

337+
/*
338+
* Register the signals
339+
*/
337340
signal(SIGINT, term);
341+
signal(SIGTERM, term);
342+
signal(SIGKILL, term);
343+
signal(SIGQUIT, term);
338344

339345
while (1) {
340346
keep_alive();

0 commit comments

Comments
 (0)