From patchwork Wed Jul 12 21:22:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 701930 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B09AEB64DA for ; Wed, 12 Jul 2023 21:23:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232086AbjGLVW5 (ORCPT ); Wed, 12 Jul 2023 17:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjGLVW5 (ORCPT ); Wed, 12 Jul 2023 17:22:57 -0400 Received: from meesny.iki.fi (meesny.iki.fi [IPv6:2001:67c:2b0:1c1::201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD4611BF3 for ; Wed, 12 Jul 2023 14:22:54 -0700 (PDT) Received: from monolith.lan (91-152-120-101.elisa-laajakaista.fi [91.152.120.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id 4R1W164lS4zyWs; Thu, 13 Jul 2023 00:22:50 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1689196970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=8J1uWxzx/ELfQFx/YteDdaNQIKHhGHrBRX+CeNMLqUc=; b=D4cODmMauT6ULkWNeKf5GXd9+4zwVtK8oDqgS3qGO5SEzLMN1/nVoAVlcHP0vIMz5knMTR HryaSEMeHLRv4sDXMzDdRxEHAgDokmNV9mktkjExnzk99E8FqLVlTqeSitj8YblNd2qR2k 2jcJiCR5csmR59I2IHlbCMVbT1F3l2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1689196970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=8J1uWxzx/ELfQFx/YteDdaNQIKHhGHrBRX+CeNMLqUc=; b=w8447uBSWRl/d/IpDmcst4WT9e3Qs3oJAcqFKTgH45ZK6wJkjWi57VChj7OdjVY0u+W/xA Srhb2jlk0K65GXpNCwDdAUUIzWme7ZZtoQlbOTWhmLOpEX1ewI8RR+U/VqvVvnglu3p6RS oS0XT4ALnlV3xvXvJcY9vEf/3i44nls= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1689196970; a=rsa-sha256; cv=none; b=yCHSLZTtBle/+sUSdnMt1i+NIWCmwBooi4q80g9+q419qxcw4DX35DPj3pBGzHCsfkG22A 47ZcqTqbn7jWONmbdQiqazaAykvGT3rWLRvWR1EV5sNJLC5Of6Y5dEwDEyuGOrd2yeqTUR aF3b87JefExlTvsPalrOWf8l9Qz9Jcw= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v2 1/2] test-runner: set non-quiet printk before running tests Date: Thu, 13 Jul 2023 00:22:48 +0300 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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[] = { From patchwork Wed Jul 12 21:22:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 704155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2E09EB64DA for ; Wed, 12 Jul 2023 21:22:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232271AbjGLVWz (ORCPT ); Wed, 12 Jul 2023 17:22:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbjGLVWy (ORCPT ); Wed, 12 Jul 2023 17:22:54 -0400 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 929441BF3 for ; Wed, 12 Jul 2023 14:22:53 -0700 (PDT) Received: from monolith.lan (91-152-120-101.elisa-laajakaista.fi [91.152.120.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id 4R1W1731qWzyfb; Thu, 13 Jul 2023 00:22:51 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1689196971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5PH9FTE03bzhrvZ8/lmoxEfuHEMIQvOH29LebjZueS8=; b=rjihywSonP9bmdHvmFAp1ZzoP0MnHArq56NNB3BR4DtxaHoSIBItAypNqH8z3gm3iui3Ur hIzvupnFH/5ugg6WBH3GFStbRZmKyO1Sx/7Q/3ZxuUvI+lBBs8lLzuTantZaExcfhKi15W JHmPQwrl5fq9UqiihbFllca3twdFvjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1689196971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5PH9FTE03bzhrvZ8/lmoxEfuHEMIQvOH29LebjZueS8=; b=CY8w48E+tqypv1g6b72zr4l9iNvfGk/y7XDs/W1nxCIjdKiw27j3qaROoQi71UlhTDkF9F XVjlRAFuHnt6cDK28Z+vnjeIENIXkuAy/81vN6yFQipMLfrzaYMeobkkYzKs4ok9KHdOrM +FUwFVTKmHElJj5hUJLWIkUaYrHvO6Q= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1689196971; a=rsa-sha256; cv=none; b=wnqcAUyQEUMfzSviPzrjkx4HenMz/hX+ovlpwqSpmFWwjGRPSoPBFSbzU45DR6aRc7ENQx D2Ny0IpYCP4G70H6DIVZHK3CZkpFXojQkocW6+Ys1XUUidqnmjpGpiq81pjZHEPqmc2k4i ULhvSbyseU+hyZGbBu/ZG/eedm5uMJw= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v2 2/2] test-runner: fix behavior when no audio server Date: Thu, 13 Jul 2023 00:22:49 +0300 Message-ID: <696a65e1c6790cd194c863c5b4128df7aa533e0f.1689196901.git.pav@iki.fi> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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); }