Page MenuHomeFreeBSD

tests/netinet/socket_afinet: unroll multibind test into a table
Needs ReviewPublic

Authored by glebius on Tue, Jul 7, 4:35 PM.
Tags
None
Referenced Files
F162304301: D58085.id181458.diff
Sat, Jul 11, 9:17 PM
Unknown Object (File)
Fri, Jul 10, 8:21 PM

Details

Reviewers
markj
Group Reviewers
network
Summary

The test has 6 dimensions: address family, socket type, socket option on
the first socket, socket option on the second socket, is first socket
bound to specific address or wildcard and is the second socket priveleged
or not. Before the change 3 dimensions are implemented as 3 nested for()
loops, 2 dimensions are implemented as repetitions in the test body and
one dimension as two actions in the innermost loop.

I'm about to add one more dimension: whether the second socket is bound to
a specific address or wildcard instead of using first socket's
getsockopt(2) result. Also, there is a change under discussion that would
make SOCK_STREAM sockets behave different to SOCK_DGRAM. That would break
result consistency in the dimensions of socket type.

We expect that consistency in the dimension of address families shall
never break, thus this one remains a for() loop. The priveleged & non-
privileged bind(2) attempts also remain as two actions, but expected
results are in the table. The rest of dimensions are unrolled into a
table, which at the moment has quite a lot of lines with identical
results. However, as more tests are added and SOCK_STREAM behavior
changes, the table will get more mixed results. Also, reading a test that
is written in a declarative manner a table is much easier and modifying it
is more resistent to accidential breakage.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74587
Build 71470: arc lint + arc unit