File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,5 +136,39 @@ def test_ipv6_static_route(self):
136136up ip -6 route add fd89::1/128 via fd88::1 dev eth0
137137down ip -6 route del fd89::1/128 via fd88::1 dev eth0
138138
139+ '''
140+ self .assertEqual (o .render (), expected )
141+
142+ def test_multiple_routes (self ):
143+ o = Raspbian ({
144+ "routes" : [
145+ {
146+ "destination" : "192.168.4.1/24" ,
147+ "next" : "192.168.2.2" ,
148+ "device" : "eth1"
149+ },
150+ {
151+ "destination" : "fd89::1/128" ,
152+ "next" : "fd88::1" ,
153+ "device" : "eth1"
154+ }
155+ ],
156+ "interfaces" : [
157+ {
158+ "type" : "ethernet" ,
159+ "name" : "eth1"
160+ }
161+ ]
162+ })
163+
164+ expected = '''# config: /etc/network/interfaces
165+
166+ auto eth1
167+ iface eth1 inet manual
168+ post-up route add -net 192.168.4.1 netmask 255.255.255.0 gw 192.168.2.2
169+ pre-up route del -net 192.168.4.1 netmask 255.255.255.0 gw 192.168.2.2
170+ up ip -6 route add fd89::1/128 via fd88::1 dev eth0
171+ down ip -6 route del fd89::1/128 via fd88::1 dev eth0
172+
139173'''
140174 self .assertEqual (o .render (), expected )
You can’t perform that action at this time.
0 commit comments