Skip to content

Commit 6fc19f7

Browse files
author
Ritwick DSouza
committed
[raspbian] Added tests for mtu and mac
1 parent 75efd46 commit 6fc19f7

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

tests/raspbian/test_interfaces.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,57 @@ def test_multiple_ip(self):
217217
'''
218218
self.assertEqual(o.render(), expected)
219219

220+
def test_mtu(self):
221+
o = Raspbian({
222+
"interfaces": [
223+
{
224+
"mtu": 1500,
225+
"name": "eth1",
226+
"addresses": [
227+
{
228+
"family": "ipv4",
229+
"proto": "dhcp"
230+
}
231+
],
232+
"type": "ethernet",
233+
}
234+
],
235+
})
236+
237+
expected = '''config: /etc/network/interfaces
238+
auto eth1
239+
iface eth1 inet dhcp
240+
pre-up /sbin/ifconfig $IFACE mtu 1500
241+
242+
'''
243+
self.assertEqual(o.render(), expected)
244+
245+
def test_mac(self):
246+
o = Raspbian({
247+
"interfaces": [
248+
{
249+
"name": "eth1",
250+
"addresses": [
251+
{
252+
"family": "ipv4",
253+
"proto": "dhcp"
254+
}
255+
],
256+
"type": "ethernet",
257+
"mac": "52:54:00:56:46:c0"
258+
}
259+
],
260+
})
261+
262+
expected = '''config: /etc/network/interfaces
263+
auto eth1
264+
iface eth1 inet dhcp
265+
hwaddress 52:54:00:56:46:c0
266+
267+
'''
268+
269+
self.assertEqual(o.render(), expected)
270+
220271
def test_multiple_ip_and_dhcp(self):
221272
o = Raspbian({
222273
"interfaces": [

0 commit comments

Comments
 (0)