1 module Test_interfaces =
3 let conf ="# This file describes the network interfaces available on your system
4 # and how to activate them. For more information, see interfaces(5).
5 # The loopback network interface
7 source /etc/network/interfaces.d/*.conf
16 script /usr/local/sbin/map-scheme
21 iface eth0-home inet static
29 iface eth0-work inet dhcp
34 iface tap0 inet static
39 # ... and I like comments
42 /usr/local/sbin/map-scheme
45 bridge-ports eth2 eth3 eth4
52 source /etc/network.d/*.net.conf
55 test Interfaces.lns get conf =
56 { "#comment" = "This file describes the network interfaces available on your system"}
57 { "#comment" = "and how to activate them. For more information, see interfaces(5)." }
58 { "#comment" = "The loopback network interface" }
60 {"source" = "/etc/network/interfaces.d/*.conf"}
66 { "allow-hotplug" { "1" = "eth1" } }
70 { "method" = "loopback"} {} }
72 { "script" = "/usr/local/sbin/map-scheme"}
73 { "map" = "HOME eth0-home"}
74 { "map" = "WORK eth0-work"}
76 { "iface" = "eth0-home"
78 { "method" = "static"}
80 { "address" = "192.168.1.1" }
81 { "netmask" = "255.255.255.0" }
82 { "bridge_maxwait" = "0" }
83 { "#comment" = "up flush-mail" }
84 { "down" = "Mambo #5" }
86 { "iface" = "eth0-work"
98 { "method" = "static" }
99 { "vde2-switch" = "-" }
102 { "#comment" = "I like mapping ..." }
103 { "#comment" = "... and I like comments" }
105 { "script" = "/usr/local/sbin/map-scheme"}
108 { "family" = "inet" }
109 { "method" = "dhcp" }
117 { "family" = "inet" }
118 { "method" = "static" }
123 { "address" = "10.0.0.1" }
124 { "netmask" = "255.0.0.0" }
126 {"source" = "/etc/network.d/*.net.conf"}
128 test Interfaces.lns put "" after
129 set "/iface[1]" "eth0";
130 set "/iface[1]/family" "inet";
131 set "/iface[1]/method" "dhcp"
132 = "iface eth0 inet dhcp\n"
134 test Interfaces.lns put "" after
135 set "/source[0]" "/etc/network/conf.d/*.conf"
136 = "source /etc/network/conf.d/*.conf\n"
138 (* Test: Interfaces.lns
139 source-directory (Issue #306) *)
140 test Interfaces.lns get "source-directory interfaces.d\n" =
141 { "source-directory" = "interfaces.d" }