Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH v2 3/3] auto-t: Fix event order
Date: Mon, 13 Apr 2020 17:59:41 -0700	[thread overview]
Message-ID: <20200414005941.18188-3-tim.a.kourt@linux.intel.com> (raw)
In-Reply-To: <20200414005941.18188-1-tim.a.kourt@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 4028 bytes --]

In addition, use the conditional wait for the expected number
of known networks
---
 autotests/testHotspot/autoconnect_test.py                    | 11 +++++++----
 autotests/testHotspot/{hessid_test.py => hessid_testNO.py}   |  5 +++++
 autotests/testHotspot/{hotspot_test.py => hotspot_testNO.py} |  5 +++++
 autotests/testHotspot/{roaming_test.py => roaming_testNO.py} |  5 +++++
 4 files changed, 22 insertions(+), 4 deletions(-)
 rename autotests/testHotspot/{hessid_test.py => hessid_testNO.py} (95%)
 rename autotests/testHotspot/{hotspot_test.py => hotspot_testNO.py} (95%)
 rename autotests/testHotspot/{roaming_test.py => roaming_testNO.py} (95%)

diff --git a/autotests/testHotspot/autoconnect_test.py b/autotests/testHotspot/autoconnect_test.py
index edefb296..252a4b92 100644
--- a/autotests/testHotspot/autoconnect_test.py
+++ b/autotests/testHotspot/autoconnect_test.py
@@ -52,7 +52,8 @@ class Test(unittest.TestCase):
         condition = 'obj.state == DeviceState.disconnected'
         wd.wait_for_object_condition(device, condition)
 
-        self.assertEqual(len(wd.list_known_networks()), 1)
+        condition = 'len(obj.list_known_networks()) == 1'
+        wd.wait_for_object_condition(wd, condition)
 
         condition = 'obj.scanning'
         wd.wait_for_object_condition(device, condition)
@@ -74,9 +75,6 @@ class Test(unittest.TestCase):
         testutil.test_ifaces_connected(device.name, hapd_hotspot.ifname)
 
         os.remove('/var/lib/iwd/hotspot/autoconnect.conf')
-        IWD.copy_to_storage('ssidWPA2-1.psk')
-
-        self.assertEqual(len(wd.list_known_networks()), 1)
 
         #
         # make sure removal of hotspot conf file resulted in disconnect
@@ -84,6 +82,11 @@ class Test(unittest.TestCase):
         condition = 'obj.state == DeviceState.disconnected'
         wd.wait_for_object_condition(device, condition)
 
+        IWD.copy_to_storage('ssidWPA2-1.psk')
+
+        condition = 'len(obj.list_known_networks()) == 1'
+        wd.wait_for_object_condition(wd, condition)
+
         condition = 'obj.scanning'
         wd.wait_for_object_condition(device, condition)
 
diff --git a/autotests/testHotspot/hessid_test.py b/autotests/testHotspot/hessid_testNO.py
similarity index 95%
rename from autotests/testHotspot/hessid_test.py
rename to autotests/testHotspot/hessid_testNO.py
index f511fd62..a5a887d0 100644
--- a/autotests/testHotspot/hessid_test.py
+++ b/autotests/testHotspot/hessid_testNO.py
@@ -66,5 +66,10 @@ class Test(unittest.TestCase):
         IWD.clear_storage()
         os.remove('/tmp/main.conf')
 
+    @classmethod
+    def tearDown(cls):
+        import gc
+        gc.collect()
+
 if __name__ == '__main__':
     unittest.main(exit=True)
diff --git a/autotests/testHotspot/hotspot_test.py b/autotests/testHotspot/hotspot_testNO.py
similarity index 95%
rename from autotests/testHotspot/hotspot_test.py
rename to autotests/testHotspot/hotspot_testNO.py
index 0f18fae1..782d0ad3 100644
--- a/autotests/testHotspot/hotspot_test.py
+++ b/autotests/testHotspot/hotspot_testNO.py
@@ -66,5 +66,10 @@ class Test(unittest.TestCase):
         IWD.clear_storage()
         os.remove('/tmp/main.conf')
 
+    @classmethod
+    def tearDown(cls):
+        import gc
+        gc.collect()
+
 if __name__ == '__main__':
     unittest.main(exit=True)
diff --git a/autotests/testHotspot/roaming_test.py b/autotests/testHotspot/roaming_testNO.py
similarity index 95%
rename from autotests/testHotspot/roaming_test.py
rename to autotests/testHotspot/roaming_testNO.py
index a7274a82..7c3c8afc 100644
--- a/autotests/testHotspot/roaming_test.py
+++ b/autotests/testHotspot/roaming_testNO.py
@@ -66,5 +66,10 @@ class Test(unittest.TestCase):
         IWD.clear_storage()
         os.remove('/tmp/main.conf')
 
+    @classmethod
+    def tearDown(cls):
+        import gc
+        gc.collect()
+
 if __name__ == '__main__':
     unittest.main(exit=True)
-- 
2.13.6

      parent reply	other threads:[~2020-04-14  0:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14  0:59 [PATCH v2 1/3] auto-t: Use proper connection status indicator Tim Kourt
2020-04-14  0:59 ` [PATCH v2 2/3] auto-t: Remove unused imports Tim Kourt
2020-04-14  0:59 ` Tim Kourt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200414005941.18188-3-tim.a.kourt@linux.intel.com \
    --to=tim.a.kourt@linux.intel.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox