From 0eb1b3f9a83dfbe2f3001fd3d9cec497a352b9af Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 24 Oct 2018 12:35:03 +0200 Subject: json: Fix osf ttl support Having to use numerical values for ttl property in JSON is not practical as these values are arbitrary and meaningful only in netfilter. Instead align JSON output/input with standard API, accepting names for TTL matching strategy. Also add missing documentation in libnftables-json man page and fix JSON equivalent in tests/py. Fixes: 03eafe098d5ee ("osf: add ttl option support") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- tests/py/inet/osf.t.json | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'tests/py') diff --git a/tests/py/inet/osf.t.json b/tests/py/inet/osf.t.json index 45335cab..452f3023 100644 --- a/tests/py/inet/osf.t.json +++ b/tests/py/inet/osf.t.json @@ -4,7 +4,6 @@ "match": { "left": { "osf": { - "ttl": 0, "key": "name" } }, @@ -14,13 +13,44 @@ } ] +# osf ttl loose name "Linux" +[ + { + "match": { + "left": { + "osf": { + "key": "name", + "ttl": "loose" + } + }, + "op": "==", + "right": "Linux" + } + } +] + +# osf ttl skip name "Linux" +[ + { + "match": { + "left": { + "osf": { + "key": "name", + "ttl": "skip" + } + }, + "op": "==", + "right": "Linux" + } + } +] + # osf name { "Windows", "MacOs" } [ { "match": { "left": { "osf": { - "ttl": 0, "key": "name" } }, @@ -60,7 +90,6 @@ }, "key": { "osf": { - "ttl": 0, "key": "name" } } -- cgit v1.2.3