• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..24-Dec-2020-

smtpscript/H24-Dec-2020-139

LICENSEH A D24-Dec-2020794 1615

MakefileH A D24-Dec-202046 42

Makefile.incH A D24-Dec-202036 42

README.mdH A D24-Dec-20201 KiB4129

iobuf.cH A D24-Dec-20207.7 KiB467348

iobuf.hH A D24-Dec-20202.2 KiB7246

parse.yH A D24-Dec-202016.9 KiB906767

smtpscript.cH A D24-Dec-202018.7 KiB1,010823

smtpscript.hH A D24-Dec-20202.3 KiB8046

ssl.cH A D24-Dec-20203.3 KiB168116

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