summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/sysctl
diff options
context:
space:
mode:
authorJoel Granados <j.granados@samsung.com>2023-06-16 10:59:18 +0200
committerLuis Chamberlain <mcgrof@kernel.org>2023-06-18 02:32:54 -0700
commit35576438591e8d37c7651e6ff56f2e07c7f9615a (patch)
tree24aa1e72d96ee94c8147f8b0487d3941e416ad78 /tools/testing/selftests/sysctl
parente009bd5efe81c5ccd2c08626a79c37d2a238ff15 (diff)
test_sysctl: Add an unregister sysctl test
Add a test that checks that the unregistered directory is removed from /proc/sys/debug 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-xtools/testing/selftests/sysctl/sysctl.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/testing/selftests/sysctl/sysctl.sh b/tools/testing/selftests/sysctl/sysctl.sh
index cb8f83dfe16b..a6d79d7a36e4 100755
--- a/tools/testing/selftests/sysctl/sysctl.sh
+++ b/tools/testing/selftests/sysctl/sysctl.sh
@@ -31,6 +31,7 @@ ALL_TESTS="$ALL_TESTS 0005:3:1:int_0003"
ALL_TESTS="$ALL_TESTS 0006:50:1:bitmap_0001"
ALL_TESTS="$ALL_TESTS 0007:1:1:boot_int"
ALL_TESTS="$ALL_TESTS 0008:1:1:match_int"
+ALL_TESTS="$ALL_TESTS 0009:1:1:unregister_error"
function allow_user_defaults()
{
@@ -797,6 +798,20 @@ sysctl_test_0008()
return 0
}
+sysctl_test_0009()
+{
+ TARGET="${SYSCTL}/$(get_test_target 0009)"
+ echo -n "Testing if $TARGET unregistered correctly ..."
+ if [ -d $TARGET ]; then
+ echo "TEST FAILED"
+ rc=1
+ test_rc
+ fi
+
+ echo "ok"
+ return 0
+}
+
list_tests()
{
echo "Test ID list:"
@@ -813,6 +828,7 @@ list_tests()
echo "0006 x $(get_test_count 0006) - tests proc_do_large_bitmap()"
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"
}
usage()