From 2e4b2a9d50e2f823e99aa9b03b1c5a4f3ecbf8dc Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 26 May 2020 15:03:18 +0200 Subject: conntrack: add a few more tests Extend testsuite with a few more tests. Signed-off-by: Pablo Neira Ayuso --- tests/conntrack/testsuite/01delete | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/conntrack/testsuite/01delete') diff --git a/tests/conntrack/testsuite/01delete b/tests/conntrack/testsuite/01delete index 194d999..2755491 100644 --- a/tests/conntrack/testsuite/01delete +++ b/tests/conntrack/testsuite/01delete @@ -2,8 +2,22 @@ -I -s 1.1.1.1 -d 2.2.2.2 -p tcp --sport 10 --dport 20 --state LISTEN -u SEEN_REPLY -t 50 ; OK # delete bad source -D -s 2.2.2.2 -p tcp --sport 10 --dport 20 ; BAD +# delete bad destination +-D -d 1.1.1.1 -p tcp --sport 10 --dport 20 ; BAD +# delete bad source port +-I -s 1.1.1.1 -d 2.2.2.2 -p tcp --sport 20 --dport 20 ; BAD +# delete bad destination port +-I -s 1.1.1.1 -d 2.2.2.2 -p tcp --sport 10 --dport 10 ; BAD # delete by source -D -s 1.1.1.1 ; OK +# re-create dummy with mark +-I -s 1.1.1.1 -d 2.2.2.2 -p tcp --sport 10 --dport 20 --state LISTEN -u SEEN_REPLY -t 50 -m 20 ; OK +# delete bad mark +-D -m 10 ; BAD +# delete by mark +-D -m 20 ; OK +# delete by mark (does not exist anymore) +-D -m 20 ; BAD # re-create dummy -I -s 1.1.1.1 -d 2.2.2.2 -p tcp --sport 10 --dport 20 --state LISTEN -u SEEN_REPLY -t 50 ; OK # delete by netmask @@ -14,3 +28,5 @@ -I -s 1.1.1.1 -d 2.2.2.2 -p tcp --sport 10 --dport 20 --state LISTEN -u SEEN_REPLY -t 50 ; OK # try same command again but with CIDR -D -s 1.1.1.0/24 -d 2.2.2.0/24 ; OK +# try same command again but with CIDR (no matching found) +-D -s 1.1.1.0/24 -d 2.2.2.0/24 ; BAD -- cgit v1.2.3