Page MenuHomeFreeBSD

Introduce test-program for auditon(2) syscall
Needs RevisionPublic

Authored by aniketp on Jul 27 2018, 9:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 6:39 AM
Unknown Object (File)
Wed, Apr 24, 9:26 AM
Unknown Object (File)
Sat, Apr 20, 12:49 PM
Unknown Object (File)
Mar 14 2024, 8:25 PM
Unknown Object (File)
Feb 27 2024, 8:29 AM
Unknown Object (File)
Dec 20 2023, 1:37 AM
Unknown Object (File)
Dec 10 2023, 8:53 PM
Unknown Object (File)
Nov 10 2023, 8:10 PM
Subscribers

Details

Reviewers
asomers
Summary

This revision introduces test program for verifying various functionalities of
auditon(2) system call. The tests have currently been divided on the basis
of specific command argument for auditon(2). These arguments are:

  • A_GETKAUDIT
  • A_SETKAUDIT
  • A_GETPOLICY
  • A_SETPOLICY
  • A_GETKMASK
  • A_SETKMASK
  • A_GETCOND
  • A_SETCOND

Some expected ENOSYS commands are:

  • A_GETSTAT
  • A_SETSTAT
  • A_GETCAR
  • A_GETCWD
  • A_SETUMASK
  • A_SETSMASK
Test Plan

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

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 18384
Build 18099: arc lint + arc unit

Event Timeline

asomers requested changes to this revision.Jul 27 2018, 9:48 PM
asomers added inline comments.
tests/sys/security/auditon_test.c
64

These two lines are struct copies. Better to initialize just the single structure all at once.

71

Usually preferable to say sizeof(curr_kaudit), because that's more robust against change.

116

No need to restrict yourself to just one field; you can compare the entire structures.

176

Are you sure that this differs from curr_poll?

249

These two assertions can be combined.

280

No need to check this. It's not like there's a requirement that A_GETSTAT return ENOSYS. No programs will break if it suddenly starts working. I would just delete this testcase, and all the others that check ENOSYS.

389

If curr_cond is AUC_DISABLED, then test_cond will be AUC_UNSET, which does not have documented behavior. I don't think you should set that.

This revision now requires changes to proceed.Jul 27 2018, 9:48 PM