Commit Graph

3 Commits

Author SHA1 Message Date
Zeling Feng 2a888a106d Give TCP flags a dedicated type
- Implement Stringer for it so that we can improve error messages.
- Use TCPFlags through the code base. There used to be a mixed usage of byte,
  uint8 and int as TCP flags.

PiperOrigin-RevId: 361940150
2021-03-09 18:00:03 -08:00
Zeling Feng d4951e05a0 [1/3] Support isolated containers for parallel packetimpact tests
Summary of the approach: the test runner will set up a few DUTs according to
a flag and pass all the test networks to the testbench. The testbench will only
reside in a single container. The testbench will put all the test networks into
a buffered channel which served as a semaphore and now the user can freely use
t.Parallel() in (sub)tests and the true parallelism will be determined by how
many DUTs are configured. Creating DUTs on demand is not supported yet, the
test author should determine the number of DUTs to be used statically.

Specifically in this change:
- Don't export any global variables about the test network in testbench.
- Sniffer only binds on the local interface because it will be possible to have
  multiple interfaces to multiple DUTs in a single testbench container.
- Migrate existing tests to stop using global variables.

PiperOrigin-RevId: 343965962
2020-11-23 18:13:07 -08:00
Mithun Iyer 05d2ebee5e Test RST handling in TIME_WAIT.
gVisor stack ignores RSTs when in TIME_WAIT which is not the default
Linux behavior. Add a packetimpact test to test the same.
Also update code comments to reflect the rationale for the current
gVisor behavior.

PiperOrigin-RevId: 331629879
2020-09-14 14:33:53 -07:00