mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 14:26:03 -04:00
savecore: add a test for LOG_PERROR
Signed-off-by: Stéphane Rochoy <stephane.rochoy@stormshield.eu> Reviewed by: markj, oshogbo MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1546
This commit is contained in:
parent
c901e89d8e
commit
3dc18af577
2 changed files with 26 additions and 1 deletions
|
|
@ -1,3 +1,3 @@
|
|||
ATF_TESTS_SH= livedump_test
|
||||
ATF_TESTS_SH= livedump_test log_test
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
|
|
|||
25
sbin/savecore/tests/log_test.sh
Normal file
25
sbin/savecore/tests/log_test.sh
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
# Copyright (c) 2025 Stéphane Rochoy <stephane.rochoy@stormshield.eu>
|
||||
#
|
||||
|
||||
atf_test_case log_perror
|
||||
log_perror_head()
|
||||
{
|
||||
atf_set "descr" "Test LOG_PERROR behavior"
|
||||
}
|
||||
log_perror_body()
|
||||
{
|
||||
atf_check -s exit:1 \
|
||||
-o ignore \
|
||||
-e save:savecore.err \
|
||||
savecore -vC /dev/missing
|
||||
grep -qE 'savecore [0-9]+ - - /dev/missing: No such file or directory' savecore.err \
|
||||
|| atf_fail "missing/invalid error output"
|
||||
}
|
||||
|
||||
atf_init_test_cases()
|
||||
{
|
||||
atf_add_test_case log_perror
|
||||
}
|
||||
Loading…
Reference in a new issue