Page MenuHomeFreeBSD

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

Authored by aniketp on Jul 27 2018, 9:04 PM.

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 OK
Unit
No Unit Test Coverage
Build Status
Buildable 18384
Build 18099: arc lint + arc unit

Event Timeline

aniketp created this revision.Jul 27 2018, 9:04 PM
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