Page MenuHomeFreeBSD

routing: Add tests for metric
ClosedPublic

Authored by pouria on Fri, May 15, 2:09 PM.
Tags
None
Referenced Files
F157901522: D57016.id178023.diff
Tue, May 26, 8:02 AM
Unknown Object (File)
Fri, May 22, 5:13 PM
Unknown Object (File)
Fri, May 22, 7:29 AM
Unknown Object (File)
Fri, May 22, 1:33 AM
Unknown Object (File)
Thu, May 21, 9:34 PM
Unknown Object (File)
Thu, May 21, 4:00 AM
Unknown Object (File)
Wed, May 20, 10:01 PM
Unknown Object (File)
Tue, May 19, 6:34 PM
Subscribers

Details

Summary

Add tests to make sure:

  • Default metric is enforced.
  • Lowest metric wins.
  • Deleting routes by specifying gateway/metric works.

Depends on D57011

Test Plan
# kyua test -k /usr/tests/Kyuafile sys/net/routing/test_routing
sys/net/routing/test_routing:add_default_metric  ->  passed  [0.084s]
sys/net/routing/test_routing:add_lowest_metric  ->  passed  [0.111s]
sys/net/routing/test_routing:delete_route_with_metric  ->  passed  [0.174s]

Results file id is usr_tests.20260515-140531-295066
Results saved to /root/.kyua/store/results.usr_tests.20260515-140531-295066.db

3/3 passed (0 broken, 0 failed, 0 skipped)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningtests/sys/net/routing/test_routing.sh:CHMOD1Invalid Executable
Unit
No Test Coverage
Build Status
Buildable 73198
Build 70081: arc lint + arc unit

Event Timeline

All of these tests create a single jail and operate on it. But we could instead use execenv=jail and get kyua to create the VNET jail for us. Then:

  • the tests would be simpler,
  • the tests can be run in parallel.
tests/sys/net/routing/test_routing.sh
2

I was told not to add this line, the makefiles will do that automatically.

37

This needs to be set in all of the test cases.

55

You only use the prefix variable here, so it'd be clearer to just define laddr="3fff::1" and use that here.

79

maybe? Or go further and validate the error message.

106

Same comment about prefix.

121
124

This is verifying the weight too, right?

136
pouria marked 7 inline comments as done.

Remove mkjail for each test and add execenv=jail to Makefile.
Address @markj comments.

This revision is now accepted and ready to land.Tue, May 19, 1:45 PM
This revision was landed with ongoing or failed builds.Wed, May 20, 8:59 PM
This revision was automatically updated to reflect the committed changes.