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: Validate Connect after ConnectHiddenNetwork
Date: Tue, 09 Jun 2020 18:22:21 -0700	[thread overview]
Message-ID: <20200610012221.19263-3-tim.a.kourt@linux.intel.com> (raw)
In-Reply-To: <20200610012221.19263-1-tim.a.kourt@linux.intel.com>

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

---
 .../connect_after_hidden_connect_test.py           | 78 ++++++++++++++++++++++
 autotests/testHiddenNetworks/hw.conf               |  3 +-
 autotests/testHiddenNetworks/ssidSomeHidden.conf   |  9 +++
 3 files changed, 89 insertions(+), 1 deletion(-)
 create mode 100644 autotests/testHiddenNetworks/connect_after_hidden_connect_test.py
 create mode 100644 autotests/testHiddenNetworks/ssidSomeHidden.conf

diff --git a/autotests/testHiddenNetworks/connect_after_hidden_connect_test.py b/autotests/testHiddenNetworks/connect_after_hidden_connect_test.py
new file mode 100644
index 00000000..478f1505
--- /dev/null
+++ b/autotests/testHiddenNetworks/connect_after_hidden_connect_test.py
@@ -0,0 +1,78 @@
+#!/usr/bin/python3
+
+import unittest
+import sys
+
+sys.path.append('../util')
+import iwd
+from iwd import IWD
+from iwd import PSKAgent
+import testutil
+import time
+
+class TestConnectionAfterHiddenNetwork(unittest.TestCase):
+    '''
+    Tries to reproduce a memory leak caused by the consecutive calls to
+    ConnectHiddenNetwork and Connect one after another.
+
+    '''
+    _ex = None
+    _done = False
+
+    def _success(self):
+        self._done = True
+
+    def _failure(self, ex):
+        self._done = True
+        self._ex = ex
+
+    def test_connection(self):
+        wd = IWD(True, '/tmp')
+
+        psk_agent = PSKAgent("secret123")
+        wd.register_psk_agent(psk_agent)
+
+        device = wd.list_devices(1)[0]
+        ordered_network = device.get_ordered_network('ssidOpen',
+                                                     scan_if_needed=True)
+
+        device.connect_hidden_network_async(name='ssidSomeHidden',
+                                                  reply_handler = self._success,
+                                                  error_handler = self._failure)
+
+        ordered_network.network_object.connect()
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(device, condition)
+
+        condition = 'obj.connected_network is not None'
+        wd.wait_for_object_condition(device, condition)
+
+        testutil.test_iface_operstate(device.name)
+        device.disconnect()
+
+        condition = 'obj.state == DeviceState.disconnected'
+        wd.wait_for_object_condition(device, condition)
+
+        wd.unregister_psk_agent(psk_agent)
+
+        IWD.clear_storage()
+
+        while not self._done:
+            time.sleep(.300)
+
+        if self._ex is not None:
+            if self._ex.get_dbus_name() != 'net.connman.iwd.Failed':
+                raise self._ex
+
+
+    @classmethod
+    def setUpClass(cls):
+        pass
+
+    @classmethod
+    def tearDownClass(cls):
+        IWD.clear_storage()
+
+if __name__ == '__main__':
+    unittest.main(exit=True)
diff --git a/autotests/testHiddenNetworks/hw.conf b/autotests/testHiddenNetworks/hw.conf
index edd061a8..7147e4be 100644
--- a/autotests/testHiddenNetworks/hw.conf
+++ b/autotests/testHiddenNetworks/hw.conf
@@ -1,5 +1,5 @@
 [SETUP]
-num_radios=6
+num_radios=7
 start_iwd=0
 max_test_exec_interval_sec=160
 tmpfs_extra_stuff=main.conf
@@ -10,3 +10,4 @@ rad1=ssidHiddenWPA.conf
 rad2=ssidOverlap1.conf
 rad3=ssidOverlap2.conf
 rad4=ssidOpen.conf
+rad5=ssidSomeHidden.conf
diff --git a/autotests/testHiddenNetworks/ssidSomeHidden.conf b/autotests/testHiddenNetworks/ssidSomeHidden.conf
new file mode 100644
index 00000000..42c69b3a
--- /dev/null
+++ b/autotests/testHiddenNetworks/ssidSomeHidden.conf
@@ -0,0 +1,9 @@
+hw_mode=g
+channel=1
+ssid=ssidSomeHidden
+
+wpa=1
+wpa_pairwise=TKIP
+wpa_passphrase=secret123
+
+ignore_broadcast_ssid=1
-- 
2.13.6

  parent reply	other threads:[~2020-06-10  1:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  1:22 [PATCH v2 1/3] station: Use separate msg holder for hidden connections Tim Kourt
2020-06-10  1:22 ` [PATCH v2 2/3] auto-t: Add async API call for connect_hidden_network Tim Kourt
2020-06-10  1:22 ` Tim Kourt [this message]
2020-06-10  2:59 ` [PATCH v2 1/3] station: Use separate msg holder for hidden connections Denis Kenzior

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=20200610012221.19263-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