Page MenuHomeFreeBSD

Fix coredump_phnum_test when kern.compress_user_cores != 0
ClosedPublic

Authored by vangyzen on Sep 27 2019, 3:02 PM.

Details

Summary

If kern.compress_user_cores is non-zero, decompress the core file.

Use sysctl -f to restore previous values.

Don't bother restoring ulimit -c, since that's a per-process value.

Check more commands with atf_check.

Test Plan
# sysctl kern.compress_user_cores=0
kern.compress_user_cores: 0 -> 0
# kyua test coredump_phnum_test
coredump_phnum_test:coredump_phnum  ->  passed  [4.233s]

Results file id is usr_tests_sys_kern.20190917-225547-131047
Results saved to /root/.kyua/store/results.usr_tests_sys_kern.20190917-225547-131047.db

1/1 passed (0 failed)


# sysctl kern.compress_user_cores=1
kern.compress_user_cores: 0 -> 1
# kyua test coredump_phnum_test
coredump_phnum_test:coredump_phnum  ->  passed  [4.369s]

Results file id is usr_tests_sys_kern.20190917-225555-085154
Results saved to /root/.kyua/store/results.usr_tests_sys_kern.20190917-225555-085154.db

1/1 passed (0 failed)


# sysctl kern.compress_user_cores=2
kern.compress_user_cores: 1 -> 2
# kyua test coredump_phnum_test
coredump_phnum_test:coredump_phnum  ->  passed  [1.112s]

Results file id is usr_tests_sys_kern.20190917-225604-053209
Results saved to /root/.kyua/store/results.usr_tests_sys_kern.20190917-225604-053209.db

1/1 passed (0 failed)

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vangyzen created this revision.Sep 27 2019, 3:02 PM
olivier accepted this revision.Sep 27 2019, 3:54 PM
olivier added reviewers: olivier, ngie, asomers.

I prefer this change over my previous improvements.

This revision is now accepted and ready to land.Sep 27 2019, 3:55 PM
This revision was automatically updated to reflect the committed changes.