diff options
author | Joel Granados <j.granados@samsung.com> | 2023-06-16 10:59:20 +0200 |
---|---|---|
committer | Luis Chamberlain <mcgrof@kernel.org> | 2023-06-18 02:32:54 -0700 |
commit | f2e7a6265e5a5e02ee663eda3d0527dd8230b832 (patch) | |
tree | 8fb79442d2b4508eebc5d39980ae5d1d36b2d0a7 /tools/testing/selftests/sysctl | |
parent | ec866cc6f8a90a65cd085377405c34f0f6d9ba60 (diff) | |
download | linux-stable-f2e7a6265e5a5e02ee663eda3d0527dd8230b832.tar.gz linux-stable-f2e7a6265e5a5e02ee663eda3d0527dd8230b832.tar.bz2 linux-stable-f2e7a6265e5a5e02ee663eda3d0527dd8230b832.zip |
test_sysclt: Test for registering a mount point
Test that target gets created by register_sysctl_mount_point and that no
additional target can be created "on top" of a permanently empty sysctl
table.
Create a mount point target (mnt) in the sysctl test driver; try to
create another on top of that (mnt_error). Output an error if
"mnt_error" is present when we run the sysctl selftests.
Signed-off-by: Joel Granados <j.granados@samsung.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'tools/testing/selftests/sysctl')
-rwxr-xr-x | tools/testing/selftests/sysctl/sysctl.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh index 9c0e9711138b..444b2befda82 100755 --- a/tools/testing/selftests/sysctl/sysctl.sh +++ b/tools/testing/selftests/sysctl/sysctl.sh @@ -34,6 +34,7 @@ ALL_TESTS="$ALL_TESTS 0006:50:1:bitmap_0001:1" ALL_TESTS="$ALL_TESTS 0007:1:1:boot_int:1" ALL_TESTS="$ALL_TESTS 0008:1:1:match_int:1" ALL_TESTS="$ALL_TESTS 0009:1:1:unregister_error:0" +ALL_TESTS="$ALL_TESTS 0010:1:1:mnt/mnt_error:0" function allow_user_defaults() { @@ -813,6 +814,20 @@ sysctl_test_0009() return 0 } +sysctl_test_0010() +{ + TARGET="${SYSCTL}/$(get_test_target 0010)" + echo -n "Testing that $TARGET was not created ..." + if [ -d $TARGET ]; then + echo "TEST FAILED" + rc=1 + test_rc + fi + + echo "ok" + return 0 +} + list_tests() { echo "Test ID list:" @@ -830,6 +845,7 @@ list_tests() echo "0007 x $(get_test_count 0007) - tests setting sysctl from kernel boot param" echo "0008 x $(get_test_count 0008) - tests sysctl macro values match" echo "0009 x $(get_test_count 0009) - tests sysct unregister" + echo "0010 x $(get_test_count 0010) - tests sysct mount point" } usage() |