Page MenuHomeFreeBSD

tests/netgraph: Inital framework for testing libnetgraph
ClosedPublic

Authored by donner on Jun 3 2021, 5:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 11 2024, 3:12 PM
Unknown Object (File)
Feb 5 2024, 2:10 AM
Unknown Object (File)
Jan 30 2024, 2:11 AM
Unknown Object (File)
Jan 30 2024, 2:11 AM
Unknown Object (File)
Jan 30 2024, 2:11 AM
Unknown Object (File)
Jan 4 2024, 12:12 AM
Unknown Object (File)
Dec 25 2023, 11:22 PM
Unknown Object (File)
Dec 22 2023, 11:48 PM

Details

Summary

Provide a framework of functions to test various netgraph modules.
Tests contain:

  • creating, renaming, and destroying nodes
  • connecting and removing hooks
  • sending and receiving data
  • sending ASCII messages
  • errors can be passed for individual inspection or fail the test
  • determine the queue limit for unprocessed packets
Test Plan
$ kyua test
basic:message  ->  passed  [0.005s]
basic:node  ->  passed  [0.113s]
basic:queuelimit  ->  expected_failure: Queue full (320): 1 checks failed as expected; see output for more details  [3.167s]
basic:same_name  ->  passed  [0.005s]
basic:send_recv  ->  passed  [0.057s]
...

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

donner requested review of this revision.Jun 3 2021, 5:59 PM
donner added a reviewer: tests.
  • Add test for queue limit
donner edited the test plan for this revision. (Show Details)

Minor issue: these tests don't carry the metadata to show they must be run as root, so 'kyua test' fails.

afedorov added inline comments.
tests/sys/netgraph/basic.c
17

Do you have any objection to using the two-clause version of the BSD license?

tests/sys/netgraph/basic.c
17

Any reasoning?

$ fgrep -lR BSD-3-Clause /usr/include/ | wc -l
     445
$ fgrep -lR BSD-2-Clause /usr/include/ | wc -l
     621
In D30629#688115, @kp wrote:

Minor issue: these tests don't carry the metadata to show they must be run as root, so 'kyua test' fails.

Thanks, will add this.

  • Add root requirements to the tests
kp added inline comments.
tests/sys/netgraph/util.c
148

Nit: that { wants to be on the next line.

228

Nit: that { wants to be on the next line.

This revision is now accepted and ready to land.Jun 4 2021, 11:38 AM