Path: blob/main/tests/sys/kern/logsigexit_test.sh
105377 views
#1# Copyright (c) 2024 Kyle Evans <[email protected]>2#3# SPDX-License-Identifier: BSD-2-Clause4#56atf_test_case basic7basic_body()8{910if ! dmesg >/dev/null 2>&1; then11atf_skip "No dmesg(8) access"12fi1314# SIGABRT carefully chosen to avoid issues when run under Kyua. No15# matter the value of the global kern.logsigexit, these should force16# the messages as appropriate and we'll all be happy.17proccontrol -m logsigexit -s enable \18sh -c 'echo $$ > enabled.out; kill -ABRT $$'19proccontrol -m logsigexit -s disable \20sh -c 'echo $$ > disabled.out; kill -ABRT $$'2122atf_check test -s enabled.out23atf_check test -s disabled.out2425read enpid < enabled.out26read dispid < disabled.out2728atf_check -o save:dmesg.out dmesg29atf_check grep -Eq "$enpid.+exited on signal" dmesg.out30atf_check -s not-exit:0 grep -Eq "$dispid.+exited on signal" dmesg.out31}3233atf_init_test_cases()34{35atf_add_test_case basic36}373839