testsuite: Add check for shared memory

Created a test process test_shm that allocates a shared memory
segment and prints the segment ID. pmap testsuite runs pmap to
check that the segment is found.

The value returned by shmget() is the same value that is printed
in the fifth column /proc/<PID>/maps

Signed-off-by: Craig Small <csmall@dropbear.xyz>
This commit is contained in:
Craig Small
2022-04-26 22:04:05 +10:00
parent 1f085f5a9f
commit 9c5397a941
5 changed files with 100 additions and 1 deletions

View File

@ -66,3 +66,8 @@ set test "pmap XX with unreachable process"
spawn $pmap -XX 1
expect_pass $test "$pmap_initname\$"
set test "pmap finding shm"
make_testshm_proc
spawn $pmap $testshmproc_pid
expect_pass $test "\[ shmid=0x$shmid \]"
kill_testshm_proc