mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
auto-t: add ability to reserve radios not for IWD/hostapd/etc
If the test needs to do something very specific it may be useful to prevent IWD from managing all the radios. This can now be done by setting a "reserve" option in the radio settings. The value of this should be something other than iwd, hostapd, or wpa_supplicant. For example: [rad1] reserve=false
This commit is contained in:
parent
c2ad0006eb
commit
c76f7eac05
@ -73,10 +73,10 @@ class Interface:
|
|||||||
Process(['ip', 'link', 'set', self.name, state], namespace=self.ns.name).wait()
|
Process(['ip', 'link', 'set', self.name, state], namespace=self.ns.name).wait()
|
||||||
|
|
||||||
class Radio:
|
class Radio:
|
||||||
def __init__(self, name, default_ns):
|
def __init__(self, name, default_ns, used_by='iwd'):
|
||||||
self.name = name
|
self.name = name
|
||||||
# hostapd will reset this if this radio is used by it
|
# hostapd will reset this if this radio is used by it
|
||||||
self.use = 'iwd'
|
self.use = used_by
|
||||||
self.interface = None
|
self.interface = None
|
||||||
self.ns = default_ns
|
self.ns = default_ns
|
||||||
|
|
||||||
@ -131,15 +131,18 @@ class VirtualRadio(Radio):
|
|||||||
|
|
||||||
self.hwsim = config.hwsim.Hwsim()
|
self.hwsim = config.hwsim.Hwsim()
|
||||||
|
|
||||||
|
used_by = 'iwd'
|
||||||
|
|
||||||
if cfg:
|
if cfg:
|
||||||
self.disable_iftype = cfg.get('iftype_disable', None)
|
self.disable_iftype = cfg.get('iftype_disable', None)
|
||||||
self.disable_cipher = cfg.get('cipher_disable', None)
|
self.disable_cipher = cfg.get('cipher_disable', None)
|
||||||
|
used_by = cfg.get('reserve', 'iwd')
|
||||||
|
|
||||||
self._radio = self.hwsim.radios.create(name, p2p_device=True,
|
self._radio = self.hwsim.radios.create(name, p2p_device=True,
|
||||||
iftype_disable=self.disable_iftype,
|
iftype_disable=self.disable_iftype,
|
||||||
cipher_disable=self.disable_cipher)
|
cipher_disable=self.disable_cipher)
|
||||||
|
|
||||||
super().__init__(self._radio.name, default_ns)
|
super().__init__(self._radio.name, default_ns, used_by)
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
super().__del__()
|
super().__del__()
|
||||||
|
Loading…
Reference in New Issue
Block a user