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)
Fri, Nov 8, 12:57 AM
Unknown Object (File)
Thu, Nov 7, 11:55 PM
Unknown Object (File)
Thu, Nov 7, 10:08 PM
Unknown Object (File)
Oct 18 2024, 11:01 PM
Unknown Object (File)
Oct 2 2024, 6:37 PM
Unknown Object (File)
Oct 2 2024, 1:12 PM
Unknown Object (File)
Oct 1 2024, 1:35 AM
Unknown Object (File)
Sep 27 2024, 10:53 AM

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