diff mbox series

[BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests

Message ID e521a8d35e8baff45db1fdf8a26725bdc8d595ee.1689196901.git.pav@iki.fi (mailing list archive)
State Accepted
Commit 7cea6b964119747925312a7a00ff217021d6c4a1
Headers show
Series [BlueZ,v2,1/2] test-runner: set non-quiet printk before running tests | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint fail 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: " "
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild warning ScanBuild: 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.

Commit Message

Pauli Virtanen July 12, 2023, 9:22 p.m. UTC
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(+)

Comments

bluez.test.bot@gmail.com July 12, 2023, 10:44 p.m. UTC | #1
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
patchwork-bot+bluetooth@kernel.org July 13, 2023, 7:26 p.m. UTC | #2
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!
diff mbox series

Patch

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[] = {