]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: nft_nat: Improve port shadow test stability
authorPhil Sutter <phil@nwl.cc>
Wed, 3 Nov 2021 18:53:42 +0000 (19:53 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 8 Nov 2021 10:26:57 +0000 (11:26 +0100)
commitaa821197123b084d9e79c4d8ab48f5afa8b655e6
tree0c032d16c7ee19005f7ec258034d1b3ebc0bbe25
parentb6ffa9349c6e28cf67313721148681e95d4c13b5
selftests: nft_nat: Improve port shadow test stability

Setup phase in test_port_shadow() relied upon a race-condition:
Listening nc on port 1405 was started in background before attempting to
create the fake conntrack entry using the same source port. If listening
nc won, fake conntrack entry could not be created causing wrong
behaviour. Reorder nc calls to fix this and introduce a short delay
before testing the setup to wait for listening nc process startup.

Fixes: 4e00803f2d0dc ("selftests: nft_nat: add udp hole punch test case")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tools/testing/selftests/netfilter/nft_nat.sh