summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-08-23 13:26:19 +0200
committerChristian Poessinger <christian@poessinger.com>2020-08-23 13:26:19 +0200
commitbd7f30dcd55866de125af012ac63b96dc226a1f1 (patch)
tree73bd21247d8bbe706f330342b52a19c15d488641
parent87693ce61819b82b6496cdde3d59835aa81cf6a9 (diff)
downloadvyos-1x-bd7f30dcd55866de125af012ac63b96dc226a1f1.tar.gz
vyos-1x-bd7f30dcd55866de125af012ac63b96dc226a1f1.zip
wireless: validate hostapd/wpa_supplicant is running
-rwxr-xr-xscripts/cli/test_interfaces_wireless.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/scripts/cli/test_interfaces_wireless.py b/scripts/cli/test_interfaces_wireless.py
index ff293ac84..fae233244 100755
--- a/scripts/cli/test_interfaces_wireless.py
+++ b/scripts/cli/test_interfaces_wireless.py
@@ -18,6 +18,7 @@ import os
import unittest
from base_interfaces_test import BasicInterfaceTest
+from psutil import process_iter
from vyos.util import check_kmod
class WirelessInterfaceTest(BasicInterfaceTest.BaseTest):
@@ -38,15 +39,19 @@ class WirelessInterfaceTest(BasicInterfaceTest.BaseTest):
self._interfaces = list(self._options)
self.session.set(['system', 'wifi-regulatory-domain', 'SE'])
- def test_wifi_client(self):
- """ test creation of a wireless station """
- for intf in self._interfaces:
- # prepare interfaces
- for option in self._options.get(intf, []):
- self.session.set(self._base_path + [intf] + option.split())
+ def test_add_address_single(self):
+ """ derived method to check if member interfaces are enslaved properly """
+ super().test_add_address_single()
- # commit changes
- self.session.commit()
+ for option, option_value in self._options.items():
+ if 'type access-point' in option_value:
+ # Check for running process
+ self.assertIn('hostapd', (p.name() for p in process_iter()))
+ elif 'type station' in option_value:
+ # Check for running process
+ self.assertIn('wpa_supplicant', (p.name() for p in process_iter()))
+ else:
+ self.assertTrue(False)
if __name__ == '__main__':
check_kmod('mac80211_hwsim')