netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karuna Grewal <karunagrewal98@gmail.com>
To: pablo@netfilter.org, fw@strlen.de
Cc: netfilter-devel@vger.kernel.org
Subject: [nftables] tests/py: Add Test for `meta time`
Date: Mon, 18 Mar 2019 15:17:45 +0530	[thread overview]
Message-ID: <20190318094745.GA4394@nebula> (raw)

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..3d23dc75 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
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..71c68e42 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 timestamp => reg 1 ]
+  [ cmp eq reg 1 0x00000064 ]
+
-- 
2.17.1


             reply	other threads:[~2019-03-18  9:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  9:47 Karuna Grewal [this message]
     [not found] ` <CAHRz_yZMsP2RQPu=8pTigq8SrYz9xYSef3S_d4ORAMkkYDEv4Q@mail.gmail.com>
     [not found]   ` <20190318105545.qz5oddbjah4qc4fa@breakpoint.cc>
     [not found]     ` <CAHRz_yYk_Yq5+Tp1J1jT2rVT0pHWjH37-F8Rdi1XCLWj79J6rg@mail.gmail.com>
     [not found]       ` <20190318220923.5v64yccan6shhpnq@breakpoint.cc>
2019-03-19  7:04         ` [nftables] tests/py: Add Test for `meta time` Karuna Grewal
2019-03-19  7:17           ` Florian Westphal
2019-03-19  7:27             ` Karuna Grewal
2019-03-19  7:50               ` Florian Westphal
2019-04-08 22:35 ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190318094745.GA4394@nebula \
    --to=karunagrewal98@gmail.com \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).