* [PATCH 1/5] auto-t: Remove unnecessary disconnect calls
@ 2020-05-07 19:20 Tim Kourt
2020-05-07 19:20 ` [PATCH 2/5] auto-t: Rename test case to reflect its purpose Tim Kourt
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Tim Kourt @ 2020-05-07 19:20 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]
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(-)
diff --git a/autotests/testAP/failure_test.py b/autotests/testAP/failure_test.py
index cad7bf6e..d419c05b 100644
--- a/autotests/testAP/failure_test.py
+++ b/autotests/testAP/failure_test.py
@@ -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)
diff --git a/autotests/testAP/test.py b/autotests/testAP/test.py
index 39161981..455c9916 100644
--- a/autotests/testAP/test.py
+++ b/autotests/testAP/test.py
@@ -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)
--
2.13.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] auto-t: Rename test case to reflect its purpose
2020-05-07 19:20 [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Tim Kourt
@ 2020-05-07 19:20 ` Tim Kourt
2020-05-07 19:20 ` [PATCH 3/5] auto-t: Return None instead of empty known net list Tim Kourt
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tim Kourt @ 2020-05-07 19:20 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 630 bytes --]
---
autotests/testAP/failure_test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/autotests/testAP/failure_test.py b/autotests/testAP/failure_test.py
index d419c05b..2c1e14b3 100644
--- a/autotests/testAP/failure_test.py
+++ b/autotests/testAP/failure_test.py
@@ -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)
--
2.13.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] auto-t: Return None instead of empty known net list
2020-05-07 19:20 [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Tim Kourt
2020-05-07 19:20 ` [PATCH 2/5] auto-t: Rename test case to reflect its purpose Tim Kourt
@ 2020-05-07 19:20 ` Tim Kourt
2020-05-07 19:20 ` [PATCH 4/5] auto-t: Use changed get_ordered_network API Tim Kourt
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Tim Kourt @ 2020-05-07 19:20 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]
To 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(-)
diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index c8d11f91..b9eeb0ff 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -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
--
2.13.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] auto-t: Use changed get_ordered_network API
2020-05-07 19:20 [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Tim Kourt
2020-05-07 19:20 ` [PATCH 2/5] auto-t: Rename test case to reflect its purpose Tim Kourt
2020-05-07 19:20 ` [PATCH 3/5] auto-t: Return None instead of empty known net list Tim Kourt
@ 2020-05-07 19:20 ` Tim Kourt
2020-05-07 19:20 ` [PATCH 5/5] auto-t: Remove bogus logic Tim Kourt
2020-05-07 19:58 ` [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Denis Kenzior
4 siblings, 0 replies; 6+ messages in thread
From: Tim Kourt @ 2020-05-07 19:20 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 2020 bytes --]
Rely 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(-)
diff --git a/autotests/testAP/failure_test.py b/autotests/testAP/failure_test.py
index 2c1e14b3..9944abaa 100644
--- a/autotests/testAP/failure_test.py
+++ b/autotests/testAP/failure_test.py
@@ -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)
diff --git a/autotests/testAP/test.py b/autotests/testAP/test.py
index 455c9916..4cacf9ad 100644
--- a/autotests/testAP/test.py
+++ b/autotests/testAP/test.py
@@ -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)
--
2.13.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] auto-t: Remove bogus logic
2020-05-07 19:20 [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Tim Kourt
` (2 preceding siblings ...)
2020-05-07 19:20 ` [PATCH 4/5] auto-t: Use changed get_ordered_network API Tim Kourt
@ 2020-05-07 19:20 ` Tim Kourt
2020-05-07 19:58 ` [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Denis Kenzior
4 siblings, 0 replies; 6+ messages in thread
From: Tim Kourt @ 2020-05-07 19:20 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 806 bytes --]
Device object has no property named 'connected'.
client_connect has no member dev2
---
autotests/testAP/failure_test.py | 7 -------
1 file changed, 7 deletions(-)
diff --git a/autotests/testAP/failure_test.py b/autotests/testAP/failure_test.py
index 9944abaa..d30bccb4 100644
--- a/autotests/testAP/failure_test.py
+++ b/autotests/testAP/failure_test.py
@@ -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'
--
2.13.6
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/5] auto-t: Remove unnecessary disconnect calls
2020-05-07 19:20 [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Tim Kourt
` (3 preceding siblings ...)
2020-05-07 19:20 ` [PATCH 5/5] auto-t: Remove bogus logic Tim Kourt
@ 2020-05-07 19:58 ` Denis Kenzior
4 siblings, 0 replies; 6+ messages in thread
From: Denis Kenzior @ 2020-05-07 19:58 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
Hi Tim,
On 5/7/20 2:20 PM, Tim Kourt wrote:
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-05-07 19:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-07 19:20 [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Tim Kourt
2020-05-07 19:20 ` [PATCH 2/5] auto-t: Rename test case to reflect its purpose Tim Kourt
2020-05-07 19:20 ` [PATCH 3/5] auto-t: Return None instead of empty known net list Tim Kourt
2020-05-07 19:20 ` [PATCH 4/5] auto-t: Use changed get_ordered_network API Tim Kourt
2020-05-07 19:20 ` [PATCH 5/5] auto-t: Remove bogus logic Tim Kourt
2020-05-07 19:58 ` [PATCH 1/5] auto-t: Remove unnecessary disconnect calls Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox