Skip to content

Commit f4c3328

Browse files
author
Ritwick DSouza
committed
[raspbian] Updated tests for wep
1 parent 5f3e675 commit f4c3328

1 file changed

Lines changed: 53 additions & 5 deletions

File tree

tests/raspbian/test_hostapd.py

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_wpa2_personal(self):
4949
wpa=2
5050
wpa_key_mgmt=WPA-PSK
5151
wpa_passphrase=passphrase012345
52-
wpa_pairwise=TKIP CCMP
52+
rsn_pairwise=TKIP CCMP
5353
5454
# config: /etc/network/interfaces
5555
@@ -193,7 +193,6 @@ def test_wpa2_enterprise_ap(self):
193193

194194
self.assertEqual(o.render(), expected)
195195

196-
@unittest.skip('Test skipping')
197196
def test_wep_open(self):
198197
o = Raspbian({
199198
"radios": [
@@ -224,10 +223,34 @@ def test_wep_open(self):
224223
]
225224
})
226225

227-
expected = ''''''
226+
expected = '''# config: /etc/hostapd/hostapd.conf
227+
228+
interface=wlan0
229+
driver=nl80211
230+
hw_mode=g
231+
channel=3
232+
ieee80211n=1
233+
ssid=wep
234+
auth_algs=1
235+
wep_default_key=0
236+
wep_key0=wepkey1234567
237+
238+
# config: /etc/network/interfaces
239+
240+
auto wlan0
241+
iface wlan0 inet manual
242+
243+
# script: /scripts/ipv4_forwarding.sh
244+
245+
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
246+
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
247+
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
248+
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
249+
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
250+
251+
'''
228252
self.assertEqual(o.render(), expected)
229253

230-
@unittest.skip('Test skipping')
231254
def test_wep_shared(self):
232255
o = Raspbian({
233256
"radios": [
@@ -258,7 +281,32 @@ def test_wep_shared(self):
258281
]
259282
})
260283

261-
expected = ''''''
284+
expected = '''# config: /etc/hostapd/hostapd.conf
285+
286+
interface=wlan0
287+
driver=nl80211
288+
hw_mode=g
289+
channel=3
290+
ieee80211n=1
291+
ssid=wep
292+
auth_algs=2
293+
wep_default_key=0
294+
wep_key0=wepkey1234567
295+
296+
# config: /etc/network/interfaces
297+
298+
auto wlan0
299+
iface wlan0 inet manual
300+
301+
# script: /scripts/ipv4_forwarding.sh
302+
303+
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
304+
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
305+
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
306+
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
307+
sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
308+
309+
'''
262310
self.assertEqual(o.render(), expected)
263311

264312
def test_encryption_disabled(self):

0 commit comments

Comments
 (0)