After discussion on IRC and here, we have selected YAML as the 'source'
format for test data. YAML is directly convertible to XML, so you can
consider it XML with a more readable syntax. The important thing, of
course, is the schema. Here is the the pyspf test suite again as YAML
with the latest schema. Please comment if there is a problem, because it
is time to start adding to the test suite. Oh, Julian wants to rename
zonedata to zonerecords. I don't like it, but I thought I'd throw it out.
Pyspf can read BIND and YAML (or JSON) test format, and run the tests or
write YAML. It creates SPFScenario objects with the zonedata and a
map of SPFTest objects. If the C lib people (libspf,libspf2) don't like
YAML, it can be easily converted to any XML equivalent syntax,
including XML.
---
comment: |
check basic exists with macros
tests:
exists-pass:
helo: mail.example.net
host: 1.2.3.5
mailfrom: lyme.eater@example.co.uk
result: pass
exists-fail:
helo: mail.example.net
host: 1.2.3.4
mailfrom: lyme.eater@example.co.uk
result: fail
zonedata:
lyme.eater.example.co.uk.1.2.3.5.spf.example.net:
- A: 127.0.0.1
example.co.uk:
- SPF: v=spf1 mx/26 exists:%{l}.%{d}.%{i}.spf.example.net -all
---
comment: |
include loop
tests:
incloop:
helo: mail.examplea.com
host: 66.150.186.79
mailfrom: chuckvsr@examplea.com
result: permerror
zonedata:
examplea.com:
- SPF: v=spf1 a mx include:b.com
exampleb.com:
- SPF: v=spf1 a mx include:a.com
---
tests:
nospace1:
comment: |
test no space
test multi-line comment
helo: mail.example1.com
host: 1.2.3.4
mailfrom: foo@example2.com
result: none
empty:
comment: |
test empty
helo: mail1.example1.com
host: 1.2.3.4
mailfrom: foo@example1.com
result: neutral
nospace2:
helo: mail.example1.com
host: 1.2.3.4
mailfrom: foo@example3.com
result: pass
zonedata:
example3.com:
- SPF: v=spf1mx
- SPF: v=spf1 mx
- MX: [0, mail.example1.com]
example1.com:
- SPF: v=spf1
example2.com:
- SPF: v=spf1mx
mail.example1.com:
- A: 1.2.3.4
---
comment: |
check trailing dot with redirect
tests:
traildot1:
helo: msgbas2x.cos.example.com
host: 192.168.218.40
mailfrom: test@example.com
result: pass
zonedata:
example.com.d.spf.example.com:
- SPF: v=spf1 redirect=a.spf.example.com
a.spf.example.com:
- SPF: v=spf1 mx:example.com include:o.spf.example.com -exists:%{s}.S.bl.spf.example.com
exists:%{s}.S.%{i}.AI.spf.example.com ~all
o.spf.example.com:
- SPF: v=spf1 ip4:192.168.144.41 ip4:192.168.218.40 ip4:192.168.218.41
msgbas1x.cos.example.com:
- A: 192.168.240.36
example.com:
- A: 192.168.90.76
- SPF: v=spf1 redirect=%{d}.d.spf.example.com.
- MX: [10, msgbas1x.cos.example.com]
---
comment: |
test empty MX
tests:
emptyMX:
helo: mail.example.com
host: 1.2.3.4
mailfrom: ''
result: neutral
zonedata:
mail.example.com:
- MX: [0, '']
- SPF: v=spf1 mx
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com
format for test data. YAML is directly convertible to XML, so you can
consider it XML with a more readable syntax. The important thing, of
course, is the schema. Here is the the pyspf test suite again as YAML
with the latest schema. Please comment if there is a problem, because it
is time to start adding to the test suite. Oh, Julian wants to rename
zonedata to zonerecords. I don't like it, but I thought I'd throw it out.
Pyspf can read BIND and YAML (or JSON) test format, and run the tests or
write YAML. It creates SPFScenario objects with the zonedata and a
map of SPFTest objects. If the C lib people (libspf,libspf2) don't like
YAML, it can be easily converted to any XML equivalent syntax,
including XML.
---
comment: |
check basic exists with macros
tests:
exists-pass:
helo: mail.example.net
host: 1.2.3.5
mailfrom: lyme.eater@example.co.uk
result: pass
exists-fail:
helo: mail.example.net
host: 1.2.3.4
mailfrom: lyme.eater@example.co.uk
result: fail
zonedata:
lyme.eater.example.co.uk.1.2.3.5.spf.example.net:
- A: 127.0.0.1
example.co.uk:
- SPF: v=spf1 mx/26 exists:%{l}.%{d}.%{i}.spf.example.net -all
---
comment: |
include loop
tests:
incloop:
helo: mail.examplea.com
host: 66.150.186.79
mailfrom: chuckvsr@examplea.com
result: permerror
zonedata:
examplea.com:
- SPF: v=spf1 a mx include:b.com
exampleb.com:
- SPF: v=spf1 a mx include:a.com
---
tests:
nospace1:
comment: |
test no space
test multi-line comment
helo: mail.example1.com
host: 1.2.3.4
mailfrom: foo@example2.com
result: none
empty:
comment: |
test empty
helo: mail1.example1.com
host: 1.2.3.4
mailfrom: foo@example1.com
result: neutral
nospace2:
helo: mail.example1.com
host: 1.2.3.4
mailfrom: foo@example3.com
result: pass
zonedata:
example3.com:
- SPF: v=spf1mx
- SPF: v=spf1 mx
- MX: [0, mail.example1.com]
example1.com:
- SPF: v=spf1
example2.com:
- SPF: v=spf1mx
mail.example1.com:
- A: 1.2.3.4
---
comment: |
check trailing dot with redirect
tests:
traildot1:
helo: msgbas2x.cos.example.com
host: 192.168.218.40
mailfrom: test@example.com
result: pass
zonedata:
example.com.d.spf.example.com:
- SPF: v=spf1 redirect=a.spf.example.com
a.spf.example.com:
- SPF: v=spf1 mx:example.com include:o.spf.example.com -exists:%{s}.S.bl.spf.example.com
exists:%{s}.S.%{i}.AI.spf.example.com ~all
o.spf.example.com:
- SPF: v=spf1 ip4:192.168.144.41 ip4:192.168.218.40 ip4:192.168.218.41
msgbas1x.cos.example.com:
- A: 192.168.240.36
example.com:
- A: 192.168.90.76
- SPF: v=spf1 redirect=%{d}.d.spf.example.com.
- MX: [10, msgbas1x.cos.example.com]
---
comment: |
test empty MX
tests:
emptyMX:
helo: mail.example.com
host: 1.2.3.4
mailfrom: ''
result: neutral
zonedata:
mail.example.com:
- MX: [0, '']
- SPF: v=spf1 mx
--
Stuart D. Gathman <stuart@bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
-------
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?listname=spf-devel@v2.listbox.com