Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp63328lfe; Fri, 15 Apr 2022 19:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB3lrjR+FkfzV1iC5xeflHquV+2y905WGa/Nq7orutuRtg9B0GFII7F1RMS2c9l4jyxq5k X-Received: by 2002:a17:902:f686:b0:158:8178:b2af with SMTP id l6-20020a170902f68600b001588178b2afmr1805755plg.4.1650076771783; Fri, 15 Apr 2022 19:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650076771; cv=none; d=google.com; s=arc-20160816; b=auTmwa4JCGn5PIgHPhtKWq9ojmqjyNdnfr0sO+OATXdyIMoGmmTkDe5sW0bWwe88n2 T4iIl/ecmjS+9ozsMdgswb6AtVFwgEbG663bdmKswDkOppasXVLHh2nyagDxS/zE/Mt6 OAjMg8QqJS8iTMkeG6rT2Evp/1eQ+OWnp1u55ar+mOCh/hJBxDP2gPfKht7BTb6V4g2H rMIT2hykXvc6JFhpIUUPcDlJpYLCdU0PvwXHb8DhbldSXEPzCSfwxdORqkndUtVjv61C AoCp1maUc5tYYC9QW9QrdaK6mVB3/NAa8WHFEbcuydtghESrsUhIG4AZngH5+sWIfi2w YwxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=sz4IHHoDtXFM8pbU3ctHD/oh3X3RJRHz3VjvrVzkxpw=; b=oPV2HHGi2+kx6R//AQPlPD3VIbfdlAn0Zs+Vm75tLDRLMoour/hdksVQBHzs6deUBd Q73pTy6RCT/ZLhZjubEzUTLankXqR6NZBOQjvVXorJeTVwNNuW4HwxxEXaQcPpSAA8nk 1xqpJtmtifkyLgrEk8R7/mKE6ORG3OzXKYg027/YkQ52xLAXzpfd/S55MpG8xhL/j02D HMNnwojsg51zQTozcHTC53fNbg3477YANeZ+kPNQ7NuX+sNd+4MT/Jk3UqgpOpY6vUoE L5ePWAqXnHPO7O0/oCH4t65uIttQvyhfL8//q1YIKnvhLGr5nCiP6u0K7YdwQ89LUZXo wsxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jDmwCDZK; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x19-20020a170902e05300b0015489a6595dsi2476458plx.334.2022.04.15.19.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jDmwCDZK; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EFAB5197F88; Fri, 15 Apr 2022 18:53:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229503AbiDPAV1 (ORCPT + 99 others); Fri, 15 Apr 2022 20:21:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbiDPAV0 (ORCPT ); Fri, 15 Apr 2022 20:21:26 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B20FD398E for ; Fri, 15 Apr 2022 17:18:55 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id g12-20020a17090a640c00b001cb59d7a57cso8404885pjj.1 for ; Fri, 15 Apr 2022 17:18:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=sz4IHHoDtXFM8pbU3ctHD/oh3X3RJRHz3VjvrVzkxpw=; b=jDmwCDZKDhDxOF5gBIatQl47m64O25qn1QHET0w2uEQUR0ysVh+guXZVN1U3u6HFWc TXo+yedc5CRpQsVWT9E4pagF5xqcQnIw6f3u4u84T1G+kjvlXa1igmGSrEvcVGnCnZWr fjPA0SuQpTnLdvLnEnO5CC2VHkyP7nA87m6LM84qd26KR6UH2uOG2qeOKV6Gf//38c7y mA6EYlREPNpgi5oJegCQOi54DYxWQGTERygYCUMxXr1E1g9epgTZAupjUcdOcQhdTthv AwgkYSnQD/GuqflW0OanYbOgZ1LXW27XQmwTSODOsGnrXmwGZODWLZjSwzH0l/CKod7s xanQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=sz4IHHoDtXFM8pbU3ctHD/oh3X3RJRHz3VjvrVzkxpw=; b=gZBE87xIoMwnLzEwFF7oraJKEFqKGXfVZMTjlrpnSIA5xGyJDnP6bB2/jq4tpjSEuq hrx7W823Ayt6HHcmbZDTiDn6WJ6dCqY/grLXV0QZOuQ14fYGh0gJ3rXLUISy9ckZNjGL Cy30AFgc25n97nP5kqM7kCnLiRIYHTNpnbHPrkQ1pbQ0RqB6nO+LQzI3HcofdXXj2W1t vHzMac58hpirZbIHWt4er17JsmU6OGhw+DXNQaVqOcFxBocCBvKmeSR1IwFoSNueVken 1zl8wDFgtWN7BXt6pBPbGghlEiESahwu3IAWRcWS8rieMG2wHVQhd2CvYwDh6DzwoHvv 6Dtw== X-Gm-Message-State: AOAM533mRCpdNmqt2KxCanQBhwHwqA4Uw94Oon5bl3AVsr2LcgWU4X8f 7Qrzk02jwEP17TaiQvsvpjcyP0nGEaY= X-Received: by 2002:a17:90b:1b44:b0:1cd:49b8:42b8 with SMTP id nv4-20020a17090b1b4400b001cd49b842b8mr1439827pjb.102.1650068334356; Fri, 15 Apr 2022 17:18:54 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id z16-20020a056a00241000b004f3a647ae89sm3851970pfh.174.2022.04.15.17.18.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:18:53 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] test-runner: Add dedicated option to start D-Bus Date: Fri, 15 Apr 2022 17:18:53 -0700 Message-Id: <20220416001853.1240822-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds a dedicated option to start D-Bus alone which can be useful when testing the bluetoothd with the likes of valgrind. --- tools/test-runner.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index fd7b3b1b7..1f1a8c36f 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -47,6 +47,7 @@ static int test_argc; static bool run_auto = false; static bool start_dbus = false; +static bool start_daemon = false; static bool start_emulator = false; static bool start_monitor = false; static int num_devs = 0; @@ -249,11 +250,12 @@ static void start_qemu(void) "rootflags=trans=virtio,version=9p2000.L " "acpi=off pci=noacpi noapic quiet ro init=%s " "bluetooth.enable_ecred=1" - "TESTHOME=%s TESTDBUS=%u TESTMONITOR=%u " - "TESTEMULATOR=%u TESTDEVS=%d TESTAUTO=%u " - "TESTARGS=\'%s\'", - initcmd, cwd, start_dbus, start_monitor, - start_emulator, num_devs, run_auto, testargs); + "TESTHOME=%s TESTDBUS=%u TESTDAEMON=%u " + "TESTMONITOR=%u TESTEMULATOR=%u TESTDEVS=%d " + "TESTAUTO=%u TESTARGS=\'%s\'", + initcmd, cwd, start_dbus, start_daemon, + start_monitor, start_emulator, num_devs, + run_auto, testargs); argv = alloca(sizeof(qemu_argv) + (sizeof(char *) * (4 + (num_devs * 4)))); @@ -683,11 +685,13 @@ static void run_command(char *cmdname, char *home) if (start_dbus) { create_dbus_system_conf(); dbus_pid = start_dbus_daemon(); - daemon_pid = start_bluetooth_daemon(home); - } else { + } else dbus_pid = -1; + + if (start_daemon) + daemon_pid = start_bluetooth_daemon(home); + else daemon_pid = -1; - } if (start_monitor) monitor_pid = start_btmon(home); @@ -874,6 +878,12 @@ static void run_tests(void) start_dbus = true; } + ptr = strstr(cmdline, "TESTDAEMON=1"); + if (ptr) { + printf("bluetoothd requested\n"); + start_daemon = true; + } + ptr = strstr(cmdline, "TESTMONITOR=1"); if (ptr) { printf("Monitor requested\n"); @@ -904,7 +914,8 @@ static void usage(void) printf("\ttest-runner [options] [--] [args]\n"); printf("Options:\n" "\t-a, --auto Find tests and run them\n" - "\t-d, --dbus Start D-Bus daemon\n" + "\t-b, --dbus Start D-Bus daemon\n" + "\t-d, --daemon Start bluetoothd\n" "\t-m, --monitor Start btmon\n" "\t-l, --emulator Start btvirt\n" "\t-u, --unix [path] Provide serial device\n" @@ -916,8 +927,9 @@ static void usage(void) static const struct option main_options[] = { { "all", no_argument, NULL, 'a' }, { "auto", no_argument, NULL, 'a' }, + { "dbus", no_argument, NULL, 'b' }, { "unix", no_argument, NULL, 'u' }, - { "dbus", no_argument, NULL, 'd' }, + { "daemon", no_argument, NULL, 'd' }, { "emulator", no_argument, NULL, 'l' }, { "monitor", no_argument, NULL, 'm' }, { "qemu", required_argument, NULL, 'q' }, @@ -941,7 +953,7 @@ int main(int argc, char *argv[]) for (;;) { int opt; - opt = getopt_long(argc, argv, "audlmq:k:vh", main_options, + opt = getopt_long(argc, argv, "aubdlmq:k:vh", main_options, NULL); if (opt < 0) break; @@ -953,8 +965,12 @@ int main(int argc, char *argv[]) case 'u': num_devs = 1; break; + case 'b': + start_dbus = true; + break; case 'd': start_dbus = true; + start_daemon = true; break; case 'l': start_emulator = true; -- 2.35.1