diff mbox series

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

Message ID 859a1c176765dbb9ea394dde387b8ed072365ca8.1689180344.git.pav@iki.fi (mailing list archive)
State Superseded
Headers show
Series [BlueZ,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 success Gitlint PASS
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:941: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, 4:47 p.m. UTC
It is useful to see WARN_ON/bt_dev_err messages when running the tests.
Enable non-quiet printk levels after boot, so that it is on by default
and doesn't need to be handled in local test scripts.
---

Notes:
    It could be useful to also check for BUG/WARNING in the bluez test bot.

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

Comments

Luiz Augusto von Dentz July 12, 2023, 5:57 p.m. UTC | #1
Hi Pauli,

On Wed, Jul 12, 2023 at 10:00 AM Pauli Virtanen <pav@iki.fi> wrote:
>
> It is useful to see WARN_ON/bt_dev_err messages when running the tests.
> Enable non-quiet printk levels after boot, so that it is on by default
> and doesn't need to be handled in local test scripts.
> ---
>
> Notes:
>     It could be useful to also check for BUG/WARNING in the bluez test bot.
>
>  tools/test-runner.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/tools/test-runner.c b/tools/test-runner.c
> index d74bb1087..288901a61 100644
> --- a/tools/test-runner.c
> +++ b/tools/test-runner.c
> @@ -136,6 +136,20 @@ static const char *config_table[] = {
>         NULL
>  };
>
> +static void enable_printk(void)
> +{
> +       FILE *f;
> +
> +       /* Set non-quiet printk level */
> +       f = fopen("/proc/sys/kernel/printk", "w");
> +       if (!f) {
> +               perror("Failed to set printk");
> +               return;
> +       }
> +       fprintf(f, "7 4 1 7");

Can you have a comment on what this 7 4 1 7 is for?

> +       fclose(f);
> +}
> +
>  static void prepare_sandbox(void)
>  {
>         int i;
> @@ -181,6 +195,8 @@ static void prepare_sandbox(void)
>                                 "mode=0755") < 0)
>                         perror("Failed to create filesystem");
>         }
> +
> +       enable_printk();
>  }
>
>  static char *const qemu_argv[] = {
> --
> 2.41.0
>
bluez.test.bot@gmail.com July 12, 2023, 6:21 p.m. UTC | #2
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=764973

---Test result---

Test Summary:
CheckPatch                    PASS      0.97 seconds
GitLint                       PASS      0.65 seconds
BuildEll                      PASS      26.62 seconds
BluezMake                     PASS      771.59 seconds
MakeCheck                     PASS      11.94 seconds
MakeDistcheck                 PASS      155.03 seconds
CheckValgrind                 PASS      250.24 seconds
CheckSmatch                   PASS      335.90 seconds
bluezmakeextell               PASS      101.43 seconds
IncrementalBuild              PASS      1295.86 seconds
ScanBuild                     WARNING   1024.62 seconds

Details
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
tools/test-runner.c:941: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
diff mbox series

Patch

diff --git a/tools/test-runner.c b/tools/test-runner.c
index d74bb1087..288901a61 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -136,6 +136,20 @@  static const char *config_table[] = {
 	NULL
 };
 
+static void enable_printk(void)
+{
+	FILE *f;
+
+	/* Set non-quiet printk level */
+	f = fopen("/proc/sys/kernel/printk", "w");
+	if (!f) {
+		perror("Failed to set printk");
+		return;
+	}
+	fprintf(f, "7 4 1 7");
+	fclose(f);
+}
+
 static void prepare_sandbox(void)
 {
 	int i;
@@ -181,6 +195,8 @@  static void prepare_sandbox(void)
 				"mode=0755") < 0)
 			perror("Failed to create filesystem");
 	}
+
+	enable_printk();
 }
 
 static char *const qemu_argv[] = {