diff options
author | Phil Sutter <phil@nwl.cc> | 2018-10-11 17:49:01 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-15 13:37:51 +0200 |
commit | 16694bdd4c01ae001b60fbc18d45200fffc84de5 (patch) | |
tree | 2f45d21b0b8c71dc09a92b422f966d950bba9335 /tests/monitor/testcases/object.t | |
parent | 9e88aae28e9f44d010f3ecf7577357f4c0e7d622 (diff) |
tests: monitor: Test JSON output as well
Enhance monitor test suite to test check JSON output as well. Note that
for now there is no support for --echo output testing with JSON.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/monitor/testcases/object.t')
-rw-r--r-- | tests/monitor/testcases/object.t | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/monitor/testcases/object.t b/tests/monitor/testcases/object.t index 6695b0f0..dacfed29 100644 --- a/tests/monitor/testcases/object.t +++ b/tests/monitor/testcases/object.t @@ -1,33 +1,46 @@ # first the setup I add table ip t O - +J {"add": {"table": {"family": "ip", "name": "t", "handle": 0}}} I add counter ip t c O add counter ip t c { packets 0 bytes 0 } +J {"add": {"counter": {"family": "ip", "name": "c", "table": "t", "handle": 0, "packets": 0, "bytes": 0}}} I delete counter ip t c O - +J {"delete": {"counter": {"family": "ip", "name": "c", "table": "t", "handle": 0, "packets": 0, "bytes": 0}}} +# FIXME: input/output shouldn't be asynchronous here I add quota ip t q 25 mbytes O add quota ip t q { 25 mbytes } +J {"add": {"quota": {"family": "ip", "name": "q", "table": "t", "handle": 0, "bytes": 26214400, "used": 0, "inv": false}}} I delete quota ip t q O - +J {"delete": {"quota": {"family": "ip", "name": "q", "table": "t", "handle": 0, "bytes": 26214400, "used": 0, "inv": false}}} +# FIXME: input/output shouldn't be asynchronous here I add limit ip t l rate 1/second O add limit ip t l { rate 1/second } +J {"add": {"limit": {"family": "ip", "name": "l", "table": "t", "handle": 0, "rate": 1, "per": "second", "burst": 5}}} I delete limit ip t l O - +J {"delete": {"limit": {"family": "ip", "name": "l", "table": "t", "handle": 0, "rate": 1, "per": "second", "burst": 5}}} I add ct helper ip t cth { type "sip" protocol tcp; l3proto ip; } O - +J {"add": {"ct helper": {"family": "ip", "name": "cth", "table": "t", "handle": 0, "type": "sip", "protocol": "tcp", "l3proto": "ip"}}} I delete ct helper ip t cth O - +J {"delete": {"ct helper": {"family": "ip", "name": "cth", "table": "t", "handle": 0, "type": "sip", "protocol": "tcp", "l3proto": "ip"}}} I add ct timeout ip t ctt { protocol udp; l3proto ip; policy = { unreplied: 15, replied: 12 }; } O - +J {"add": {"ct timeout": {"family": "ip", "name": "ctt", "table": "t", "handle": 0, "protocol": "udp", "l3proto": "ip", "policy": {"unreplied": 15, "replied": 12}}}} I delete ct timeout ip t ctt O - +J {"delete": {"ct timeout": {"family": "ip", "name": "ctt", "table": "t", "handle": 0, "protocol": "udp", "l3proto": "ip", "policy": {"unreplied": 15, "replied": 12}}}} |