All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] auto-t: add test for fixed scanning crash
@ 2022-02-08 17:35 James Prestwood
  0 siblings, 0 replies; only message in thread
From: James Prestwood @ 2022-02-08 17:35 UTC (permalink / raw)
  To: iwd

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

This simulates the conditions that trigger a free-after-use which was
fixed with:

2c355db7 ("scan: remove periodic scans from queue on abort")

This behavior can be reproduced reliably using this test with the above
patch reverted.
---
 autotests/testScan/remove_iface_test.py | 32 +++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 autotests/testScan/remove_iface_test.py

diff --git a/autotests/testScan/remove_iface_test.py b/autotests/testScan/remove_iface_test.py
new file mode 100644
index 00000000..af36c1e8
--- /dev/null
+++ b/autotests/testScan/remove_iface_test.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python3
+
+import unittest
+import sys
+import os
+
+sys.path.append('../util')
+from iwd import IWD
+from config import ctx
+
+class Test(unittest.TestCase):
+    def test_connection_success(self):
+        wd = IWD(True)
+
+        devices = wd.list_devices(1)
+        device = devices[0]
+
+        device.autoconnect = True
+        device.scan(wait=False)
+
+        os.system('ifconfig %s down' % device.name)
+
+    @classmethod
+    def setUpClass(cls):
+        pass
+
+    @classmethod
+    def tearDownClass(cls):
+        IWD.clear_storage()
+
+if __name__ == '__main__':
+    unittest.main(exit=True)
-- 
2.31.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-08 17:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 17:35 [PATCH 2/2] auto-t: add test for fixed scanning crash James Prestwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.