From: Harsha Sharma Date: Mon, 13 Aug 2018 19:39:28 +0000 (+0530) Subject: tests: shell: add tests for ct timeout objects X-Git-Tag: v0.9.1~279 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2de594ccb99c70bc908a3f4cc477618babffff6b;p=thirdparty%2Fnftables.git tests: shell: add tests for ct timeout objects Add tests for listing ct timeout objects and input from file. Signed-off-by: Harsha Sharma Signed-off-by: Pablo Neira Ayuso --- diff --git a/tests/shell/testcases/listing/0013objects_0 b/tests/shell/testcases/listing/0013objects_0 index c5e0e323..2d72dbb5 100755 --- a/tests/shell/testcases/listing/0013objects_0 +++ b/tests/shell/testcases/listing/0013objects_0 @@ -12,6 +12,12 @@ EXPECTED="table ip test { l3proto ip } + ct timeout cttime { + protocol udp; + l3proto ip + policy = {unreplied: 15, replied: 12} + } + chain input { } }" @@ -22,6 +28,7 @@ $NFT add table test $NFT add chain test input $NFT add quota test https-quota 25 mbytes $NFT add ct helper test cthelp { type \"sip\" protocol tcp \; } +$NFT add ct timeout test cttime { protocol udp \; policy = {replied: 12, unreplied: 15 } \; } $NFT add table test-ip GET="$($NFT list table test)" diff --git a/tests/shell/testcases/nft-f/0017ct_timeout_obj_0 b/tests/shell/testcases/nft-f/0017ct_timeout_obj_0 new file mode 100755 index 00000000..1d03dbfc --- /dev/null +++ b/tests/shell/testcases/nft-f/0017ct_timeout_obj_0 @@ -0,0 +1,16 @@ +#!/bin/bash + +EXPECTED='table ip filter { + ct timeout cttime{ + protocol tcp; + l3proto ip + policy = {established: 123, close: 12} + } + + chain c { + ct timeout set "cttime" + } +}' + +set -e +$NFT -f - <<< $EXPECTED