Skip to content

Commit e5a2acd

Browse files
author
Ritwick DSouza
committed
[raspbian] Added tests for multiple static routes
1 parent e0e82fb commit e5a2acd

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

tests/raspbian/test_routes.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,39 @@ def test_ipv6_static_route(self):
136136
up ip -6 route add fd89::1/128 via fd88::1 dev eth0
137137
down 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)

0 commit comments

Comments
 (0)