Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137416209
D21820.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D21820.diff
View Options
Index: head/tests/sys/kern/coredump_phnum_test.sh
===================================================================
--- head/tests/sys/kern/coredump_phnum_test.sh
+++ head/tests/sys/kern/coredump_phnum_test.sh
@@ -40,21 +40,31 @@
coredump_phnum_body()
{
# Set up core dumping
- cat > coredump_phnum_restore_state.sh <<-EOF
- #!/bin/sh
- ulimit -c '$(ulimit -c)'
- sysctl kern.coredump=$(sysctl -n kern.coredump)
- sysctl kern.corefile='$(sysctl -n kern.corefile)'
- sysctl kern.compress_user_cores='$(sysctl -n kern.compress_user_cores)'
-EOF
+ atf_check -o save:coredump_phnum_restore_state sysctl -e \
+ kern.coredump kern.corefile
ulimit -c unlimited
- sysctl kern.coredump=1
- sysctl kern.compress_user_cores=0
- sysctl kern.corefile="$(pwd)/coredump_phnum_helper.core"
+ atf_check -o ignore sysctl kern.coredump=1
+ atf_check -o ignore sysctl kern.corefile=coredump_phnum_helper.core
+ atf_check -o save:cuc sysctl -n kern.compress_user_cores
+ read cuc < cuc
atf_check -s signal:sigabrt "$(atf_get_srcdir)/coredump_phnum_helper"
+ case "$cuc" in
+ 0)
+ ;;
+ 1)
+ atf_check gunzip coredump_phnum_helper.core.gz
+ ;;
+ 2)
+ atf_check zstd -qd coredump_phnum_helper.core.zst
+ ;;
+ *)
+ atf_skip "unsupported kern.compress_user_cores=$cuc"
+ ;;
+ esac
+
# Check that core looks good
if [ ! -f coredump_phnum_helper.core ]; then
atf_fail "Helper program did not dump core"
@@ -76,10 +86,11 @@
coredump_phnum_cleanup()
{
rm -f coredump_phnum_helper.core
- if [ -f coredump_phnum_restore_state.sh ]; then
- . ./coredump_phnum_restore_state.sh
+ if [ -f coredump_phnum_restore_state ]; then
+ sysctl -f coredump_phnum_restore_state
+ rm -f coredump_phnum_restore_state
fi
- rm -f coredump_phnum_restore_state.sh
+ rm -f cuc
}
atf_init_test_cases()
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 24, 6:18 AM (20 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26050776
Default Alt Text
D21820.diff (1 KB)
Attached To
Mode
D21820: Fix coredump_phnum_test when kern.compress_user_cores != 0
Attached
Detach File
Event Timeline
Log In to Comment