diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-08-23 13:26:19 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-08-23 13:26:19 +0200 |
commit | bd7f30dcd55866de125af012ac63b96dc226a1f1 (patch) | |
tree | 73bd21247d8bbe706f330342b52a19c15d488641 /scripts/cli | |
parent | 87693ce61819b82b6496cdde3d59835aa81cf6a9 (diff) | |
download | vyos-1x-bd7f30dcd55866de125af012ac63b96dc226a1f1.tar.gz vyos-1x-bd7f30dcd55866de125af012ac63b96dc226a1f1.zip |
wireless: validate hostapd/wpa_supplicant is running
Diffstat (limited to 'scripts/cli')
-rwxr-xr-x | scripts/cli/test_interfaces_wireless.py | 21 |
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') |