* [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests
@ 2023-07-12 16:47 Pauli Virtanen
2023-07-12 16:48 ` [PATCH BlueZ 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 16:47 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Pauli Virtanen
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");
+ 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH BlueZ 2/2] test-runner: fix behavior when no audio server
2023-07-12 16:47 [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
@ 2023-07-12 16:48 ` Pauli Virtanen
2023-07-12 17:57 ` [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Luiz Augusto von Dentz
2023-07-12 18:21 ` [BlueZ,1/2] " bluez.test.bot
2 siblings, 0 replies; 4+ messages in thread
From: Pauli Virtanen @ 2023-07-12 16:48 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 288901a61..cfb97907f 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -273,7 +273,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))));
@@ -1128,7 +1129,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: [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests
2023-07-12 16:47 [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
2023-07-12 16:48 ` [PATCH BlueZ 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
@ 2023-07-12 17:57 ` Luiz Augusto von Dentz
2023-07-12 18:21 ` [BlueZ,1/2] " bluez.test.bot
2 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2023-07-12 17:57 UTC (permalink / raw)
To: Pauli Virtanen; +Cc: linux-bluetooth
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
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [BlueZ,1/2] test-runner: set non-quiet printk before running tests
2023-07-12 16:47 [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
2023-07-12 16:48 ` [PATCH BlueZ 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
2023-07-12 17:57 ` [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Luiz Augusto von Dentz
@ 2023-07-12 18:21 ` bluez.test.bot
2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2023-07-12 18:21 UTC (permalink / raw)
To: linux-bluetooth, pav
[-- Attachment #1: Type: text/plain, Size: 1290 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=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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-07-12 18:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 16:47 [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Pauli Virtanen
2023-07-12 16:48 ` [PATCH BlueZ 2/2] test-runner: fix behavior when no audio server Pauli Virtanen
2023-07-12 17:57 ` [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Luiz Augusto von Dentz
2023-07-12 18:21 ` [BlueZ,1/2] " bluez.test.bot
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).