Skip to contentSkip to conversation

tools/test-runner: Fix TESTHOME parsing for short paths

PATCH In review Zijun Hu 2 participants 2 messages Nov 19 Bluetooth drivers

lore
Share & tools
lore

Zijun Hu

author
#0 lore raw

PATCH 1/1 tools/test-runner: Fix TESTHOME parsing for short paths

TESTHOME is parsed wrongly if the HOME path is shorter than 4 characters, e.g. "TESTHOME=/ab TESTDBUS=1" gives "/ab TESTDBUS=1".

Fix by searching from @ptr + 9, the HOME path start, instead of @home + 9.

Fixes e622e623de13 ("build: Add test-runner utility for virtual machine execution")
Assisted-by Claude:claude-opus-5-5
---
 tools/test-runner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/test-runner.c +1 -1
index 0bca31a46351..6b8d0522fa7a 100644
@@ -2167,17 +2167,17 @@ static void run_tests(void)
 			audio_server = strndup(start, end - start);
 			printf("Audio server %s requested\n", audio_server);
 		}
 	}
 
 	ptr = strstr(cmdline, "TESTHOME=");
 	if (ptr) {
 		home = ptr + 4;
-		ptr = strpbrk(home + 9, " \r\n");
+		ptr = strpbrk(ptr + 9, " \r\n");
 		if (ptr)
 			*ptr = '\0';
 	}
 
 	run_command(cmds, home);
 }
 
 static void usage(void)

---
base-commit: 1adfe662efeff12997df9ddd0960dbd0de9c8ea7
change-id: 20261119-fix_test_runner-5773413a0ef9

Best regards,

Signature · 1 line
Zijun Hu <[email protected]>
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1216093/

---Test result---

Test Summary:

CheckPatch                    PASS      0.47 seconds
GitLint                       FAIL      0.33 seconds
BuildEll                      PASS      16.29 seconds
BluezMake                     PASS      234.11 seconds
CheckSmatch                   PASS      238.04 seconds
bluezmakeextell               PASS      76.95 seconds
TestFunctional                PASS      1030.11 seconds
IncrementalBuild              PASS      238.70 seconds
ScanBuild                     WARNING   856.96 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[bluez] tools/test-runner: Fix TESTHOME parsing for short paths

20: B2 Line has trailing whitespace: "-- "
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
tools/btgatt-server.c:1204:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores] tools/btgatt-client.c:1822:2: warning: Value stored to 'argv' is never read [deadcode.DeadStores]

 1204 |         argv -= optind;
 1822 |         argv += optind;
      |         ^       ~~~~~~
      |         ^       ~~~~~~

1 warning generated.

https://github.com/bluez/bluez/pull/2851

---
Regards,
Linux Bluetooth