]> granicus.if.org Git - ejabberd/commitdiff
Add test for more allowed access_rules
authorPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 16 Jun 2016 09:12:16 +0000 (11:12 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Thu, 16 Jun 2016 09:12:16 +0000 (11:12 +0200)
test/acl_test.exs

index ccf518037e6a22b0f44cee03504cef04e26a2d04..38f0372e6c396737d88d12c057fd0626cdbe0dcb 100644 (file)
@@ -315,6 +315,10 @@ defmodule ACLTest do
     assert :acl.transform_access_rules_config([100]) == [{100, [:all]}]
   end
 
+  test "transform_access_rules_config expands <shaper_name> rule" do
+    assert :acl.transform_access_rules_config([:fast]) == [{:fast, [:all]}]
+  end
+
   test "transform_access_rules_config expands allow: <acl_name> rule" do
     assert :acl.transform_access_rules_config([{:allow, :test1}]) == [{:allow, [{:acl, :test1}]}]
   end
@@ -327,6 +331,26 @@ defmodule ACLTest do
     assert :acl.transform_access_rules_config([{100, :test1}]) == [{100, [{:acl, :test1}]}]
   end
 
+  test "transform_access_rules_config expands <shaper_name>: <acl_name> rule" do
+    assert :acl.transform_access_rules_config([{:fast, :test1}]) == [{:fast, [{:acl, :test1}]}]
+  end
+
+  test "transform_access_rules_config expands allow rule (no list)" do
+    assert :acl.transform_access_rules_config(:allow) == [{:allow, [:all]}]
+  end
+
+  test "transform_access_rules_config expands deny rule (no list)" do
+    assert :acl.transform_access_rules_config(:deny) == [{:deny, [:all]}]
+  end
+
+  test "transform_access_rules_config expands <integer> rule (no list)" do
+    assert :acl.transform_access_rules_config(100) == [{100, [:all]}]
+  end
+
+  test "transform_access_rules_config expands <shaper_name> rule (no list)" do
+    assert :acl.transform_access_rules_config(:fast) == [{:fast, [:all]}]
+  end
+
   ## Checking ACL on both user pattern and IP
   ## ========================================