Imported Upstream version 1.7.0
[platform/upstream/augeas.git] / lenses / tests / test_inittab.aug
1 module Test_inittab =
2
3   let simple  = "id:5:initdefault:\n"
4
5   let inittab = "id:5:initdefault:
6 # System initialization.
7 si::sysinit:/etc/rc.d/rc.sysinit
8
9 # Trap CTRL-ALT-DELETE
10 ca::ctrlaltdel:/sbin/shutdown -t3 -r now
11
12 l0:0:wait:/etc/rc.d/rc 0
13 "
14
15  test Inittab.lns get inittab =
16     { "id"
17           { "runlevels" = "5" }
18           { "action" = "initdefault" }
19           { "process" = "" } }
20     { "#comment" = "System initialization." }
21     { "si"
22           { "runlevels" = "" }
23           { "action" = "sysinit" }
24           { "process" = "/etc/rc.d/rc.sysinit" } }
25     { }
26     { "#comment" = "Trap CTRL-ALT-DELETE" }
27     { "ca"
28           { "runlevels" = "" }
29           { "action" = "ctrlaltdel" }
30           { "process" = "/sbin/shutdown -t3 -r now" } }
31     { }
32     { "l0"
33           { "runlevels" = "0" }
34           { "action" = "wait" }
35           { "process" = "/etc/rc.d/rc 0" } }
36
37   test Inittab.lns put simple after rm "/id/process" = *
38
39   test Inittab.lns put simple after set "/id/runlevels" "3" =
40     "id:3:initdefault:\n"
41
42   test Inittab.lns get
43     "co:2345:respawn:/usr/bin/command # End of line comment\n" =
44     { "co"
45         { "runlevels" = "2345" }
46         { "action" = "respawn" }
47         { "process" = "/usr/bin/command " }
48         { "#comment" = "End of line comment" } }
49
50   test Inittab.lns get
51     "co:2345:respawn:/usr/bin/blank_comment # \t \n" =
52     { "co"
53         { "runlevels" = "2345" }
54         { "action" = "respawn" }
55         { "process" = "/usr/bin/blank_comment " }
56         { "#comment" = "" } }
57
58   (* Bug 108: allow ':' in the process field *)
59   test Inittab.record get
60     "co:234:respawn:ttymon -p \"console login: \"\n" =
61     { "co"
62         { "runlevels" = "234" }
63         { "action" = "respawn" }
64         { "process" = "ttymon -p \"console login: \"" } }
65
66
67 (* Local Variables: *)
68 (* mode: caml       *)
69 (* End:             *)