Skip to content

Commit

Permalink
CI: test mode inference
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerysong committed Oct 8, 2024
1 parent 4a12be6 commit 2a8bf37
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/files/peerlist_nolocalhost
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
192.0.2.1
5 changes: 5 additions & 0 deletions test/files/test_milter_mode_none_sign.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Domain example.com
AuthservID example.com
KeyFile private.key
TestKeys public.key
Selector elpmaxe
6 changes: 6 additions & 0 deletions test/files/test_milter_mode_none_verify.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Domain example.com
AuthservID example.com
KeyFile private.key
TestKeys public.key
Selector elpmaxe
InternalHosts peerlist_nolocalhost
28 changes: 28 additions & 0 deletions test/test_milter.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,34 @@ def test_milter_mode_v(run_miltertest):
assert msg['ARC-Seal'] == ''


def test_milter_mode_none_verify(run_miltertest):
res = run_miltertest([])

assert res.returncode == 0
assert res.stderr == ''

msg = message_from_string(res.stdout)

assert msg['Authentication-Results'] == 'example.com; arc=none smtp.remote-ip=127.0.0.1'
assert msg['ARC-Authentication-Results'] == ''
assert msg['ARC-Message-Signature'] == ''
assert msg['ARC-Seal'] == ''


def test_milter_mode_none_sign(run_miltertest):
res = run_miltertest([])

assert res.returncode == 0
assert res.stderr == ''

msg = message_from_string(res.stdout)

assert msg['Authentication-Results'] == ''
assert msg['ARC-Authentication-Results'] == 'i=1; example.com; arc=none'
assert 'ARC-Message-Signature' in msg
assert 'cv=none' in msg['ARC-Seal']


def test_milter_ar(run_miltertest):
res = run_miltertest([])
msg = message_from_string(res.stdout)
Expand Down

0 comments on commit 2a8bf37

Please sign in to comment.