Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp73565pxh; Thu, 7 Apr 2022 14:22:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+1YWG4659xwZ/ELsOXsVxZL+kOVjLWlgN3dUfq9SdHpHP7qFSt6O5gZL4LyYmuklDWBMh X-Received: by 2002:a17:90a:4217:b0:1c7:c203:b4f3 with SMTP id o23-20020a17090a421700b001c7c203b4f3mr18063844pjg.177.1649366559264; Thu, 07 Apr 2022 14:22:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649366559; cv=none; d=google.com; s=arc-20160816; b=Xk21H7CmIK7pDXUxCRZF1UjLNLK8LQJ56GUvStC8BXDFAHxOi4O/vb0h6BPUPw8/XT stUDSACpSS0z4uciVg/ZuGkI1kdMky/URxP6Am2tavszG5tbi88FY1w/Uw0pqSNc+wXU AIioozC0j17tRsm01EC+QPb/lpB2QdWC39XJzU9CELTue99juTf+q4fiDyeiycda5GIj 3e0bdUsxX/BAS+IKN7cnXxSFk7JFuR4ljlFVziQw09C5GVCeCRGhyycgRua15oBonD88 A+gdXWmsBcxp+sTPmyM47mq+9nYDDEuiNk51nE7IfiaaxjQintzjV0fmJnBu9nw7RmYq DQRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=U0Hnhz6FkWikLEjV/D9C4mwc2iqVMG/fIPbXB9OU5q4=; b=KbcfZlYh0ooqfsUSk572yvWgwSLnCnb7Cf1whovnU/rFiMNUtQv97I+jKZceG6jpF7 oeAQs9MeVolTpK6iJhKLxroofQpouy4lXtUTlpj4YlnOREXUVLw5Q7gjBMd9Od1fHXKM hYUjCJjJuFv13aiTqG5fjVlEDxyMBZQqlfkr4yd2h1mxXZDAlyxCH99U8JvUGhW6Lsqd whP3eq6bXurNWKruWc0lPeAeYb2ZEVpNEVUwfrjdqI9dw/2wacET5qF9mfT6dM3ef6/Z JCX/v9bXkH8PAsAM8LkNiYy33AX0aDSvx12NMasAIp2oNHqMHwurBOR28pucVLbgiV0p KD+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=o07BrSOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id me16-20020a17090b17d000b001bd14e03063si3394646pjb.59.2022.04.07.14.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 14:22:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@google.com header.s=20210112 header.b=o07BrSOg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7D4DB487311; Thu, 7 Apr 2022 13:13:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229480AbiDGTtC (ORCPT + 99 others); Thu, 7 Apr 2022 15:49:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiDGTtB (ORCPT ); Thu, 7 Apr 2022 15:49:01 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AF0036B032 for ; Thu, 7 Apr 2022 12:43:54 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-2eb689106e3so56325887b3.16 for ; Thu, 07 Apr 2022 12:43:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=U0Hnhz6FkWikLEjV/D9C4mwc2iqVMG/fIPbXB9OU5q4=; b=o07BrSOg1I3ZAbol7DUdxPNo0X7ueGUKzVERCNpj3MJ9kk3m9o0e4o+g3VVNbQBltr mSnjB2+5TOFiAxJtHx3fk8yKuoRBvS4xMM2u4mkBbY+gLfjKWb7lc/weMn+oEf/+DkfF vBOwhSSJqqOc3Go9LsSl3HtXat6Uhdu4duXjqDqOT1TZj7FDG8h33YsrOen0PGhYwq2l KPlemUBfaSrXkR9gpPeMKQ8avWSdsxoN9XQ2q+Y1alRclcmMOI6W+wrSiwoL4qrj0A0A 9fIWcnGYCzRK/CVGFHxBd5Mw7AVqrmXBQl+typj3/l2CIoLQnp/OjaE/QxYX/zMPFhDx OsYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=U0Hnhz6FkWikLEjV/D9C4mwc2iqVMG/fIPbXB9OU5q4=; b=8KKE8H8I8ss/xpu7sPsAgFuswKR/v5NAngzPSXoOMb61tqtvfb8r31xpmFvzmiwR07 V8IpJ1d7lEkAfwIr6EOKwkKS5/pLu62ppJLziFGxPa5q6omHdtatCHDsDXI2yBbup27t Qj3+3EvGWwNVqRB/GmhsXOw9A1D/f5dlguykIiiw4lMeFiNmP7+F4lxIvT2KiQmudWF8 imGRxVAoWFTh0mLga1vQXvEbj7GvQ+dsU5g2IStO5lMj9l0XPdonPXeWxgsIiCHye8gT NB4IAeIzfy0w5pB9gzWmsrJTtTaDz5q8F350B1tYu4QOvGGz7DXG7Ppg+kFBfriB11dC aoWA== X-Gm-Message-State: AOAM532tsp7cJIBL+qZkFtRxGfeeAOYIhV/g1vA9GYNatNbb6PbuALbH mdq61KdXSSeU0PXEKLqEHE94kgVfaCdaGg== X-Received: from dlatypov.svl.corp.google.com ([2620:15c:2cd:202:aed6:d51d:dc38:e705]) (user=dlatypov job=sendgmr) by 2002:a25:ba0c:0:b0:61a:79a6:fd0 with SMTP id t12-20020a25ba0c000000b0061a79a60fd0mr11581459ybg.45.1649360345816; Thu, 07 Apr 2022 12:39:05 -0700 (PDT) Date: Thu, 7 Apr 2022 12:39:02 -0700 Message-Id: <20220407193902.1981605-1-dlatypov@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog Subject: [PATCH] kunit: tool: cosmetic: don't specify duplicate kunit_shutdown's From: Daniel Latypov To: brendanhiggins@google.com, davidgow@google.com Cc: linux-kernel@vger.kernel.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org, Daniel Latypov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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-kernel@vger.kernel.org Context: When using a non-UML arch, kunit.py will boot the test kernel with these options by default: > mem=1G console=tty kunit_shutdown=halt console=ttyS0 kunit_shutdown=reboot For QEMU, we need to use 'reboot', and for UML we need to use 'halt'. If you switch them, kunit.py will hang until the --timeout expires. So the code currently unconditionally adds 'kunit_shutdown=halt' but then appends 'reboot' when using QEMU (which overwrites it). This patch: Having these duplicate options is a bit noisy. Switch so we only add 'halt' for UML. I.e. we now get UML: 'mem=1G console=tty console=ttyS0 kunit_shutdown=halt' QEMU: 'mem=1G console=tty console=ttyS0 kunit_shutdown=reboot' Side effect: you can't overwrite kunit_shutdown on UML w/ --kernel_arg. But you already couldn't for QEMU, and why would you want to? Signed-off-by: Daniel Latypov --- tools/testing/kunit/kunit_kernel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py index 483f78e15ce9..9731ceb7ad92 100644 --- a/tools/testing/kunit/kunit_kernel.py +++ b/tools/testing/kunit/kunit_kernel.py @@ -158,7 +158,7 @@ class LinuxSourceTreeOperationsUml(LinuxSourceTreeOperations): def start(self, params: List[str], build_dir: str) -> subprocess.Popen: """Runs the Linux UML binary. Must be named 'linux'.""" linux_bin = os.path.join(build_dir, 'linux') - return subprocess.Popen([linux_bin] + params, + return subprocess.Popen([linux_bin] + params + ['kunit_shutdown=halt'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, @@ -332,7 +332,7 @@ class LinuxSourceTree(object): def run_kernel(self, args=None, build_dir='', filter_glob='', timeout=None) -> Iterator[str]: if not args: args = [] - args.extend(['mem=1G', 'console=tty', 'kunit_shutdown=halt']) + args.extend(['mem=1G', 'console=tty']) if filter_glob: args.append('kunit.filter_glob='+filter_glob) base-commit: b04d1a8dc7e7ff7ca91a20bef053bcc04265d83a -- 2.35.1.1178.g4f1659d476-goog