Page MenuHomeFreeBSD

Add tests for pipe(2) and POSIX standardized IPC syscalls
ClosedPublic

Authored by aniketp on Jun 22 2018, 4:51 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 3:47 PM
Unknown Object (File)
Feb 29 2024, 7:10 PM
Unknown Object (File)
Feb 24 2024, 5:42 AM
Unknown Object (File)
Feb 24 2024, 5:42 AM
Unknown Object (File)
Feb 24 2024, 5:42 AM
Unknown Object (File)
Feb 24 2024, 5:37 AM
Unknown Object (File)
Feb 23 2024, 4:50 PM
Unknown Object (File)
Feb 23 2024, 4:00 PM
Subscribers

Details

Summary

This revision introduces test cases for following set of syscalls within inter-process
communication audit class.

  • shm_open(2)
  • shm_unlink(2)
  • posix_openpt(2)
  • pipe(2)
Test Plan

Execute make && make install from test/sys/audit.
Execute kyua test from /usr/tests/sys/audit. All testcases should succeed.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 17535
Build 17356: arc lint + arc unit

Event Timeline

Do these complete the IPC set?

tests/sys/audit/inter-process.c
1416

New code should use strlcat instead of strncat.

1422

shared memory segments are actually persistent. So the unlink steps needs to go in the cleanup function. However, if you create the object with SHM_ANON for path, then it will be automatically destroyed.

1510

The file descriptors are outputs from pipe(2), not inputs to it. Don't initialize them with open.

1542

I'm surprised this doesn't segfault. Better to use NULL. Or, just use pipe2 with invalid flags. pipe(2) is actually a wrapper around pipe2(2). If you really want to test the pipe(2) syscall, you'll have to do it the same way you tested open(2), but using syscall(2). However, pipe and pipe2 both have the same audit event, AUE_PIPE.

aniketp marked 4 inline comments as done.

Changes as suggested in the inline comments

asomers added inline comments.
tests/sys/audit/inter-process.c
1461

No need for the -1.

This revision now requires changes to proceed.Jun 22 2018, 10:29 PM

Remove -1 from strlcat() in shm_inlink_success test case

This revision is now accepted and ready to land.Jun 23 2018, 6:38 PM
This revision was automatically updated to reflect the committed changes.