auto-t: Remove unnecessary disconnect calls
PATCH 1/5 auto-t: Remove unnecessary disconnect calls
With the introduction of AutoConnect=False network setting the initial disconnect calls are no longer needed
--- autotests/testAP/failure_test.py | 2 -- autotests/testAP/test.py | 2 -- 2 files changed, 4 deletions(-)
autotests/testAP/failure_test.py +0 -2
@@ -58,8 +58,6 @@ class Test(unittest.TestCase): wd = IWD() dev1, dev2 = wd.list_devices(2) - dev1.disconnect() - dev2.disconnect() self.client_connect(wd, dev1)
autotests/testAP/test.py +0 -2
@@ -51,8 +51,6 @@ class Test(unittest.TestCase): wd = IWD() dev1, dev2 = wd.list_devices(2) - dev1.disconnect() - dev2.disconnect() self.client_connect(wd, dev1)
Signature · 1 line
2.13.6
PATCH 2/5 auto-t: Rename test case to reflect its purpose
--- autotests/testAP/failure_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
autotests/testAP/failure_test.py +1 -1
@@ -54,7 +54,7 @@ class Test(unittest.TestCase): condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition) - def test_connection_success(self): + def test_connection_failure(self): wd = IWD() dev1, dev2 = wd.list_devices(2)
Signature · 1 line
2.13.6
PATCH 3/5 auto-t: Return None instead of empty known net list
In reply to Tim KourtTo match the original behavior of get_ordered_networks, return None for the empty list of known networks after the scan is complete
--- autotests/util/iwd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
autotests/util/iwd.py +4 -1
@@ -395,7 +395,10 @@ class Device(IWDDBusAbstract): ordered_network = OrderedNetwork(bus_obj) ordered_networks.append(ordered_network) - return ordered_networks + if len(ordered_networks) > 0: + return ordered_networks + + return None def get_ordered_network(self, network, scan_if_needed = False): '''Returns a single network from ordered network call, or None if the
Signature · 1 line
2.13.6
PATCH 4/5 auto-t: Use changed get_ordered_network API
In reply to Tim KourtRely on internal scan and wait implementation of get_ordered_network to obtain the known networks
--- autotests/testAP/failure_test.py | 11 +---------- autotests/testAP/test.py | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-)
autotests/testAP/failure_test.py +1 -10
@@ -14,17 +14,8 @@ import testutil class Test(unittest.TestCase): def client_connect(self, wd, dev): - condition = 'not obj.scanning' - wd.wait_for_object_condition(dev, condition) - if not dev.get_ordered_networks(): - dev.scan() - condition = 'obj.scanning' - wd.wait_for_object_condition(dev, condition) - condition = 'not obj.scanning' - wd.wait_for_object_condition(dev, condition) - - ordered_network = dev.get_ordered_network('TestAP1') + ordered_network = dev.get_ordered_network('TestAP1', True) self.assertEqual(ordered_network.type, NetworkType.psk)
autotests/testAP/test.py +1 -10
@@ -14,17 +14,8 @@ import testutil class Test(unittest.TestCase): def client_connect(self, wd, dev): - condition = 'not obj.scanning' - wd.wait_for_object_condition(dev, condition) - if not dev.get_ordered_networks(): - dev.scan() - condition = 'obj.scanning' - wd.wait_for_object_condition(dev, condition) - condition = 'not obj.scanning' - wd.wait_for_object_condition(dev, condition) - - ordered_network = dev.get_ordered_network('TestAP1') + ordered_network = dev.get_ordered_network('TestAP1', True) self.assertEqual(ordered_network.type, NetworkType.psk)
Signature · 1 line
2.13.6
PATCH 5/5 auto-t: Remove bogus logic
In reply to Tim KourtDevice object has no property named 'connected'.client_connect has no member dev2
--- autotests/testAP/failure_test.py | 7 ------- 1 file changed, 7 deletions(-)
autotests/testAP/failure_test.py +0 -7
@@ -22,13 +22,6 @@ class Test(unittest.TestCase): psk_agent = PSKAgent('Password1') wd.register_psk_agent(psk_agent) - try: - dev2.disconnect() - condition = 'not obj.connected' - wd.wait_for_object_condition(dev2, condition) - except: - pass - ordered_network.network_object.connect() condition = 'obj.connected'
Signature · 1 line
2.13.6
Hi Tim,
Quoted 7 lines · Tim Kourt
With the introduction of AutoConnect=False network setting the initial disconnect calls are no longer needed
--- autotests/testAP/failure_test.py | 2 -- autotests/testAP/test.py | 2 -- 2 files changed, 4 deletions(-)
All applied, thanks.
Regards,
-Denis