mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-05 04:32:34 +01:00
auto-t: add test for fixed scanning crash
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.
This commit is contained in:
parent
94cc957c5e
commit
9966533e6a
32
autotests/testScan/remove_iface_test.py
Normal file
32
autotests/testScan/remove_iface_test.py
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user