Received: by 2002:a05:6358:98a5:b0:11e:80f4:e92 with SMTP id q37csp11139903rwa; Sat, 13 May 2023 09:31:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7OLDy3o1B4/av3SWhfo1760VKdUZoABriMlBmBl9pA3J3du2Swt/AnlMQcaK2pt93x3+9c X-Received: by 2002:a05:6a00:24d1:b0:646:ec88:998c with SMTP id d17-20020a056a0024d100b00646ec88998cmr25441108pfv.15.1683995471951; Sat, 13 May 2023 09:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683995471; cv=none; d=google.com; s=arc-20160816; b=Fovfaij87ht8Q+D4yfX5qKCj4otwxi2kIgvuKedyxRmjMoHKzDyYnp3MP2bmVGnfOF LVtn1o+8RIW4mEjF4FPz/i8utFpHXkHlYYylrIS8Pp2oQ1w4fwFeXjI1BdFzjQ44HgAf PBOo713HBuZsf4f0VbGxM6OcriwXlelMB/jAovBYC331xOFIjmejy/9kvqckluRwc/eV r5iZpsApc3DvttVD2ZfT6Fm0ISQ8/iH9HHp4a5JH2ZE+vFZxd08QfsVPglot9nzfRNvJ FQe/PQ9oVwI43j8SFLalNP2P0Z9N9RfnCs8rQi7yJJzRlLEjWvcd8mF8xqQQv9lxUxEE XtUg== 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:cc:to:from; bh=+tTy1vgcQJu3UrjIzepPOQ/qiesZAB0DmWUBA1Rw12c=; b=EGM9t4voHRM4dZytrsx2cSGPuCLeyeSKUZes8e1/KCerKl1WVms6yO49tUuPz1nVNA ihFBT22R2bTsmpjmpEMPhGHZ3/HFxJP/bcwYx73fdLe4P19sVA5oaBZkLjHqL8DGpnKE OBIGhPyHVlJNWCKGyf8Sq7W6LCQWvuHN41IGoOpn01nSf6PCWG5j4ATqCghCuokN7kXp RWhd5DDGF6+gXbQJrXH43FDjPQL+SIiNzBnXwcVUJu7tcQtOcb8K3JI9D15BeRc6zbYF DHIenY/Yy0G0eAMUmqwLRFwnW3E58inSB8SBRK17ypNjblMoqw1grqZ3p/8qDjVfaz5q 7YCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020aa7972f000000b006361df3aa86si12655448pfg.88.2023.05.13.09.30.27; Sat, 13 May 2023 09:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229633AbjEMQIn (ORCPT + 99 others); Sat, 13 May 2023 12:08:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjEMQIm (ORCPT ); Sat, 13 May 2023 12:08:42 -0400 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A05B430F8 for ; Sat, 13 May 2023 09:08:40 -0700 (PDT) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 13193240108 for ; Sat, 13 May 2023 18:08:39 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QJVtG4sVkz6trs; Sat, 13 May 2023 18:08:38 +0200 (CEST) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v3 1/2] test-runner: revert udevd and audio support Date: Sat, 13 May 2023 16:08:36 +0000 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tests running inside the VM don't need access to sound cards running on the host. This reverts commit 91a48af52efb0751fab396b2b9026c9186b10b88 This reverts commit e20e7e0b05c7edb74255c9b092916ac5bb99c97f --- tools/test-runner.c | 108 ++------------------------------------------ 1 file changed, 3 insertions(+), 105 deletions(-) diff --git a/tools/test-runner.c b/tools/test-runner.c index 6660ea8de..cd65c4cf0 100644 --- a/tools/test-runner.c +++ b/tools/test-runner.c @@ -54,7 +54,6 @@ static bool start_monitor = false; static int num_devs = 0; static const char *qemu_binary = NULL; static const char *kernel_image = NULL; -static bool audio_support; static const char *qemu_table[] = { "qemu-system-x86_64", @@ -252,16 +251,14 @@ static void start_qemu(void) "acpi=off pci=noacpi noapic quiet ro init=%s " "TESTHOME=%s TESTDBUS=%u TESTDAEMON=%u " "TESTDBUSSESSION=%u XDG_RUNTIME_DIR=/run/user/0 " - "TESTAUDIO=%u " "TESTMONITOR=%u TESTEMULATOR=%u TESTDEVS=%d " "TESTAUTO=%u TESTARGS=\'%s\'", initcmd, cwd, start_dbus, start_daemon, - start_dbus_session, audio_support, + start_dbus_session, start_monitor, start_emulator, num_devs, run_auto, testargs); argv = alloca(sizeof(qemu_argv) + - (audio_support ? 4 : 0) + (sizeof(char *) * (4 + (num_devs * 4)))); memcpy(argv, qemu_argv, sizeof(qemu_argv)); @@ -274,24 +271,6 @@ static void start_qemu(void) } argv[0] = (char *) qemu_binary; - if (audio_support) { - char *xdg_runtime_dir, *audiodev; - - xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"); - if (!xdg_runtime_dir) { - fprintf(stderr, "XDG_RUNTIME_DIR not set\n"); - exit(1); - } - audiodev = alloca(40 + strlen(xdg_runtime_dir)); - sprintf(audiodev, "id=audio,driver=pa,server=%s/pulse/native", - xdg_runtime_dir); - - argv[pos++] = "-audiodev"; - argv[pos++] = audiodev; - argv[pos++] = "-device"; - argv[pos++] = "AC97,audiodev=audio"; - } - argv[pos++] = "-kernel"; argv[pos++] = (char *) kernel_image; argv[pos++] = "-append"; @@ -744,70 +723,13 @@ static pid_t start_btvirt(const char *home) return pid; } -static void trigger_udev(void) -{ - char *argv[3], *envp[1]; - pid_t pid; - - argv[0] = "/bin/udevadm"; - argv[1] = "trigger"; - argv[2] = NULL; - - envp[0] = NULL; - - printf("Triggering udev events\n"); - - pid = fork(); - if (pid < 0) { - perror("Failed to fork new process"); - return; - } - - if (pid == 0) { - execve(argv[0], argv, envp); - exit(EXIT_SUCCESS); - } - - printf("udev trigger process %d created\n", pid); -} - -static pid_t start_udevd(void) -{ - char *argv[2], *envp[1]; - pid_t pid; - - argv[0] = "/lib/systemd/systemd-udevd"; - argv[1] = NULL; - - envp[0] = NULL; - - printf("Starting udevd daemon\n"); - - pid = fork(); - if (pid < 0) { - perror("Failed to fork new process"); - return -1; - } - - if (pid == 0) { - execve(argv[0], argv, envp); - exit(EXIT_SUCCESS); - } - - printf("udevd daemon process %d created\n", pid); - - trigger_udev(); - - return pid; -} - static void run_command(char *cmdname, char *home) { char *argv[9], *envp[3]; int pos = 0, idx = 0; int serial_fd; pid_t pid, dbus_pid, daemon_pid, monitor_pid, emulator_pid, - dbus_session_pid, udevd_pid; + dbus_session_pid; if (!home) { perror("Invalid parameter: TESTHOME"); @@ -828,11 +750,6 @@ static void run_command(char *cmdname, char *home) } else serial_fd = -1; - if (audio_support) - udevd_pid = start_udevd(); - else - udevd_pid = -1; - if (start_dbus) { create_dbus_system_conf(); dbus_pid = start_dbus_daemon(false); @@ -961,11 +878,6 @@ start_next: monitor_pid = -1; } - if (corpse == udevd_pid) { - printf("udevd terminated\n"); - udevd_pid = -1; - } - if (corpse == pid) break; } @@ -990,9 +902,6 @@ start_next: if (monitor_pid > 0) kill(monitor_pid, SIGTERM); - if (udevd_pid > 0) - kill(udevd_pid, SIGTERM); - if (serial_fd >= 0) close(serial_fd); } @@ -1073,12 +982,6 @@ static void run_tests(void) start_emulator = true; } - ptr = strstr(cmdline, "TESTAUDIO=1"); - if (ptr) { - printf("Audio support requested\n"); - audio_support = true; - } - ptr = strstr(cmdline, "TESTHOME="); if (ptr) { home = ptr + 4; @@ -1105,7 +1008,6 @@ static void usage(void) "\t-u, --unix [path] Provide serial device\n" "\t-q, --qemu QEMU binary\n" "\t-k, --kernel Kernel image (bzImage)\n" - "\t-A, --audio Add audio support\n" "\t-h, --help Show help options\n"); } @@ -1120,7 +1022,6 @@ static const struct option main_options[] = { { "monitor", no_argument, NULL, 'm' }, { "qemu", required_argument, NULL, 'q' }, { "kernel", required_argument, NULL, 'k' }, - { "audio", no_argument, NULL, 'A' }, { "version", no_argument, NULL, 'v' }, { "help", no_argument, NULL, 'h' }, { } @@ -1140,7 +1041,7 @@ int main(int argc, char *argv[]) for (;;) { int opt; - opt = getopt_long(argc, argv, "aubdslmq:k:Avh", main_options, + opt = getopt_long(argc, argv, "aubdslmq:k:vh", main_options, NULL); if (opt < 0) break; @@ -1174,9 +1075,6 @@ int main(int argc, char *argv[]) case 'k': kernel_image = optarg; break; - case 'A': - audio_support = true; - break; case 'v': printf("%s\n", VERSION); return EXIT_SUCCESS; -- 2.40.1