README.md
1smtpscript
2==========
3
4smtpscript is a tool to write SMTP scenarios and easily implement regression tests for SMTP server-side implementations.
5
6A smtpscript will look like:
7
8
9 # this is a function init-helo that we want to call in all our regress tests
10 proc init-helo {
11 expect smtp ok
12 writeln "HELO regress"
13 expect smtp helo
14 }
15
16 # each of the test-case will be called sequentially
17 test-case name "mailfrom.empty" {
18 call init-helo
19 writeln "MAIL FROM:<>"
20 expect smtp ok
21 }
22
23 test-case name "mailfrom.broken" {
24 call init-helo
25 writeln "MAIL FROM:< @bleh>"
26 expect smtp permfail
27 }
28
29
30which once executed, produces the output:
31
32 $ smtpscript foo
33 ===> running test-case "mailfrom.empty" ok
34 ===> running test-case "mailfrom.broken" ok
35 ===> all run
36 passed: 2/2 (skipped: 0, failed: 0, error: 0)
37 $
38
39
40The scripting language also supports TLS, randomization and loops, so fairly complex scenarios can be achieved.
41