Add tests for basic nat in which it is tested that two clients behind the nat are able to reach a common host.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
tests/sys/netpfil/common/nat.sh | ||
---|---|---|
151 ↗ | (On Diff #60616) | The setup test lines should align based on the first character |
154 ↗ | (On Diff #60616) | I do think 'userspace_nat' is descriptie enough, I can't tell from this line which firewall is being tested. Is there a different name that could be used? |
155 ↗ | (On Diff #60616) | ipfw is in the list twice, should this be ipf? |
tests/sys/netpfil/common/nat.sh | ||
---|---|---|
151 ↗ | (On Diff #60616) | I don't know why after git push 4-spaced tabs are being converted to 8-spaced tabs. |
154 ↗ | (On Diff #60616) | The "userspace_nat" is the name of the test case, same as "basic". The "basic" is tested on ipf, ipfw and pf. while "userspace_nat" is tested on ipfw. This is also the reason why ipfw appears twice. |
I seem to run into issues running the ipfw_basic test:
Part of the run output (with 'set -x' added to the test):
+ [ 4 -gt 0 ]
+ is_firewall ipfw -q add 1000 nat 123 all from any to any
+ [ ipfw '=' pf -o ipfw '=' ipfw -o ipfw '=' ipf -o ipfw '=' ipfnat ]
+ echo 1
+ [ 1 -eq 1 ]
+ current_fw='ipfw -q add 1000 nat 123 all from any to any'
+ shift
+ filename='ipfw -q add 1000 nat 123 all from any to any.rule'
+ pwd
+ cwd=/tmp/kyua.plyoOz/2/work
+ [ -f ipfw -q add 1000 nat 123 all from any to any.rule ]
[: ipfw: unexpected operator
It seems to take the ipfw rule for a filename for some reason.
And this is wrong, or at least very confusing, in firewall_init():
elif [ ${firewall} == "ipfnat" ]; then if ! kldstat -q -m ipfw_nat; then atf_skip "This test requires ipfw_nat" fi else
tests/sys/netpfil/common/utils.subr | ||
---|---|---|
111 ↗ | (On Diff #60654) | You're checking for ipfw_nat, but report needing ipfw here. |