Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get a test suite #1

Open
duijf opened this issue Sep 30, 2015 · 0 comments
Open

Get a test suite #1

duijf opened this issue Sep 30, 2015 · 0 comments

Comments

@duijf
Copy link
Contributor

duijf commented Sep 30, 2015

There is an extensive list of tests for every SPF implementation to follow. These tests suites can be found here: http://www.openspf.org/Test_Suite

A sample of this file:

---
description: Initial processing
tests:
  toolonglabel:
    description: >-
      DNS labels limited to 63 chars.
    comment: >-
      For initial processing, a long label results in None, not TempError
    spec: 4.3/1
    helo: mail.example.net
    host: 1.2.3.5
    mailfrom: lyme.eater@A123456789012345678901234567890123456789012345678901234567890123.example.com
    result: none
  longlabel:
    description: >-
      DNS labels limited to 63 chars.
    spec: 4.3/1
    helo: mail.example.net
    host: 1.2.3.5
    mailfrom: lyme.eater@A12345678901234567890123456789012345678901234567890123456789012.example.com
    result: fail
zonedata:
  example.com:
    - TIMEOUT
  example.net:
    - SPF:  v=spf1 -all exp=exp.example.net
  a.example.net:
    - SPF:  v=spf1 -all exp=exp.example.net
  exp.example.net:
    - TXT:  '%{l}'
  a12345678901234567890123456789012345678901234567890123456789012.example.com:
    - SPF:  v=spf1 -all
  hosed.example.com:
    - SPF:  "v=spf1 a:\xEF\xBB\xBFgarbage.example.net -all"
  hosed2.example.com:
    - SPF:  "v=spf1 \x80a:example.net -all"
  hosed3.example.com:
    - SPF:  "v=spf1 a:example.net \x96all"
  nothosed.example.com:
    - SPF:  "v=spf1 a:example.net -all"
    - SPF:  "\x96"
  fine.example.com:
    - TXT: "v=spf1 a  -all"

Ideally, we parse the YAML and generate Elixir tests from this. Although that might not be easy, especially considering it almost requires a complete DNS server to function with the timeouts and all that stuff.

Going to get started and give it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant