forked from opnsense/src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression tests scripts for multi-IP FIBs exercising the send,
receive and forward path tagging packets with both the ifconfig fib option or using ipfw, running ICMP6, TCP/v6 and UDP/v6 tests and testing both setfib(2) as well as the SO_SETFIB socket option. At 16 FIBs a total of over 64k return codes/replies/stati are checked, sometimes multiple times (in different ways, e.g. the reflected request as well as ipfw counter values). The scripts need two or three machines to run and are thus not added to the tools/regression framework but only to tools/test. Sponsored by: Cisco Systems, Inc.
- Loading branch information
Bjoern A. Zeeb
authored and
Bjoern A. Zeeb
committed
Feb 17, 2012
1 parent
e78719a
commit d337302
Showing
7 changed files
with
4,697 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# $FreeBSD$ | ||
|
||
PROG= reflect | ||
NO_MAN= | ||
WARNS?= 6 | ||
|
||
.include <bsd.prog.mk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# $FreeBSD$ | ||
|
||
This directory holds scripts and a support program for multiple test cases | ||
exercising multi-IP FIBs. At this time only IPv6 test cases are provided. | ||
|
||
Makefile | ||
reflect.c | ||
|
||
Makefile just builds reflect, a program to echo data on a TCP or UDP | ||
socket in very simplistic ways. It has a couple of options to provide | ||
an address or port, a FIB to bind to or a FIB to add to a reflected | ||
message as well as some "magic" keyword handling to let the intiators | ||
control it. | ||
|
||
initiator.sh and reflector.sh | ||
|
||
intiator.sh runs two local test cases, one which shows a documented | ||
limitation. | ||
|
||
All further tests are either exercising the sending or receiving of | ||
ICMP6, TCP or UDP packets with multiple FIBs. initiator.sh and | ||
reflector.sh must run on two different nodes both having a network | ||
interface in the same broadcast domain (be it cross-over or on a | ||
bridge/switch). The tests will use the IPv6 benchmarking working | ||
group (BMWG) prefix. The prefix is hard coded into some tests. | ||
Control messages will synchronize reflector with initiator. The | ||
reflector needs the reflect binary. Apart from that the scripts | ||
depend on ping6, netcat, awk, tr and ipfw. The interface to use can | ||
be set from the environment. The commands can be run like: | ||
|
||
env IFACE=ifname sh intiator.sh | ||
env IFACE=ifname sh reflector.sh | ||
|
||
Both scripts also support a DEBUG environment variable for additional | ||
output. A special value of 42 will enable sh(1) xtrace printing. | ||
|
||
The output format is modeled after Test::Harness Perl as used in | ||
tools/regression/ but not always complaint following the test case name. | ||
|
||
NOTE: at the time of writing reflector.sh can trigger kernel races | ||
unrelated to multi-FIB test leading to a panic(9). "delay" calls | ||
are used to mitigate the problem some but are not always good enough. | ||
It is suggested to run one test case at a time manually disabling | ||
the others in both scripts. | ||
|
||
forwarding.sh | ||
|
||
forwarding.sh tests FIBs in the forwarding path, making sure that | ||
packets tagged on input are leaving on the correct FIB. | ||
The script must be run on three nodes with both edge nodes (left | ||
and right) being connected to the middle node on separate interfaces. | ||
|
||
The script operates on the same principles and requirements as the | ||
two afore described ones. Environment options equally apply, with | ||
the middle node also taking an IFACEFAR variable to name the interface | ||
to the right. See the ASCII art at the beginning of the script for | ||
details. The script needs to be told which node it is running with | ||
the first argument: | ||
|
||
env IFACE=ifname sh forwarding.sh left | ||
env IFACE=leftifname IFACEFAR=rightifname sh forwarding.sh middle | ||
env IFACE=ifname sh forwarding.sh right | ||
|
||
# end |
Oops, something went wrong.