From patchwork Wed Jul 12 16:47:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 704158 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 ED7CAEB64DA for ; Wed, 12 Jul 2023 16:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233028AbjGLQsM (ORCPT ); Wed, 12 Jul 2023 12:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232812AbjGLQsL (ORCPT ); Wed, 12 Jul 2023 12:48:11 -0400 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAA5710C7 for ; Wed, 12 Jul 2023 09:48:06 -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 lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4R1Nw134yvz49Q76; Wed, 12 Jul 2023 19:48:01 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1689180483; 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=LI7UrAM162kd+BkAM3yr4UIRryDtwBu859tgXGcFFtw=; b=lqt7sU1AL3OxNF9n9qNSIPggtZMd8pOREJX2y8ZB/MUegqWUL219+qbPI5p7JDT6Wd7xgZ D8q5aGVW+k+t668FR6U/duDnyuAPqAUezQykJaJBagBY8w93skiE9C1pegv/f/46XxuM1P IiWay+opKXYyODHywIzBQM4Mp3PcDwvjGexkx0V6kJd44c5AAt8+F29E/DO5UJFxCDL5/9 bHQQCsyH3wQqFT6k+9iIykCi+o21m0EiRPPy65pnsOS8qcwQcGXFY9jqtfsBJ6FMD9voLf cxM75PA2/7yItGZaNUG4C3bNqZBdWalxK3iWgcRP9NwGprxuyf8/tbmxUzOw8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1689180483; 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=LI7UrAM162kd+BkAM3yr4UIRryDtwBu859tgXGcFFtw=; b=mDgFFVGY7ExTO/KQ/HDXinH8f6yHhtWLhay5Y413NXJHTLxp3pl8LZDW63KdTuBEhdbwFM vKgRv+FKD2RkMiPg06ECk4yUYUNVFL6AedvER0DS4qDANX132hZFzfQuOglgnwTsMdbwjR FI5nZTZG4hIIOtYh/It2b5hbaJJb6MUBnE0DuHIq4eP0enxtz8i9eBKQhWyncpGy2YKJ8f AAHr6CCSf6zLBawzenC0KPYamzyVikh38QR9xA2Da94gfMOPLE4gfWq5VSQBtKnHZFfq+G WktCtcY1KTN09L1B0rQ/miUGfdIrG12xcYEzeAec51IrtqEiIYhn6z+Wr9j9XA== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1689180483; a=rsa-sha256; cv=none; b=PFWRE6SP73DtBWYx7BqIRXxk6AqYT8naXXseSB437fJkwHtBORJRZRGMWYL6AzU+be+mQ+ 7QlX0MK8UqIzlwrJ++rzrdIhsuODD+0bIoz8w3ViFsghhGs9RwCjbWetQyMTwp8iaznBmp Yptth0vj5bYlCWA4tfZ+GIyK89SHTZdiz/JRfD5MzFjcchfvq3JVMsWygyBf08Ws6HOWys f//TucV/x0dgtvS02LzlyIohq25CYGQDDwlfV1OA1pmKUC9KMCwarT6BdH9NnuJCw/s+kf 9un2zWfpTkajk12wZZvwZ7jjBSgnCU2x7jyoCyHE4+XjFn7mT/dgSH9rez9hJg== From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 1/2] test-runner: set non-quiet printk before running tests Date: Wed, 12 Jul 2023 19:47:59 +0300 Message-ID: <859a1c176765dbb9ea394dde387b8ed072365ca8.1689180344.git.pav@iki.fi> 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/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[] = { From patchwork Wed Jul 12 16:48:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 701934 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 8F094C0015E for ; Wed, 12 Jul 2023 16:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233076AbjGLQsN (ORCPT ); Wed, 12 Jul 2023 12:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231856AbjGLQsL (ORCPT ); Wed, 12 Jul 2023 12:48:11 -0400 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA881136 for ; Wed, 12 Jul 2023 09:48:06 -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 lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4R1Nw41rLZz49Q9m; Wed, 12 Jul 2023 19:48:04 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1689180484; 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=Nx8t9C/fg60pCaQqnLs6ZoflL0zQC+OCnWhyH0kALxs=; b=bToyYWv/Wg8Ov/YbHKiKVnHZEKVUdzZc/GwhR+LDbfgV3Kua6WMI+dZFas2PdD2C9kpVrh h9pG1KreKi3Gl738qgZmLq+Cqs7EHy4ScQNCFo1w8wz9qlFT/EGTkJsf2kSlwwakzyYXGp 2OBzj0wts1v5k/fzUaZVnhJZB9e/WkcWre+BUDfVcG0io1YwEW7XoNz+f5t3qkBeprlTTL Q7QNuIlqxHkGhzrbwxRkASBr6PUS+WMeDG25ozcArUj90fQ57YYfBpHWHE47fQK/Pdxgy5 WJa61whzKgCkkA0PLRBS+xwsHPOljQAUDzNWpDHMg6PnOCccEBCsdvZFxlmLUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1689180484; 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=Nx8t9C/fg60pCaQqnLs6ZoflL0zQC+OCnWhyH0kALxs=; b=Aw7ow37YGndkKr6ljlGW8vB7lMtyIF0L0FnLizcszSlxInqHmh2zWtvaTeLEw6hTvneRNs S7oOsBtKtAWSK3ddkmpjqyyTzr/U285i1N/LdYeUvuVBGqjRTkZ2aHt4wuiAyqWmYbGjgY beq4TS/TyuMvgcPRxdVByxpJK2dYjMoRCN093ZLuXlVJ6s0IjcKEj4zPyFVL8nY3MZme8q DFRUheIL4VH/Cze8cnjfqOYBuJk5gQj+49YmN4N/PB5BaVBgmhntEyh/HiNk1eyfvJ96j0 8/O07PxWzSQqzojs4ZIVQefRk7nPIMMaeIPU2COIKtcFY24gpYHGIwCxa0ELFw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1689180484; a=rsa-sha256; cv=none; b=Dmk+5g/XsbhehGm1YTaCUrlrZ2EjVuQH7ToiMowq688IyoEiM905tYwrPuBOgxPtXPEfGU 0/iSFk4xMsBPBoBO3K/UPRwgOBhaLaN56C0aAXIzITAueUcwT9IjWgdfC0b0tnRa0O6id1 NepcOiO5pzdzo+zlsitEOsAz7NkDkLO6NnCZjIpYbhdZgmLBZNrUbtN1HmMAl1VRdNnaXG CNpJBWImNKVX1tUZme0iTw6+y390d9MKurHjGUUGA43Zn5PrX7V1IVGztBdjGP7mkJurXQ ueM7IjxzZcQNbujDwD4SxPjPQ3tvVJEfylRWPuw29mvRDzyDeujszTHbP1zp/w== From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 2/2] test-runner: fix behavior when no audio server Date: Wed, 12 Jul 2023 19:48:00 +0300 Message-ID: <957b9b9c5c06960a6632ec0a90885388f18db4bf.1689180344.git.pav@iki.fi> X-Mailer: git-send-email 2.41.0 In-Reply-To: <859a1c176765dbb9ea394dde387b8ed072365ca8.1689180344.git.pav@iki.fi> References: <859a1c176765dbb9ea394dde387b8ed072365ca8.1689180344.git.pav@iki.fi> 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 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); }