Signed-off-by: Ander Juaristi <a@xxxxxxxxxxxx> --- tests/py/ip/meta.t | 9 +++++++ tests/py/ip/meta.t.payload | 54 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/tests/py/ip/meta.t b/tests/py/ip/meta.t index 4db8835..b4c3ce9 100644 --- a/tests/py/ip/meta.t +++ b/tests/py/ip/meta.t @@ -3,6 +3,15 @@ *ip;test-ip4;input icmp type echo-request;ok +meta time "1970-05-23 21:07:14" drop;ok +meta time "2019-06-21 17:00:00" drop;ok +meta time "2019-07-01 00:00:00" drop;ok +meta time "2019-07-01 00:01:00" drop;ok +meta time "2019-07-01 00:00:01" drop;ok +meta day "Saturday" drop;ok;meta day "Saturday" drop +meta hour "17:00" drop;ok;meta hour "17:00" drop +meta hour "00:00" drop;ok +meta hour "00:01" drop;ok meta l4proto icmp icmp type echo-request;ok;icmp type echo-request meta l4proto ipv6-icmp icmpv6 type nd-router-advert;ok;icmpv6 type nd-router-advert meta l4proto 58 icmpv6 type nd-router-advert;ok;icmpv6 type nd-router-advert diff --git a/tests/py/ip/meta.t.payload b/tests/py/ip/meta.t.payload index 322c087..fdf81d2 100644 --- a/tests/py/ip/meta.t.payload +++ b/tests/py/ip/meta.t.payload @@ -1,3 +1,57 @@ +# meta time "1970-05-23 21:07:14" drop +ip meta-test + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x00bc4ff2 0x00000000 ] + [ immediate reg 0 drop ] + +# meta time "2019-06-21 17:00:00" drop +ip meta-test input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x5d0cff00 0x00000000 ] + [ immediate reg 0 drop ] + +# meta time "2019-07-01 00:00:00" drop +ip meta-test input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x5d193ef0 0x00000000 ] + [ immediate reg 0 drop ] + +# meta time "2019-07-01 00:01:00" drop +ip meta-test input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x5d193f2c 0x00000000 ] + [ immediate reg 0 drop ] + +# meta time "2019-07-01 00:00:01" drop +ip meta-test input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x5d193ef1 0x00000000 ] + [ immediate reg 0 drop ] + +# meta day "Saturday" drop +ip test-ip4 input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x00000006 ] + [ immediate reg 0 drop ] + +# meta hour "17:00" drop +ip test-ip4 input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x0000d2f0 0x00000000 ] + [ immediate reg 0 drop ] + +# meta hour "00:00" drop +ip meta-test input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x00013560 0x00000000 ] + [ immediate reg 0 drop ] + +# meta hour "00:01" drop +ip meta-test input + [ meta load unknown => reg 1 ] + [ cmp eq reg 1 0x0001359c 0x00000000 ] + [ immediate reg 0 drop ] + # icmp type echo-request ip test-ip4 input [ meta load l4proto => reg 1 ] -- 2.17.1