summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli/test_interfaces_wireless.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-21 18:23:52 +0100
committerChristian Poessinger <christian@poessinger.com>2020-12-21 18:25:29 +0100
commit36b59b0c87376e6b91bf56475343cb0ced1149fb (patch)
tree6287192fb83cb00e05c03f65588eb803d99c1dd4 /smoketest/scripts/cli/test_interfaces_wireless.py
parent13159ee5c9d2100dded7c2755f686ad54eefcea1 (diff)
downloadvyos-1x-36b59b0c87376e6b91bf56475343cb0ced1149fb.tar.gz
vyos-1x-36b59b0c87376e6b91bf56475343cb0ced1149fb.zip
smoketest: wifi: add testcase for bridging an AP interface
Diffstat (limited to 'smoketest/scripts/cli/test_interfaces_wireless.py')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_wireless.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_wireless.py b/smoketest/scripts/cli/test_interfaces_wireless.py
index def989e76..70cb5190c 100755
--- a/smoketest/scripts/cli/test_interfaces_wireless.py
+++ b/smoketest/scripts/cli/test_interfaces_wireless.py
@@ -18,9 +18,10 @@ import os
import re
import unittest
-from vyos.configsession import ConfigSessionError
from base_interfaces_test import BasicInterfaceTest
+from glob import glob
+from vyos.configsession import ConfigSessionError
from vyos.util import process_named_running
from vyos.util import check_kmod
from vyos.util import read_file
@@ -207,6 +208,34 @@ class WirelessInterfaceTest(BasicInterfaceTest.BaseTest):
# Check for running process
self.assertTrue(process_named_running('hostapd'))
+ def test_access_point_bridge(self):
+ interface = 'wlan0'
+ ssid = 'VyOS-Test'
+ bridge = 'br42477'
+
+ # We need a bridge where we can hook our access-point interface to
+ bridge_path = ['interfaces', 'bridge', bridge]
+ self.session.set(bridge_path + ['member', 'interface', interface])
+
+ self.session.set(self._base_path + [interface, 'ssid', ssid])
+ self.session.set(self._base_path + [interface, 'country-code', 'se'])
+ self.session.set(self._base_path + [interface, 'type', 'access-point'])
+
+ self.session.commit()
+
+ # Check for running process
+ self.assertTrue(process_named_running('hostapd'))
+
+ bridge_members = []
+ for tmp in glob(f'/sys/class/net/{bridge}/lower_*'):
+ bridge_members.append(os.path.basename(tmp).replace('lower_', ''))
+
+ self.assertIn(interface, bridge_members)
+
+ self.session.delete(bridge_path)
+ self.session.delete(self._base_path)
+ self.session.commit()
+
if __name__ == '__main__':
check_kmod('mac80211_hwsim')
unittest.main()