3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-01 15:49:49 +01:00

auto-t: remove unneeded BSSs in testEAP-MSCHAPv2

Hostapd sometimes has trouble with specifying additional BSSs in
a single config file, at least in the test-runner environment.
Since all the BSS's specified were identical instead the test was
reworked to only have a single BSS and each subtest can connect
in its own unique way.
This commit is contained in:
James Prestwood 2021-08-13 12:55:07 -07:00 committed by Denis Kenzior
parent 3adb91fc9e
commit 82d7c81bd3
2 changed files with 12 additions and 35 deletions

View File

@ -10,7 +10,7 @@ from iwd import NetworkType
class Test(unittest.TestCase): class Test(unittest.TestCase):
def run_connection_test(self, ssid, *secrets): def run_connection_test(self, *secrets):
wd = IWD() wd = IWD()
psk_agent = iwd.PSKAgent(*secrets) psk_agent = iwd.PSKAgent(*secrets)
@ -29,7 +29,7 @@ class Test(unittest.TestCase):
condition = 'not obj.scanning' condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition) wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network(ssid) ordered_network = device.get_ordered_network("ssidEAP-MSCHAPV2")
self.assertEqual(ordered_network.type, NetworkType.eap) self.assertEqual(ordered_network.type, NetworkType.eap)
@ -49,23 +49,24 @@ class Test(unittest.TestCase):
wd.wait_for_object_condition(ordered_network.network_object, condition) wd.wait_for_object_condition(ordered_network.network_object, condition)
def test_agent_none(self): def test_agent_none(self):
self.run_connection_test('ssidEAP-MSCHAPV2-1') IWD.copy_to_storage('ssidEAP-MSCHAPV2-1.8021x', name='ssidEAP-MSCHAPV2.8021x')
self.run_connection_test()
def test_agent_none_hash(self): def test_agent_none_hash(self):
self.run_connection_test('ssidEAP-MSCHAPV2-2') IWD.copy_to_storage('ssidEAP-MSCHAPV2-2.8021x', name='ssidEAP-MSCHAPV2.8021x')
self.run_connection_test()
def test_agent_passwd(self): def test_agent_passwd(self):
self.run_connection_test('ssidEAP-MSCHAPV2-3', [], ('domain\\User', 'Password')) IWD.copy_to_storage('ssidEAP-MSCHAPV2-3.8021x', name='ssidEAP-MSCHAPV2.8021x')
self.run_connection_test([], ('domain\\User', 'Password'))
def test_agent_username_and_passwd(self): def test_agent_username_and_passwd(self):
self.run_connection_test('ssidEAP-MSCHAPV2-4', [], ('domain\\User', 'Password')) IWD.copy_to_storage('ssidEAP-MSCHAPV2-4.8021x', name='ssidEAP-MSCHAPV2.8021x')
self.run_connection_test([], ('domain\\User', 'Password'))
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
IWD.copy_to_storage('ssidEAP-MSCHAPV2-1.8021x') pass
IWD.copy_to_storage('ssidEAP-MSCHAPV2-2.8021x')
IWD.copy_to_storage('ssidEAP-MSCHAPV2-3.8021x')
IWD.copy_to_storage('ssidEAP-MSCHAPV2-4.8021x')
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):

View File

@ -1,4 +1,4 @@
ssid=ssidEAP-MSCHAPV2-1 ssid=ssidEAP-MSCHAPV2
interface=wln0 interface=wln0
hw_mode=g hw_mode=g
channel=1 channel=1
@ -7,27 +7,3 @@ wpa_key_mgmt=WPA-EAP
ieee8021x=1 ieee8021x=1
eap_server=1 eap_server=1
eap_user_file=/tmp/secrets/eap-user-mschapv2.text eap_user_file=/tmp/secrets/eap-user-mschapv2.text
bss=wln0_1
ssid=ssidEAP-MSCHAPV2-2
wpa=3
wpa_key_mgmt=WPA-EAP
ieee8021x=1
eap_server=1
eap_user_file=/tmp/secrets/eap-user-mschapv2.text
bss=wln0_2
ssid=ssidEAP-MSCHAPV2-3
wpa=3
wpa_key_mgmt=WPA-EAP
ieee8021x=1
eap_server=1
eap_user_file=/tmp/secrets/eap-user-mschapv2.text
bss=wln0_3
ssid=ssidEAP-MSCHAPV2-4
wpa=3
wpa_key_mgmt=WPA-EAP
ieee8021x=1
eap_server=1
eap_user_file=/tmp/secrets/eap-user-mschapv2.text