Imported Upstream version 1.10.1
[platform/upstream/augeas.git] / lenses / tests / test_resolv.aug
1 module Test_resolv =
2
3    let conf = "# Sample resolv.conf
4 ; With multiple comment styles
5 nameserver 192.168.0.3  # and EOL comments
6 nameserver ff02::1
7 domain mynet.com  # and EOL comments
8 search mynet.com anotherorg.net
9
10 # A sortlist now
11 sortlist 130.155.160.0/255.255.240.0 130.155.0.0
12
13 options ndots:3 debug timeout:2
14 options no-ip6-dotint single-request-reopen # and EOL comments
15
16 lookup file bind
17 family inet6 inet4
18 "
19
20 test Resolv.lns get conf =
21    { "#comment" = "Sample resolv.conf" }
22    { "#comment" = "With multiple comment styles" }
23    { "nameserver" = "192.168.0.3"
24         { "#comment" = "and EOL comments" } }
25    { "nameserver" = "ff02::1" }
26    { "domain" = "mynet.com"
27         { "#comment" = "and EOL comments" } }
28    { "search"
29         { "domain" = "mynet.com" }
30         { "domain" = "anotherorg.net" } }
31    {}
32    { "#comment" = "A sortlist now" }
33    { "sortlist"
34         { "ipaddr" = "130.155.160.0"
35            { "netmask" = "255.255.240.0" } }
36         { "ipaddr" = "130.155.0.0" } }
37    {}
38    { "options"
39         { "ndots" = "3" }
40         { "debug" }
41         { "timeout" = "2" } }
42    { "options"
43         { "ip6-dotint"
44              { "negate" } }
45         { "single-request-reopen" }
46         { "#comment" = "and EOL comments" } }
47    {}
48    { "lookup"
49         { "file" }
50         { "bind" } }
51    { "family"
52         { "inet6" }
53         { "inet4" } }
54
55 test Resolv.ip6_dotint
56    put "ip6-dotint"
57    after set "/ip6-dotint/negate" "" = "no-ip6-dotint"
58
59 test Resolv.lns get ";  \r\n; \t \n" = { } { }