Imported Upstream version 1.7.0
[platform/upstream/augeas.git] / lenses / tests / test_pagekite.aug
1 module Test_Pagekite =
2
3 let conf1 = "# Use the pagekite.net service defaults.
4 defaults
5 "
6 test Pagekite.lns get conf1 =
7   { "#comment" = "Use the pagekite.net service defaults." }
8   { "defaults" }
9
10
11 let conf2 ="
12 frontends = pagekite.freedombox.me
13 ports=80,81
14 "
15 test Pagekite.lns get conf2 =
16   { }
17   { "frontends" = "pagekite.freedombox.me" }
18   { "ports"
19     { "1" = "80" }
20     { "2" = "81" } }
21
22
23 let conf3 = "frontend=pagekite.freedombox.me
24 host=192.168.0.3
25 "
26 test Pagekite.lns get conf3 =
27   { "frontend" = "pagekite.freedombox.me" }
28   { "host" = "192.168.0.3" }
29
30
31 let conf4 = "isfrontend
32 ports=80,443
33 protos=http,https
34 domain=http,https:*.your.domain:MakeUpAPasswordHere
35 "
36 test Pagekite.lns get conf4 =
37   { "isfrontend" }
38   { "ports"
39     { "1" = "80" }
40     { "2" = "443" } }
41   { "protos"
42     { "1" = "http" }
43     { "2" = "https" } }
44   { "domain" = "http,https:*.your.domain:MakeUpAPasswordHere" }
45
46 let conf_account = "kitename = my.freedombox.me
47 kitesecret = 0420
48 # Delete this line!
49 abort_not_configured
50 "
51 test Pagekite.lns get conf_account =
52   { "kitename" = "my.freedombox.me" }
53   { "kitesecret" = "0420" }
54   { "#comment" = "Delete this line!" }
55   { "abort_not_configured" }
56                                                                                                                                                                                         
57
58 let conf_service = "
59 service_on = raw/22:@kitename : localhost:22 : @kitesecret
60 service_on=http:192.168.0.1:127.0.0.1:80:
61 service_on=https:yourhostname,fqdn:127.0.0.1:443:
62 "
63 test Pagekite.lns get conf_service =
64   {  }
65   { "service_on"
66     { "1"
67       { "protocol" = "raw/22" }
68       { "kitename" = "@kitename" }
69       { "backend_host" = "localhost" }
70       { "backend_port" = "22" }
71       { "secret" = "@kitesecret" }
72     }
73   }
74   { "service_on"
75     { "2"
76       { "protocol" = "http" }
77       { "kitename" = "192.168.0.1" }
78       { "backend_host" = "127.0.0.1" }
79       { "backend_port" = "80" }
80     }
81   }
82   { "service_on"
83     { "3"
84       { "protocol" = "https" }
85       { "kitename" = "yourhostname,fqdn" }
86       { "backend_host" = "127.0.0.1" }
87       { "backend_port" = "443" }
88     }
89   }
90
91
92 let conf_encryption = "
93 frontend=frontend.your.domain:443
94 fe_certname=frontend.your/domain
95 ca_certs=/etc/pagekite.d/site-cert.pem
96 tls_endpoint=frontend.your.domain:/path/to/frontend.pem
97 "
98 test Pagekite.lns get conf_encryption =
99   {  }
100   { "frontend" = "frontend.your.domain:443" }
101   { "fe_certname" = "frontend.your/domain" }
102   { "ca_certs" = "/etc/pagekite.d/site-cert.pem" }
103   { "tls_endpoint" = "frontend.your.domain:/path/to/frontend.pem" }
104
105
106 let conf_service_cfg = "insecure
107 service_cfg = KITENAME.pagekite.me/80 : insecure : True
108 "
109 test Pagekite.lns get conf_service_cfg =
110   { "insecure" }
111   { "service_cfg" = "KITENAME.pagekite.me/80 : insecure : True" }