Skip to content

Commit 2585bfa

Browse files
author
Ritwick DSouza
committed
[raspbian] Added test for Adhoc mode
1 parent e0a3fbd commit 2585bfa

2 files changed

Lines changed: 25 additions & 35 deletions

File tree

tests/raspbian/test_hostapd.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -246,41 +246,6 @@ def test_no_encryption(self):
246246
'''
247247
self.assertEqual(o.render(), expected)
248248

249-
def test_wpa2_personal_adhoc(self):
250-
o = Raspbian({
251-
"radios": [
252-
{
253-
"name": "radio0",
254-
"phy": "phy0",
255-
"driver": "mac80211",
256-
"protocol": "802.11n",
257-
"channel": 3,
258-
"channel_width": 20,
259-
"tx_power": 3
260-
},
261-
],
262-
"interfaces": [
263-
{
264-
"name": "wlan0",
265-
"type": "wireless",
266-
"wireless": {
267-
"radio": "radio0",
268-
"mode": "adhoc",
269-
"ssid": "encrypted-adhoc",
270-
"bssid": "00:26:b9:20:5f:09",
271-
"encryption": {
272-
"protocol": "wpa2_personal",
273-
"cipher": "auto",
274-
"key": "passphrase012345"
275-
}
276-
}
277-
}
278-
]
279-
})
280-
281-
expected = ''''''
282-
self.assertEqual(o.render(), expected)
283-
284249
def test_wps(self):
285250
o = Raspbian({
286251
"radios": [

tests/raspbian/test_interfaces.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,31 @@ def test_loopback(self):
319319
'''
320320
self.assertEqual(o.render(), expected)
321321

322+
def test_adhoc_wireless(self):
323+
o = Raspbian({
324+
"interfaces": [
325+
{
326+
"name": "wlan0",
327+
"type": "wireless",
328+
"wireless": {
329+
"radio": "radio0",
330+
"ssid": "freifunk",
331+
"mode": "adhoc",
332+
"bssid": "02:b8:c0:00:00:00"
333+
}
334+
}
335+
]
336+
})
337+
338+
expected = '''config: /etc/network/interfaces
339+
auto wireless
340+
iface wireless inet static
341+
address 172.128.1.1
342+
netmask 255.255.255.0
343+
wireless-channel 1
344+
wireless-essid freifunk
345+
wireless-mode ad-hoc
346+
'''
322347
def test_simple_bridge(self):
323348
o = Raspbian({
324349
"interfaces": [

0 commit comments

Comments
 (0)