aboutsummaryrefslogtreecommitdiffstats
path: root/test/mandatory/filter-limit.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/mandatory/filter-limit.lua')
-rw-r--r--test/mandatory/filter-limit.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/mandatory/filter-limit.lua b/test/mandatory/filter-limit.lua
new file mode 100644
index 0000000..a2f2838
--- /dev/null
+++ b/test/mandatory/filter-limit.lua
@@ -0,0 +1,36 @@
+util = require('awall.util')
+json = require('cjson')
+
+res = {}
+
+function add(limit_type, base)
+ for _, count in ipairs{1, 30} do
+ for _, limit in ipairs{
+ count, {count=count, log=false}, {count=count, log='none'}
+ } do
+ for _, log in ipairs{false, true, 'none'} do
+ for _, action in ipairs{false, 'pass'} do
+ if not (count == 30 and log and action) then
+ table.insert(
+ res,
+ util.update(
+ util.copy(base or {}),
+ {
+ [limit_type..'-limit']=limit,
+ log=log or nil,
+ action=action or nil
+ }
+ )
+ )
+ end
+ end
+ end
+ end
+ end
+end
+
+add('conn')
+add('flow')
+add('flow', {['in']='A', out='_fw', ['no-track']=true})
+
+print(json.encode{filter=res})