Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_postfix_transport.aug
1 (*
2 Module: Test_Postfix_Transport
3   Provides unit tests and examples for the <Postfix_Transport> lens.
4 *)
5
6 module Test_Postfix_Transport =
7
8 (* View: conf *)
9 let conf = "# a comment
10 the.backed-up.domain.tld       relay:[their.mail.host.tld]
11 .my.domain   :
12 *            smtp:outbound-relay.my.domain
13 example.com      uucp:example
14 example.com      slow:
15 example.com      :[gateway.example.com]
16 user.foo@example.com  
17     smtp:bar.example:2025
18 firstname_lastname@example.com discard:
19 .example.com     error:mail for *.example.com is not deliverable
20 "
21
22 (* Test: Postfix_Transport.lns *)
23 test Postfix_Transport.lns get conf =
24   { "#comment" = "a comment" }
25   { "pattern" = "the.backed-up.domain.tld"
26     { "transport" = "relay" }
27     { "nexthop" = "[their.mail.host.tld]" } }
28   { "pattern" = ".my.domain"
29     { "transport" }
30     { "nexthop" } }
31   { "pattern" = "*"
32     { "transport" = "smtp" }
33     { "nexthop" = "outbound-relay.my.domain" } }
34   { "pattern" = "example.com"
35     { "transport" = "uucp" }
36     { "nexthop" = "example" } }
37   { "pattern" = "example.com"
38     { "transport" = "slow" }
39     { "nexthop" } }
40   { "pattern" = "example.com"
41     { "transport" }
42     { "nexthop" = "[gateway.example.com]" } }
43   { "pattern" = "user.foo@example.com"
44     { "transport" = "smtp" }
45     { "nexthop" = "bar.example:2025" } }
46   { "pattern" = "firstname_lastname@example.com"
47     { "transport" = "discard" }
48     { "nexthop" } }
49   { "pattern" = ".example.com"
50     { "transport" = "error" }
51     { "nexthop" = "mail for *.example.com is not deliverable" } }
52
53 (* Test: Postfix_Transport.lns
54      Bug #303 *)
55 test Postfix_Transport.lns get "user@example.com [12.34.56.78]:587\n" =
56   { "pattern" = "user@example.com"
57     { "host" = "[12.34.56.78]" }
58     { "port" = "587" } }