Page MenuHomeFreeBSD

if_gre: Add a regression test
AcceptedPublic

Authored by pouria on Feb 19 2026, 9:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 12, 8:26 AM
Unknown Object (File)
Thu, Jul 9, 2:23 PM
Unknown Object (File)
Fri, Jul 3, 11:44 AM
Unknown Object (File)
Wed, Jul 1, 11:53 AM
Unknown Object (File)
Tue, Jun 30, 4:23 PM
Unknown Object (File)
Sat, Jun 27, 3:16 AM
Unknown Object (File)
Sat, Jun 20, 7:27 PM
Unknown Object (File)
Sat, Jun 20, 11:08 AM
Subscribers

Details

Reviewers
ae
glebius
markj
Group Reviewers
network
Summary

Add a regression test for gre(4)
to make sure all of the gre capabilities and options are
working as intended.

This test depends on PR275474 to be resolved.
otherwise it's going to trigger kernel panic.

Test Plan

To test, without triggering kernel panic, add the following lines below on top of every cleanup function:

sleep 1
ifconfig -j gretest1 gre1 destroy
sleep 1
ifconfig -j gretest2 gre1 destroy
sleep 1

and then run the tests:

# kyua test -k /usr/tests/sys/net/Kyuafile if_gre
if_gre:gre4_basic  ->  passed  [0.145s]
if_gre:gre6_basic  ->  passed  [0.148s]
if_gre:gre6_csum  ->  passed  [0.149s]
if_gre:gre6_key  ->  passed  [0.153s]
if_gre:gre6_seq  ->  passed  [0.160s]
if_gre:gre6_udpencap  ->  passed  [0.149s]
if_gre:gre_blind_options  -> passed [0.157s]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74652
Build 71535: arc lint + arc unit

Event Timeline

pouria edited the test plan for this revision. (Show Details)
markj added inline comments.
tests/sys/net/if_gre.sh
50

You can now set required.kmods in the ATF header instead.

pouria marked an inline comment as done.

Address @markj comment.

tests/sys/net/if_gre.sh
35

It should be require.kmods, my comment had a typo.

37

IMO it is nicer to group test subroutines together without whitespace in between:

atf_test_case foo
foo_head()
{
}
foo_body()
{
}
foo_cleanup()
{
}

This requires less vertical space, and makes it easier to visually group the test subroutines together.

59

-s exit:0 is the default, you don't need to write it everywhere.

418

What does "blindly" mean here?

pouria marked 4 inline comments as done.

Address @markj comments.
Thank you for all of your great reviews.

tests/sys/net/if_gre.sh
35

It should be require.kmods, my comment had a typo.

Oops, didn't think/test when I updated the code. :(
sorry

418

I don't verify its actual effect on dataplane here.
We simply want to make sure this options works and driver updates itself, regardless of using netlink or ioctl.
For example, I want to make sure that driver knows I've set the udpport to x to make sure my netlink implementation works or at least it won't break without failing a test.

I've done the same thing in if_geneve due its large number of options and it helps A LOT!

markj added inline comments.
tests/sys/net/if_gre.sh
67

Do you actually need most of these -o ignore? I suspect not. It would be better to remove them where possible, the default -o empty check is stricter.

418

You might add some comment here explaining that. I saw the same test in if_geneve and was confused about the meaning there too.

This revision is now accepted and ready to land.Mon, Jul 13, 2:53 PM
pouria marked an inline comment as done.

Address @markj comments.
Thanks!

This revision now requires review to proceed.Mon, Jul 13, 10:24 PM
This revision is now accepted and ready to land.Tue, Jul 14, 2:03 AM