From: Florent Bruneau Date: Mon, 29 Sep 2008 21:23:49 +0000 (+0200) Subject: More tests. X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=855e2f651736dfd35588245082bf0ae7d3eddbe5;p=apps%2Fpfixtools.git More tests. Signed-off-by: Florent Bruneau --- diff --git a/postlicyd/data/test.conf b/postlicyd/data/test.conf index 7c88a75..9825ce1 100644 --- a/postlicyd/data/test.conf +++ b/postlicyd/data/test.conf @@ -87,4 +87,17 @@ emails2 { on_fail = postfix:ok; } +ips1 { + type = iplist; + + file = nolock:1:data/test_ip_1; + file = nolock:1:data/test_ip_2; + + soft_threshold = 1; + hard_threshold = 2; + + on_hard_match = postfix:OK; + on_soft_match = postfix:OK; +} + recipient_filter = match1; diff --git a/postlicyd/data/test_ip_1 b/postlicyd/data/test_ip_1 new file mode 100644 index 0000000..97fcd7a --- /dev/null +++ b/postlicyd/data/test_ip_1 @@ -0,0 +1,3 @@ +1.2.3.4 +2.3.4.5 +192.168.0.1 diff --git a/postlicyd/data/test_ip_2 b/postlicyd/data/test_ip_2 new file mode 100644 index 0000000..31ec607 --- /dev/null +++ b/postlicyd/data/test_ip_2 @@ -0,0 +1,3 @@ +1.2.3.4 +1.2.3.5 +1.2.4.6 diff --git a/postlicyd/data/testcase_1 b/postlicyd/data/testcase_1 index 5aeb385..a562889 100644 --- a/postlicyd/data/testcase_1 +++ b/postlicyd/data/testcase_1 @@ -29,3 +29,4 @@ hostnames1=fail hostnames2=fail emails1=fail emails2=fail +ips1=hard_match diff --git a/postlicyd/data/testcase_2 b/postlicyd/data/testcase_2 index 8fabe54..55fdab7 100644 --- a/postlicyd/data/testcase_2 +++ b/postlicyd/data/testcase_2 @@ -29,3 +29,4 @@ hostnames1=soft_match hostnames2=hard_match emails1=soft_match emails2=hard_match +ips1=hard_match diff --git a/postlicyd/data/testcase_3 b/postlicyd/data/testcase_3 index b0a7d01..efe3754 100644 --- a/postlicyd/data/testcase_3 +++ b/postlicyd/data/testcase_3 @@ -6,7 +6,7 @@ queue_id=8045F2AB23 sender=contact@exemple.com recipient=contact@exemple.org recipient_count=0 -client_address=1.2.3.4 +client_address=1.2.3.1934 client_name=kikoo.example.net reverse_client_name=example.net instance=123.456.7 @@ -29,3 +29,4 @@ hostnames1=fail hostnames2=hard_match emails1=fail emails2=fail +ips1=error diff --git a/postlicyd/data/testcase_4 b/postlicyd/data/testcase_4 index 3a9b547..beed42d 100644 --- a/postlicyd/data/testcase_4 +++ b/postlicyd/data/testcase_4 @@ -6,7 +6,7 @@ queue_id=8045F2AB23 sender=contact@exemple.com recipient=contact@exemple.org recipient_count=0 -client_address=1.2.3.4 +client_address=12::ef:ff client_name=kikoo.example.net reverse_client_name=example.net instance=123.456.7 @@ -29,3 +29,4 @@ hostnames1=fail hostnames2=hard_match emails1=fail emails2=fail +ips1=error diff --git a/postlicyd/data/testcase_5 b/postlicyd/data/testcase_5 index d964404..9b96b98 100644 --- a/postlicyd/data/testcase_5 +++ b/postlicyd/data/testcase_5 @@ -6,7 +6,7 @@ queue_id=8045F2AB23 sender=contact@exemple.com recipient=contact@exemple.org recipient_count=0 -client_address=1.2.3.4 +client_address=8.9.10.11 client_name=kikoo.example.net reverse_client_name=example.net instance=123.456.7 @@ -21,11 +21,12 @@ encryption_protocol=TLSv1/SSLv3 encryption_cipher=DHE-RSA-AES256-sha encryption_keysize=256 etrn_domain= -stress=ys +stress=yEs match1=fail -match2=fail +match2=match hostnames1=fail hostnames2=hard_match emails1=fail emails2=fail +ips1=fail diff --git a/postlicyd/data/testcase_6 b/postlicyd/data/testcase_6 index 3431172..45213d7 100644 --- a/postlicyd/data/testcase_6 +++ b/postlicyd/data/testcase_6 @@ -6,7 +6,7 @@ queue_id=8045F2AB23 sender=contact@exemple.com recipient=contact@exemple.org recipient_count=0 -client_address=1.2.3.4 +client_address=2.3.4.5 client_name=kikoo.example.net reverse_client_name=example.net instance=123.456.7 @@ -29,3 +29,4 @@ hostnames1=fail hostnames2=hard_match emails1=fail emails2=fail +ips1=soft_match diff --git a/postlicyd/data/testcase_7 b/postlicyd/data/testcase_7 index 871f09a..144c174 100644 --- a/postlicyd/data/testcase_7 +++ b/postlicyd/data/testcase_7 @@ -29,3 +29,4 @@ hostnames1=fail hostnames2=hard_match emails1=fail emails2=fail +ips1=hard_match diff --git a/postlicyd/data/testcase_8 b/postlicyd/data/testcase_8 index c6b60b1..df463fc 100644 --- a/postlicyd/data/testcase_8 +++ b/postlicyd/data/testcase_8 @@ -6,9 +6,8 @@ queue_id=8045F2AB23 sender=contact@exemple.com recipient=contact@exemple.org recipient_count=0 -client_address=1.2.3.4 +client_address=1.2.3.5 client_name=kikoo.example.net -reverse_client_name=example.net instance=123.456.7 sasl_method=plaineuh sasl_username=you @@ -26,6 +25,7 @@ stress=yEs match1=fail match2=fail hostnames1=fail -hostnames2=hard_match +hostnames2=fail emails1=fail emails2=fail +ips1=soft_match