diff mbox series

auto-t: add ability to reserve radios not for IWD/hostapd/etc

Message ID 20240228174743.1237719-1-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series auto-t: add ability to reserve radios not for IWD/hostapd/etc | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

James Prestwood Feb. 28, 2024, 5:47 p.m. UTC
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
---
 tools/run-tests | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Denis Kenzior March 1, 2024, 2:42 p.m. UTC | #1
Hi James,

On 2/28/24 11:47, James Prestwood wrote:
> 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
> ---
>   tools/run-tests | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 

Applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/tools/run-tests b/tools/run-tests
index 11ad73c0..fdd0b989 100755
--- a/tools/run-tests
+++ b/tools/run-tests
@@ -73,10 +73,10 @@  class Interface:
 		Process(['ip', 'link', 'set', self.name, state], namespace=self.ns.name).wait()
 
 class Radio:
-	def __init__(self, name, default_ns):
+	def __init__(self, name, default_ns, used_by='iwd'):
 		self.name = name
 		# hostapd will reset this if this radio is used by it
-		self.use = 'iwd'
+		self.use = used_by
 		self.interface = None
 		self.ns = default_ns
 
@@ -131,15 +131,18 @@  class VirtualRadio(Radio):
 
 		self.hwsim = config.hwsim.Hwsim()
 
+		used_by = 'iwd'
+
 		if cfg:
 			self.disable_iftype = cfg.get('iftype_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,
 					iftype_disable=self.disable_iftype,
 					cipher_disable=self.disable_cipher)
 
-		super().__init__(self._radio.name, default_ns)
+		super().__init__(self._radio.name, default_ns, used_by)
 
 	def __del__(self):
 		super().__del__()