Imported Upstream version 1.8.0
[platform/upstream/augeas.git] / lenses / tests / test_postfix_virtual.aug
1 (*
2 Module: Test_Postfix_Virtual
3   Provides unit tests and examples for the <Postfix_Virtual> lens.
4 *)
5
6 module Test_Postfix_Virtual =
7
8 (* View: conf *)
9 let conf = "# a comment
10 virtual-alias.domain     anything
11 postmaster@virtual-alias.domain  postmaster
12 user1@virtual-alias.domain       address1
13 user2@virtual-alias.domain   
14     address2,
15     address3
16 root    robert.oot@domain.com
17 @example.net  root,postmaster
18 postmaster  mtaadmin+root=mta1
19 some_user  localuser
20 "
21
22 (* Test: Postfix_Virtual.lns *)
23 test Postfix_Virtual.lns get conf =
24   { "#comment" = "a comment" }
25   { "pattern" = "virtual-alias.domain"
26     { "destination" = "anything" }
27   }
28   { "pattern" = "postmaster@virtual-alias.domain"
29     { "destination" = "postmaster" }
30   }
31   { "pattern" = "user1@virtual-alias.domain"
32     { "destination" = "address1" }
33   }
34   { "pattern" = "user2@virtual-alias.domain"
35     { "destination" = "address2" }
36     { "destination" = "address3" }
37   }
38   { "pattern" = "root"
39     { "destination" = "robert.oot@domain.com" }
40   }
41   { "pattern" = "@example.net"
42     { "destination" = "root" }
43     { "destination" = "postmaster" }
44   }
45   { "pattern" = "postmaster"
46     { "destination" = "mtaadmin+root=mta1" }
47   }
48   { "pattern" = "some_user"
49     { "destination" = "localuser" }
50   }