mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-21 03:32:42 +01:00
0545dbcf24
ifconfig isn't available by default in several linux distros so instead use 'ip' which seems to be much more widespread.
33 lines
602 B
Python
33 lines
602 B
Python
#!/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('ip link set dev %s down' % device.name)
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
pass
|
|
|
|
@classmethod
|
|
def tearDownClass(cls):
|
|
IWD.clear_storage()
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main(exit=True)
|