Imported Upstream version 1.3.0
[platform/upstream/augeas.git] / lenses / tests / test_passwd.aug
1 module Test_Passwd =
2
3 let conf = "root:x:0:0:root:/root:/bin/bash
4 libuuid:x:100:101::/var/lib/libuuid:/bin/sh
5 free:x:1000:1000:Free Ekanayaka,,,:/home/free:/bin/bash
6 root:*:0:0:Charlie &:/root:/bin/csh
7 "
8
9 test Passwd.lns get conf =
10    { "root"
11      { "password" = "x" }
12      { "uid" = "0" }
13      { "gid" = "0" }
14      { "name" = "root" }
15      { "home" = "/root" }
16      { "shell" = "/bin/bash" } }
17    { "libuuid"
18      { "password" = "x" }
19      { "uid" = "100" }
20      { "gid" = "101" }
21      { "name" }
22      { "home" = "/var/lib/libuuid" }
23      { "shell" = "/bin/sh" } }
24    { "free"
25      { "password" = "x" }
26      { "uid" = "1000" }
27      { "gid" = "1000" }
28      { "name" = "Free Ekanayaka,,," }
29      { "home" = "/home/free" }
30      { "shell" = "/bin/bash" } }
31    { "root"
32      { "password" = "*" }
33      { "uid" = "0" }
34      { "gid" = "0" }
35      { "name" = "Charlie &" }
36      { "home" = "/root" }
37      { "shell" = "/bin/csh" } }
38
39 (* Popular on Solaris *)
40 test Passwd.lns get "+@some-nis-group::::::\n" =
41   { "@nis" = "some-nis-group" }
42
43 test Passwd.lns get "+\n" =
44   { "@nisdefault" }
45
46 test Passwd.lns get "+::::::/sbin/nologin\n" =
47   { "@nisdefault"
48     { "password" = "" }
49     { "uid" = "" }
50     { "gid" = "" }
51     { "name" }
52     { "home" }
53     { "shell" = "/sbin/nologin" } }
54
55 (* NIS entries with overrides, ticket #339 *)
56 test Passwd.lns get "+@bob:::::/home/bob:/bin/bash\n" =
57  { "@nis" = "bob"
58    { "home" = "/home/bob" }
59    { "shell" = "/bin/bash" } }