mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-25 16:42:37 +01:00
auto-t: use device waiting feature in all tests
This commit is contained in:
parent
59c4c8ac6b
commit
dcdfdde5dc
@ -48,8 +48,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -17,8 +17,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_disconnect(self):
|
def test_disconnect(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
hostapd_if = list(hostapd_map.values())[0]
|
hostapd_if = list(hostapd_map.values())[0]
|
||||||
|
@ -21,8 +21,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -21,8 +21,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -16,8 +16,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -29,8 +29,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -16,8 +16,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = iwd.PSKAgent(*secrets)
|
psk_agent = iwd.PSKAgent(*secrets)
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -21,8 +21,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -27,8 +27,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -13,8 +13,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -26,8 +26,7 @@ class Test(unittest.TestCase):
|
|||||||
hostapd_ifname = ifname
|
hostapd_ifname = ifname
|
||||||
break
|
break
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -13,8 +13,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -13,8 +13,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -13,8 +13,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -18,8 +18,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent('abc', ('user', 'testpasswd'))
|
psk_agent = PSKAgent('abc', ('user', 'testpasswd'))
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -14,8 +14,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -16,8 +16,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_push_button_success(self):
|
def test_push_button_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
device.wps_push_button()
|
device.wps_push_button()
|
||||||
|
@ -16,8 +16,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_push_button_success(self):
|
def test_push_button_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
device.wps_push_button()
|
device.wps_push_button()
|
||||||
|
@ -26,7 +26,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
device = wd.list_devices()[0];
|
device = wd.list_devices(1)[0];
|
||||||
|
|
||||||
# Check that iwd selects BSS 0 first
|
# Check that iwd selects BSS 0 first
|
||||||
rule0.signal = -2000
|
rule0.signal = -2000
|
||||||
@ -107,7 +107,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
device = wd.list_devices()[0];
|
device = wd.list_devices(1)[0];
|
||||||
|
|
||||||
# Check that iwd selects BSS 0 first
|
# Check that iwd selects BSS 0 first
|
||||||
rule0.signal = -2000
|
rule0.signal = -2000
|
||||||
@ -182,7 +182,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
hwsim = Hwsim()
|
hwsim = Hwsim()
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
device = wd.list_devices()[0]
|
device = wd.list_devices(1)[0]
|
||||||
try:
|
try:
|
||||||
device.disconnect()
|
device.disconnect()
|
||||||
except:
|
except:
|
||||||
|
@ -30,7 +30,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("EasilyGuessedPassword")
|
psk_agent = PSKAgent("EasilyGuessedPassword")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
device = wd.list_devices()[0];
|
device = wd.list_devices(1)[0];
|
||||||
|
|
||||||
# Check that iwd selects BSS 0 first
|
# Check that iwd selects BSS 0 first
|
||||||
rule0.signal = -2000
|
rule0.signal = -2000
|
||||||
@ -116,7 +116,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("EasilyGuessedPassword")
|
psk_agent = PSKAgent("EasilyGuessedPassword")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
device = wd.list_devices()[0];
|
device = wd.list_devices(1)[0];
|
||||||
|
|
||||||
# Check that iwd selects BSS 0 first
|
# Check that iwd selects BSS 0 first
|
||||||
rule0.signal = -2000
|
rule0.signal = -2000
|
||||||
@ -193,7 +193,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
hwsim = Hwsim()
|
hwsim = Hwsim()
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
device = wd.list_devices()[0]
|
device = wd.list_devices(1)[0]
|
||||||
try:
|
try:
|
||||||
device.disconnect()
|
device.disconnect()
|
||||||
except:
|
except:
|
||||||
|
@ -14,8 +14,7 @@ class Test(unittest.TestCase):
|
|||||||
def test_connection_success(self):
|
def test_connection_success(self):
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -62,7 +62,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
device = wd.list_devices()[0];
|
device = wd.list_devices(1)[0];
|
||||||
|
|
||||||
# Check that iwd selects BSS 0 first
|
# Check that iwd selects BSS 0 first
|
||||||
rule0.signal = -2500
|
rule0.signal = -2500
|
||||||
|
@ -23,7 +23,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
wd = IWD()
|
wd = IWD()
|
||||||
|
|
||||||
device = wd.list_devices()[0];
|
device = wd.list_devices(1)[0];
|
||||||
|
|
||||||
# Register agent early to catch any unexpected notifications
|
# Register agent early to catch any unexpected notifications
|
||||||
agent = TstAgent()
|
agent = TstAgent()
|
||||||
|
@ -37,8 +37,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -30,8 +30,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -17,8 +17,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -17,8 +17,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -18,8 +18,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
@ -17,8 +17,7 @@ class Test(unittest.TestCase):
|
|||||||
psk_agent = PSKAgent("secret123")
|
psk_agent = PSKAgent("secret123")
|
||||||
wd.register_psk_agent(psk_agent)
|
wd.register_psk_agent(psk_agent)
|
||||||
|
|
||||||
devices = wd.list_devices();
|
devices = wd.list_devices(1);
|
||||||
self.assertIsNotNone(devices)
|
|
||||||
device = devices[0]
|
device = devices[0]
|
||||||
|
|
||||||
condition = 'not obj.scanning'
|
condition = 'not obj.scanning'
|
||||||
|
Loading…
Reference in New Issue
Block a user