($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH] auto-t: add ability to reserve radios not for IWD/hostapd/etc
Date: Wed, 28 Feb 2024 09:47:43 -0800	[thread overview]
Message-ID: <20240228174743.1237719-1-prestwoj@gmail.com> (raw)

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(-)

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__()
-- 
2.34.1


             reply	other threads:[~2024-02-28 17:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-28 17:47 James Prestwood [this message]
2024-03-01 14:42 ` [PATCH] auto-t: add ability to reserve radios not for IWD/hostapd/etc Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240228174743.1237719-1-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).