Linux bluetooth development
 help / color / mirror / Atom feed
From: Pauli Virtanen <pav@iki.fi>
To: linux-bluetooth@vger.kernel.org
Cc: Pauli Virtanen <pav@iki.fi>
Subject: [PATCH BlueZ v5 05/16] test-runner: enable path argument for --unix
Date: Wed, 13 May 2026 19:17:22 +0300	[thread overview]
Message-ID: <751a15b60c31fdacb76b73e92fceac72b523c8a2.1778688966.git.pav@iki.fi> (raw)
In-Reply-To: <cover.1778688966.git.pav@iki.fi>

Allow specifying the path for the controller socket to be used.
---
 tools/test-runner.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 48b7c1589..331cb6eb1 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -54,6 +54,7 @@ static bool start_monitor = false;
 static bool qemu_host_cpu = false;
 static int num_devs = 0;
 static int num_emulator = 0;
+static const char *device_path = "/tmp/bt-server-bredr";
 static const char *qemu_binary = NULL;
 static const char *kernel_image = NULL;
 static char *audio_server;
@@ -313,11 +314,10 @@ static void start_qemu(void)
 	argv[pos++] = (char *) cmdline;
 
 	for (i = 0; i < num_devs; i++) {
-		const char *path = "/tmp/bt-server-bredr";
 		char *chrdev, *serdev;
 
-		chrdev = alloca(48 + strlen(path));
-		sprintf(chrdev, "socket,path=%s,id=bt%d", path, i);
+		chrdev = alloca(48 + strlen(device_path));
+		sprintf(chrdev, "socket,path=%s,id=bt%d", device_path, i);
 
 		serdev = alloca(48);
 		sprintf(serdev, "pci-serial,chardev=bt%d", i);
@@ -1198,7 +1198,7 @@ static void usage(void)
 		"\t-m, --monitor          Start btmon\n"
 		"\t-l, --emulator[=num]   Start btvirt\n"
 		"\t-A, --audio[=path]     Start audio server\n"
-		"\t-u, --unix [path]      Provide serial device\n"
+		"\t-u, --unix[=path]      Provide serial device\n"
 		"\t-U, --usb [qemu_args]  Provide USB device\n"
 		"\t-q, --qemu <path>      QEMU binary\n"
 		"\t-H, --qemu-host-cpu    Use host CPU (requires KVM support)\n"
@@ -1211,7 +1211,7 @@ static const struct option main_options[] = {
 	{ "auto",    no_argument,       NULL, 'a' },
 	{ "dbus",    no_argument,       NULL, 'b' },
 	{ "dbus-session", no_argument,  NULL, 's' },
-	{ "unix",    no_argument,       NULL, 'u' },
+	{ "unix",    optional_argument, NULL, 'u' },
 	{ "daemon",  no_argument,       NULL, 'd' },
 	{ "emulator", no_argument,      NULL, 'l' },
 	{ "monitor", no_argument,       NULL, 'm' },
@@ -1239,7 +1239,7 @@ int main(int argc, char *argv[])
 	for (;;) {
 		int opt;
 
-		opt = getopt_long(argc, argv, "aubdsl::mq:Hk:A::U:vh",
+		opt = getopt_long(argc, argv, "au::bdsl::mq:Hk:A::U:vh",
 						main_options, NULL);
 		if (opt < 0)
 			break;
@@ -1250,6 +1250,8 @@ int main(int argc, char *argv[])
 			break;
 		case 'u':
 			num_devs = 1;
+			if (optarg)
+				device_path = optarg;
 			break;
 		case 'b':
 			start_dbus = true;
-- 
2.54.0


  parent reply	other threads:[~2026-05-13 16:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 16:17 [PATCH BlueZ v5 00/16] Functional/integration testing Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 01/16] emulator: btvirt: check pkt lengths, don't get stuck on malformed Pauli Virtanen
2026-05-13 18:23   ` Functional/integration testing bluez.test.bot
2026-05-13 16:17 ` [PATCH BlueZ v5 02/16] emulator: btvirt: allow specifying where server unix sockets are made Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 03/16] emulator: btvirt: support SCO data packets Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 04/16] emulator: btdev: clear more state on Reset Pauli Virtanen
2026-05-13 16:17 ` Pauli Virtanen [this message]
2026-05-13 16:17 ` [PATCH BlueZ v5 06/16] test-runner: Add -o/--option option Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 07/16] test-runner: allow source tree root for -k Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 08/16] test-runner: use virtio-serial for implementing -u device forwarding Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 09/16] doc: enable CONFIG_VIRTIO_CONSOLE in tester config Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 10/16] doc: enable KVM paravirtualization & clock support in tester kernel config Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 11/16] doc: add functional/integration testing documentation Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 12/16] test: add functional/integration testing framework Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 13/16] build: add functional testing target Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 14/16] test: functional: impose Python code formatting Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 15/16] test: functional: add some Agent1 interface tests Pauli Virtanen
2026-05-13 16:17 ` [PATCH BlueZ v5 16/16] test: functional: add basic obex file transfer tests Pauli Virtanen
2026-05-14 17:50 ` [PATCH BlueZ v5 00/16] Functional/integration testing patchwork-bot+bluetooth
2026-05-14 19:11   ` Luiz Augusto von Dentz

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=751a15b60c31fdacb76b73e92fceac72b523c8a2.1778688966.git.pav@iki.fi \
    --to=pav@iki.fi \
    --cc=linux-bluetooth@vger.kernel.org \
    /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