1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-07 13:14:51 +00:00

coredump_phnum_test: Make expected pheader count more flexible

Note: this test still requires binutils readelf (from ports) to pass, until a
few issues are resolved in elftoolchain.

PR:		215019
Reported by:	ngie@
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Conrad Meyer 2016-12-04 03:50:57 +00:00
parent bde60d7544
commit 695349e306
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309525

View File

@ -39,7 +39,7 @@ coredump_phnum_head()
} }
coredump_phnum_body() coredump_phnum_body()
{ {
atf_expect_fail "the value parsed doesn't always match the value obtained on the running system; bug # 215019" atf_expect_fail "elftoolchain (base) readelf doesn't handle extended program header numbers; bug # 215019"
# Set up core dumping # Set up core dumping
cat > coredump_phnum_restore_state.sh <<-EOF cat > coredump_phnum_restore_state.sh <<-EOF
@ -65,17 +65,17 @@ EOF
# the result of running the helper program and dumping core. The only # the result of running the helper program and dumping core. The only
# important bit is that they're larger than 65535 (UINT16_MAX). # important bit is that they're larger than 65535 (UINT16_MAX).
readelf -h coredump_phnum_helper.core | \ readelf -h coredump_phnum_helper.core | \
atf_check -o "match:65535 \(66169\)" \ atf_check -o "match:65535 \(66[0-9]{3}\)" \
grep "Number of program headers:" grep "Number of program headers:"
readelf -l coredump_phnum_helper.core | \ readelf -l coredump_phnum_helper.core | \
atf_check -o "match:There are 66169 program headers" \ atf_check -o "match:There are 66[0-9]{3} program headers" \
grep -1 "program headers" grep -1 "program headers"
readelf -S coredump_phnum_helper.core | \ readelf -S coredump_phnum_helper.core | \
atf_check -o "match: 0000000000000001 .* 66169 " \ atf_check -o "match: 0000000000000001 .* 66[0-9]{3} " \
grep -A1 "^ \[ 0\] " grep -A1 "^ \[ 0\] "
procstat -v coredump_phnum_helper.core | \ procstat -v coredump_phnum_helper.core | \
atf_check -o "match:66545" wc -l atf_check -o "match:66[0-9]{3}" wc -l
} }
coredump_phnum_cleanup() coredump_phnum_cleanup()
{ {