linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests
@ 2023-07-12 21:22 Pauli Virtanen
  2023-07-12 21:22 ` [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pauli Virtanen @ 2023-07-12 21:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

It is useful to see WARN_ON etc. messages when running the tests.

The 'quiet' in cmdline suppresses levels >= WARN, so re-enable them
explicitly after boot, so that it is on by default and doesn't need to
be handled in local test scripts.
---

Notes:
    v2: add comment. Suppress level>=INFO, to hide "Bluetooth: MGMT ver" etc.
    
    It could be useful to also check for BUG/WARNING in the bluez test bot.

 tools/test-runner.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/test-runner.c b/tools/test-runner.c
index d74bb1087..119e1cfbc 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -136,6 +136,24 @@ static const char *config_table[] = {
 	NULL
 };
 
+static void enable_printk(void)
+{
+	FILE *f;
+
+	f = fopen("/proc/sys/kernel/printk", "w");
+	if (!f) {
+		perror("Failed to set printk");
+		return;
+	}
+
+	/* Restore printk loglevel, undoing 'quiet' in cmdline (suppress early
+	 * on-boot messages), to show WARN_ON etc. Suppress level>=6(INFO), set
+	 * default_msg:4(WARN) & min:1, default:7. See man 2 syslog.
+	 */
+	fprintf(f, "6 4 1 7");
+	fclose(f);
+}
+
 static void prepare_sandbox(void)
 {
 	int i;
@@ -181,6 +199,8 @@ static void prepare_sandbox(void)
 				"mode=0755") < 0)
 			perror("Failed to create filesystem");
 	}
+
+	enable_printk();
 }
 
 static char *const qemu_argv[] = {
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server
  2023-07-12 21:22 [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
@ 2023-07-12 21:22 ` Pauli Virtanen
  2023-07-12 22:44 ` [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests bluez.test.bot
  2023-07-13 19:26 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Pauli Virtanen @ 2023-07-12 21:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

If no audio server, don't pass NULL to printf and parse TESTAUDIO
correctly.
---
 tools/test-runner.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 119e1cfbc..243eab468 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -277,7 +277,8 @@ static void start_qemu(void)
 				initcmd, cwd, start_dbus, start_daemon,
 				start_dbus_session,
 				start_monitor, start_emulator, num_devs,
-				run_auto, audio_server, testargs);
+				run_auto, audio_server ? audio_server : "",
+				testargs);
 
 	argv = alloca(sizeof(qemu_argv) +
 				(sizeof(char *) * (4 + (num_devs * 4))));
@@ -1132,7 +1133,7 @@ static void run_tests(void)
 		const char *start = ptr + 11;
 		const char *end = strchr(start, '\'');
 
-		if (end) {
+		if (end && end != start) {
 			audio_server = strndup(start, end - start);
 			printf("Audio server %s requested\n", audio_server);
 		}
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests
  2023-07-12 21:22 [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
  2023-07-12 21:22 ` [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
@ 2023-07-12 22:44 ` bluez.test.bot
  2023-07-13 19:26 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2023-07-12 22:44 UTC (permalink / raw)
  To: linux-bluetooth, pav

[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]

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/project/bluetooth/list/?series=765028

---Test result---

Test Summary:
CheckPatch                    PASS      0.76 seconds
GitLint                       FAIL      0.73 seconds
BuildEll                      PASS      26.50 seconds
BluezMake                     PASS      782.61 seconds
MakeCheck                     PASS      11.22 seconds
MakeDistcheck                 PASS      153.70 seconds
CheckValgrind                 PASS      247.48 seconds
CheckSmatch                   PASS      334.50 seconds
bluezmakeextell               PASS      101.55 seconds
IncrementalBuild              PASS      1297.41 seconds
ScanBuild                     WARNING   1008.97 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
12: B2 Line has trailing whitespace: "    "
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
tools/test-runner.c:945:2: warning: 2nd function call argument is an uninitialized value
        printf("Running command %s\n", cmdname ? cmdname : argv[0]);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests
  2023-07-12 21:22 [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
  2023-07-12 21:22 ` [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
  2023-07-12 22:44 ` [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests bluez.test.bot
@ 2023-07-13 19:26 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2023-07-13 19:26 UTC (permalink / raw)
  To: Pauli Virtanen; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 13 Jul 2023 00:22:48 +0300 you wrote:
> It is useful to see WARN_ON etc. messages when running the tests.
> 
> The 'quiet' in cmdline suppresses levels >= WARN, so re-enable them
> explicitly after boot, so that it is on by default and doesn't need to
> be handled in local test scripts.
> ---
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7cea6b964119
  - [BlueZ,v2,2/2] test-runner: fix behavior when no audio server
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9aff3f494142

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-13 19:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 21:22 [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
2023-07-12 21:22 ` [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
2023-07-12 22:44 ` [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests bluez.test.bot
2023-07-13 19:26 ` [PATCH BlueZ v2 1/2] " patchwork-bot+bluetooth

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 NNTP newsgroup(s).