3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

auto-t: remove beacon loss tests

This commit is contained in:
James Prestwood 2020-11-03 12:51:29 -08:00 committed by Denis Kenzior
parent 1106514a38
commit d3a57d47f3
2 changed files with 0 additions and 159 deletions

View File

@ -92,82 +92,6 @@ class Test(unittest.TestCase):
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[0].ifname, device.name))
def test_roam_on_beacon_loss(self):
hwsim = Hwsim()
rule0 = hwsim.rules.create()
rule0.source = self.bss_radio[0].addresses[0]
rule0.bidirectional = True
rule1 = hwsim.rules.create()
rule1.source = self.bss_radio[1].addresses[0]
rule1.bidirectional = True
wd = IWD()
device = wd.list_devices(1)[0]
# Check that iwd selects BSS 0 first
rule0.signal = -2000
rule1.signal = -2500
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network("TestFT")
self.assertEqual(ordered_network.type, NetworkType.eap)
self.assertEqual(ordered_network.signal_strength, -2000)
condition = 'not obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
self.assertFalse(self.bss_hostapd[0].list_sta())
self.assertFalse(self.bss_hostapd[1].list_sta())
ordered_network.network_object.connect()
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
self.assertTrue(self.bss_hostapd[0].list_sta())
self.assertFalse(self.bss_hostapd[1].list_sta())
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[0].ifname, device.name)
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[1].ifname, device.name))
# Check that iwd starts transition to BSS 1 in less than 20 seconds
# from a beacon loss event
rule0.drop = True
rule0.signal = -3000
wd.wait(2)
rule0.drop = False
condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition)
# Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition)
self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta())
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[1].ifname, device.name)
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[0].ifname, device.name))
def tearDown(self):
os.system('ifconfig "' + self.bss_hostapd[0].ifname + '" down')
os.system('ifconfig "' + self.bss_hostapd[1].ifname + '" down')

View File

@ -98,89 +98,6 @@ class Test(unittest.TestCase):
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[0].ifname, device.name))
def test_roam_on_beacon_loss(self):
hwsim = Hwsim()
rule0 = hwsim.rules.create()
rule0.source = self.bss_radio[0].addresses[0]
rule0.bidirectional = True
rule1 = hwsim.rules.create()
rule1.source = self.bss_radio[1].addresses[0]
rule1.bidirectional = True
# Check that iwd selects BSS 0 first
rule0.signal = -2000
rule1.signal = -2500
wd = IWD(True)
psk_agent = PSKAgent("EasilyGuessedPassword")
wd.register_psk_agent(psk_agent)
device = wd.list_devices(1)[0]
# prevent autoconnect
device.disconnect()
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
device.scan()
condition = 'obj.scanning'
wd.wait_for_object_condition(device, condition)
condition = 'not obj.scanning'
wd.wait_for_object_condition(device, condition)
ordered_network = device.get_ordered_network("TestFT")
self.assertEqual(ordered_network.type, NetworkType.psk)
self.assertEqual(ordered_network.signal_strength, -2000)
condition = 'not obj.connected'
wd.wait_for_object_condition(ordered_network.network_object, condition)
self.assertFalse(self.bss_hostapd[0].list_sta())
self.assertFalse(self.bss_hostapd[1].list_sta())
ordered_network.network_object.connect()
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
self.assertTrue(self.bss_hostapd[0].list_sta())
self.assertFalse(self.bss_hostapd[1].list_sta())
wd.unregister_psk_agent(psk_agent)
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[0].ifname, device.name)
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[1].ifname, device.name))
# Check that iwd starts transition to BSS 1 in less than 20 seconds
# from a beacon loss event
rule0.drop = True
rule0.signal = -3000
wd.wait(2)
rule0.drop = False
condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 20)
# Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between
condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition, 5)
self.assertEqual(device.state, iwd.DeviceState.connected)
self.assertTrue(self.bss_hostapd[1].list_sta())
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[1].ifname, device.name)
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[0].ifname, device.name))
def tearDown(self):
os.system('ifconfig "' + self.bss_hostapd[0].ifname + '" down')
os.system('ifconfig "' + self.bss_hostapd[1].ifname + '" down')