Page MenuHomeFreeBSD

pf tests: Simplify handling of pfctl -s
AcceptedPublic

Authored by vegeta_tuxpowered.net on Mon, Nov 4, 3:56 PM.

Details

Reviewers
kp
Summary

Some pf tests check the output of pfctl -s[sSr] to find if relevant
states, source nodes or rules exist and if their counters have proper
values. The output is multiple lines per entry and contains varying
amount of whitespace. This makes parsing it rather hard.

Provide a function for standardization of output of pfctl -s[sSr] which
converts the output to a single line per entry and reduces whitespace
always to a single space. Adjust existing tests to make use of this
function.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This is basically ready to go in. I'm not going to commit it, because your account should be active soon and you'll be able to do it yourself.

There's one small remark. The commit message should have line lengths or around 72 columns.
Ed wrote a good guide on commit messages: https://freebsdfoundation.org/wp-content/uploads/2020/11/Writing-Commit-Messages.pdf

Other than the stylistic remark it's a good commit message. It exactly matches my usual approach of title / paragraph describing the problem / paragraph describing the solution.

Practically, for the first couple of commits I'd like you to e-mail me the git format-patch output, so I can check the details of the commit before you push it. It'll be best to wait with that until your account is created so you can set the correct author e-mail address.

This revision is now accepted and ready to land.Mon, Nov 4, 8:35 PM
In D47435#1081961, @kp wrote:

There's one small remark. The commit message should have line lengths or around 72 columns.

Fixed.

Ed wrote a good guide on commit messages: https://freebsdfoundation.org/wp-content/uploads/2020/11/Writing-Commit-Messages.pdf

I'll have a look, thank you!