From 04ca9a6ba3ca369053e9b5951f2f85bf8fe98e72 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 5 Sep 2018 11:16:42 +0200 Subject: src: rt: add support to check if route will perform ipsec transformation Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- tests/py/any/rt.t | 2 ++ tests/py/any/rt.t.json | 30 ++++++++++++++++++++++++++++++ tests/py/any/rt.t.payload | 10 ++++++++++ 3 files changed, 42 insertions(+) (limited to 'tests/py') diff --git a/tests/py/any/rt.t b/tests/py/any/rt.t index 4f65eaad..3ce57e05 100644 --- a/tests/py/any/rt.t +++ b/tests/py/any/rt.t @@ -5,3 +5,5 @@ *inet;test-inet;output rt classid "cosmos";ok +rt ipsec exists;ok +rt ipsec missing;ok diff --git a/tests/py/any/rt.t.json b/tests/py/any/rt.t.json index 955d12a3..2ca6fe01 100644 --- a/tests/py/any/rt.t.json +++ b/tests/py/any/rt.t.json @@ -13,3 +13,33 @@ } ] +# rt ipsec exists +[ + { + "match": { + "left": { + "rt": { + "key": "ipsec" + } + }, + "op": "==", + "right": true + } + } +] + +# rt ipsec missing +[ + { + "match": { + "left": { + "rt": { + "key": "ipsec" + } + }, + "op": "==", + "right": false + } + } +] + diff --git a/tests/py/any/rt.t.payload b/tests/py/any/rt.t.payload index 0e354fa0..e1ecb286 100644 --- a/tests/py/any/rt.t.payload +++ b/tests/py/any/rt.t.payload @@ -3,3 +3,13 @@ ip test-ip4 input [ rt load classid => reg 1 ] [ cmp eq reg 1 0x00000000 ] +# rt ipsec exists +ip test-ip4 input + [ rt load ipsec => reg 1 ] + [ cmp eq reg 1 0x00000001 ] + +# rt ipsec missing +ip test-ip4 input + [ rt load ipsec => reg 1 ] + [ cmp eq reg 1 0x00000000 ] + -- cgit v1.2.3