All of lore.kernel.org
 help / color / mirror / Atom feed
* [nftables,v2] tests/py: Add Test for `meta time`
@ 2019-03-19 11:09 Karuna Grewal
  0 siblings, 0 replies; only message in thread
From: Karuna Grewal @ 2019-03-19 11:09 UTC (permalink / raw)
  To: fw, pablo; +Cc: netfilter-devel

Signed-off-by: Karuna Grewal <karunagrewal98@gmail.com>
---
 tests/py/any/meta.t         |  3 +++
 tests/py/any/meta.t.json    | 12 ++++++++++++
 tests/py/any/meta.t.payload |  5 +++++
 3 files changed, 20 insertions(+)

diff --git a/tests/py/any/meta.t b/tests/py/any/meta.t
index d69b8b4e..56368a57 100644
--- a/tests/py/any/meta.t
+++ b/tests/py/any/meta.t
@@ -205,3 +205,6 @@ meta iif . meta oif vmap { "lo" . "lo" : drop };ok;iif . oif vmap { "lo" . "lo"
 
 meta random eq 1;ok;meta random 1
 meta random gt 1000000;ok;meta random > 1000000
+
+meta time 100;ok;meta timestamp 1m40s
+meta time;fail
\ No newline at end of file
diff --git a/tests/py/any/meta.t.json b/tests/py/any/meta.t.json
index 2cf91cda..faef4e26 100644
--- a/tests/py/any/meta.t.json
+++ b/tests/py/any/meta.t.json
@@ -2499,3 +2499,15 @@
     }
 ]
 
+# meta time 100
+[
+    {
+        "match": {
+            "left": {
+                "meta": { "key": "time" }
+            },
+            "op": "==",
+            "right": 100
+        }
+    }
+]
\ No newline at end of file
diff --git a/tests/py/any/meta.t.payload b/tests/py/any/meta.t.payload
index b32770f5..9c696b14 100644
--- a/tests/py/any/meta.t.payload
+++ b/tests/py/any/meta.t.payload
@@ -1021,3 +1021,8 @@ ip test-ip4 input
   [ meta load priority => reg 1 ]
   [ cmp eq reg 1 0x87654321 ]
 
+# meta time 100
+ip test-ip4 input
+  [ meta load unknown => reg 1 ]
+  [ cmp eq reg 1 0x000186a0 0x00000000 ]
+
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-19 11:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 11:09 [nftables,v2] tests/py: Add Test for `meta time` Karuna Grewal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.