Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_shadow.aug
1 module Test_Shadow =
2
3 let conf = "root:x:0:0:999999:7:::
4 libuuid:*:0:0:0::::
5 expired:$6$INVALID:0:0:0:::100:
6 locked:!$6$INVALID:0:0:0::::
7 "
8
9 test Shadow.lns get conf =
10   { "root"
11     { "password" = "x" }
12     { "lastchange_date" = "0" }
13     { "minage_days" = "0" }
14     { "maxage_days" = "999999" }
15     { "warn_days" = "7" }
16     { "inactive_days" = "" }
17     { "expire_date" = "" }
18     { "flag" = "" } }
19   { "libuuid"
20     { "password" = "*" }
21     { "lastchange_date" = "0" }
22     { "minage_days" = "0" }
23     { "maxage_days" = "0" }
24     { "warn_days" = "" }
25     { "inactive_days" = "" }
26     { "expire_date" = "" }
27     { "flag" = "" } }
28   { "expired"
29     { "password" = "$6$INVALID" }
30     { "lastchange_date" = "0" }
31     { "minage_days" = "0" }
32     { "maxage_days" = "0" }
33     { "warn_days" = "" }
34     { "inactive_days" = "" }
35     { "expire_date" = "100" }
36     { "flag" = "" } }
37   { "locked"
38     { "password" = "!$6$INVALID" }
39     { "lastchange_date" = "0" }
40     { "minage_days" = "0" }
41     { "maxage_days" = "0" }
42     { "warn_days" = "" }
43     { "inactive_days" = "" }
44     { "expire_date" = "" }
45     { "flag" = "" } }
46
47 test Shadow.lns get "+\n" =
48   { "@nisdefault" }
49
50 test Shadow.lns get "+::::::::\n" =
51   { "@nisdefault"
52     { "password" = "" }
53     { "lastchange_date" = "" }
54     { "minage_days" = "" }
55     { "maxage_days" = "" }
56     { "warn_days" = "" }
57     { "inactive_days" = "" }
58     { "expire_date" = "" }
59     { "flag" = "" } }
60
61 test Shadow.lns put "+\n" after
62   set "@nisdefault/password" "";
63   set "@nisdefault/lastchange_date" "";
64   set "@nisdefault/minage_days" "";
65   set "@nisdefault/maxage_days" "";
66   set "@nisdefault/warn_days" "";
67   set "@nisdefault/inactive_days" "";
68   set "@nisdefault/expire_date" "";
69   set "@nisdefault/flag" ""
70 = "+::::::::\n"
71
72 test Shadow.lns put "+::::::::\n" after
73   rm "@nisdefault/password";
74   rm "@nisdefault/lastchange_date";
75   rm "@nisdefault/minage_days";
76   rm "@nisdefault/maxage_days";
77   rm "@nisdefault/warn_days";
78   rm "@nisdefault/inactive_days";
79   rm "@nisdefault/expire_date";
80   rm "@nisdefault/flag"
81 = "+\n"