From patchwork Wed Jan 18 21:54:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 45524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:a405:0:0:0:0:0 with SMTP id d5csp38729wra; Wed, 18 Jan 2023 14:07:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXtiGvn3q73NOhCBSIaqLe1eVxWBOz9gvzY8v5UtZO4Nf9bKiKKQY4lCAvGWLc1du60adhak X-Received: by 2002:a05:6a20:9e4a:b0:9d:efbf:48de with SMTP id mt10-20020a056a209e4a00b0009defbf48demr7956559pzb.34.1674079670185; Wed, 18 Jan 2023 14:07:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674079670; cv=none; d=google.com; s=arc-20160816; b=HM26Pex2RlRZaTNT0TN5Xhm90nGKzmZYVf7xM10xrqzS687XyHd3rMxAeUzYbWxR8M WbFCS8uJnulSekd77RzSyJJn+dM/uvzaLRLBileTKIyu9aHOnnNfNTHRrrkpGZ4FsVY+ 1M9l3u3sBpqM7BsmOYeWedqtKI4DotjTx5aauFfQ1ABQeOA6hCELFragVJP7YJ/9b3t8 v7Sh9Jm/lFEFx3u6Bkzxg3AB+f1pN4v8lwW9LfBjRXwitcXl2w5vmpdcwZFgXE6gQRY+ eGnl4pf2s9iNhD2nzHJ/4N0fEaHPpcNFHS8V5zywmUmE//wylOBJ149J31Yp34SLtkxr cr4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=3BsWtppfmvi+kXRoZxqUBPIEYIVggMxGTPoL97i42Co=; b=r3E+k+gxnU0maCnmVvpiY5CzGaKbnuaCfAtzPPdzVJzm+BTHNbdH0R57QwonafHXaD fPR7NF5eY8IBNceTS7OmQehFGayPBMtxl/zz5pJWhg/CP206+7F5Aj+SnTSdeFabhgyC jNdcfBKVe5WbF4uxxoCMXuMCgbbCnR/fr9Rf33nCaNG7MUWw12PJRbn6dZfP1A7QG+b7 nFt/WTPGlRwGSsw7AA8aqLnd4KXz+zphnl16zLXDFM9BTfdHcTKt4hrpcsm+fZ92MfiS B8Fe0EUGldgacogUHJ7ytz3XFRaSWQ48RL88+3JkhwzronrKy95h6d1AVkQDRydWJU84 sM9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b004b2709233b1si32418855pgb.197.2023.01.18.14.07.34; Wed, 18 Jan 2023 14:07:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbjARWCe (ORCPT + 99 others); Wed, 18 Jan 2023 17:02:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbjARWBu (ORCPT ); Wed, 18 Jan 2023 17:01:50 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E41410A8F; Wed, 18 Jan 2023 14:01:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2ABEB61A73; Wed, 18 Jan 2023 22:01:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 947E7C433F2; Wed, 18 Jan 2023 22:01:47 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1pIGV8-002H9N-1U; Wed, 18 Jan 2023 17:01:46 -0500 Message-ID: <20230118220146.327085542@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 18 Jan 2023 16:54:36 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Masami Hiramatsu , stable@vger.kernel.org Subject: [for-linus][PATCH 1/3] ktest.pl: Fix missing "end_monitor" when machine check fails References: <20230118215435.016435760@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755399763939437459?= X-GMAIL-MSGID: =?utf-8?q?1755399763939437459?= From: Steven Rostedt In the "reboot" command, it does a check of the machine to see if it is still alive with a simple "ssh echo" command. If it fails, it will assume that a normal "ssh reboot" is not possible and force a power cycle. In this case, the "start_monitor" is executed, but the "end_monitor" is not, and this causes the screen will not be given back to the console. That is, after the test, a "reset" command needs to be performed, as "echo" is turned off. Cc: stable@vger.kernel.org Fixes: 6474ace999edd ("ktest.pl: Powercycle the box on reboot if no connection can be made") Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 6f9fff88cedf..f2f48ce6ac4d 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1499,7 +1499,8 @@ sub reboot { # Still need to wait for the reboot to finish wait_for_monitor($time, $reboot_success_line); - + } + if ($powercycle || $time) { end_monitor; } } From patchwork Wed Jan 18 21:54:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 45523 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:a405:0:0:0:0:0 with SMTP id d5csp38402wra; Wed, 18 Jan 2023 14:07:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXu4lc0cVjUVFDzlUHCYrNogFDhI7NnSEeYrU8UEGxEQcvrEUmVCUynVxVIDGVL+M+aTSI0Z X-Received: by 2002:a05:6a00:278d:b0:56b:f51d:820a with SMTP id bd13-20020a056a00278d00b0056bf51d820amr9043271pfb.7.1674079629666; Wed, 18 Jan 2023 14:07:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674079629; cv=none; d=google.com; s=arc-20160816; b=kz+YLNABjGUitIFLGBwUMBG0zHuxaJFt8uPP1LXaSi70NpvxqCFnHrT7B+TSXs1IJO t1gFKWvunmFZAGFAYh7v4YIBIS35x+yll5tZL+b6e/L6t5ukPB4OmhQaV7qvdIWoqe+g wG3iaN1LYhXyLOwPdT2rKf/IM8Uo8UKTegO9RJzL911U9CCxQXCEzHP6LsSxt12caa5M kl/bnCm9g0KYo0M+ERsH4niQ0O7UKUGyea3jj9Djof2YdWXNAS1euHqj4Do2Bx7t6iau 4S1kIGdZSOSZ9x8Vga6pEJ88+hoZ6zX285DIq6oNKbRQIBnoW0YiLdOBeOkHyjQq6LGr o8Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=GbZrVOc7l0/zJVINmpZ4/2JGME9Ivpzl2Ll6fk2mbTI=; b=L0PFjtLoSUlVWGMrfErTfMh3E9cE5ffNKYBsGrD9XfuoMfOo5jQHNPE/zZx8GWvc6f iDu3hwz/lWH6GJjtdzsBZ6GwgNhVTJ4cqO/5XwSiDoRB8Ot9uzAkYe5tO+vgQwyvDZt6 2ogHng0p3/ZCu6vNWtXBSXf+Hztsd7TbJZPm3wm2GA/fWmkoxkLkJaJ/HEwJ1oLi+H1d MDqBJH1poUT0AhH4Hq7dF0ExpClbs66pfLAkP4/1gNYI39d3AAdlFty1uiF/sOiNEEqR Wy4hAGOGaQZqHNNkFuj/sN1OkK7MU3siGPEW8ZoIT5FVm3Y+vHuzGdR9oXIzHnFTJOGy J1nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d1-20020a056a00244100b005739d652a89si37059406pfj.223.2023.01.18.14.06.57; Wed, 18 Jan 2023 14:07:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbjARWCa (ORCPT + 99 others); Wed, 18 Jan 2023 17:02:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229965AbjARWBv (ORCPT ); Wed, 18 Jan 2023 17:01:51 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 514F02F7B3; Wed, 18 Jan 2023 14:01:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 07900B81D69; Wed, 18 Jan 2023 22:01:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFFBCC43392; Wed, 18 Jan 2023 22:01:47 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1pIGV8-002H9r-20; Wed, 18 Jan 2023 17:01:46 -0500 Message-ID: <20230118220146.482536390@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 18 Jan 2023 16:54:37 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Masami Hiramatsu , stable@vger.kernel.org Subject: [for-linus][PATCH 2/3] ktest.pl: Give back console on Ctrt^C on monitor References: <20230118215435.016435760@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755399721830067076?= X-GMAIL-MSGID: =?utf-8?q?1755399721830067076?= From: Steven Rostedt When monitoring the console output, the stdout is being redirected to do so. If Ctrl^C is hit during this mode, the stdout is not back to the console, the user does not see anything they type (no echo). Add "end_monitor" to the SIGINT interrupt handler to give back the console on Ctrl^C. Cc: stable@vger.kernel.org Fixes: 9f2cdcbbb90e7 ("ktest: Give console process a dedicated tty") Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index f2f48ce6ac4d..78249c3a03a5 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -4205,6 +4205,9 @@ sub send_email { } sub cancel_test { + if ($monitor_cnt) { + end_monitor; + } if ($email_when_canceled) { my $name = get_test_name; send_email("KTEST: Your [$name] test was cancelled", From patchwork Wed Jan 18 21:54:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 45522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:a405:0:0:0:0:0 with SMTP id d5csp38389wra; Wed, 18 Jan 2023 14:07:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXutRxTCHkOr3CmYAyPWJ0L9VoFiCfMyK+jaZjoqhg3FXIkCslwR0KN1G1Y2XV72jkNMgZ3G X-Received: by 2002:a05:6a21:170f:b0:b2:40a8:abc0 with SMTP id nv15-20020a056a21170f00b000b240a8abc0mr8231826pzb.40.1674079627961; Wed, 18 Jan 2023 14:07:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674079627; cv=none; d=google.com; s=arc-20160816; b=WBtwvS7ERL5qmiHE389CsqrjV54z72vLejhoOkCaoIeWlvy8n4qAjC/YkFDvKoKahH UyYsgO3kkoPHmFtSLKNO7HBuQofJ/qhwZkXmTFnovphK15V1mHD/guWW6UhDSePqLwOJ xkDywDweNksfIx4iMGPgQfFq1rFlXfrPFfeoF5IOlT2dm5nqwySJKHej/NxYjN4O9GPF f1cEWK7jlSV7e4F4wwmukbqwVrlGQPwZ3MyDg0mLeTcqDGpeogBBZG3Lsd7DSxTXv+K8 Om6wRDLbWbkBlMgEd1zFBVQPnphDWX08XsjZ/Qc6kPr7WnwUOLA+rd8uvb9jor2LFnbF umtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id; bh=aqwT0A6rEQ9rPlJZ/JVj0QyuDl056E9zxKsg9Is2fj4=; b=Z5pW0cl8c5xCXRaIMVXTRz0eYaEjeR8P7Wx+Ma3kp3vPbmrguHOS7CYjz/pie1JdJN 4RuWSfpNvAY4bC2Dhc8C0ayXbmLbnJLFMlIAJBMd8EXbxFZ7TkJpRXffq7UPukPC8Vq5 9pNNvsVjG47VEqdYeuHlwnKn0sFNL9QGhk86R8hox6S5D37d3J+Tytd/WRI70d+TkXbS UVnzCaqMsWkQZcNjwVRaVXsciuaG/y58jJupR+Os8fIUd8pW+osc07zASo2sFgqt6hgB YCpKxLyxz9JQ1OyB3xamxyeQN3XYcAUUBmKBB7DDVbRKIyvxcPcGuaLQJAOy2j5Hw2b1 zBJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a630215000000b004aeae83e5b0si35912370pgc.55.2023.01.18.14.06.55; Wed, 18 Jan 2023 14:07:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbjARWC0 (ORCPT + 99 others); Wed, 18 Jan 2023 17:02:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbjARWBv (ORCPT ); Wed, 18 Jan 2023 17:01:51 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8638337F01; Wed, 18 Jan 2023 14:01:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 46EFFB81F14; Wed, 18 Jan 2023 22:01:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBF1BC4339E; Wed, 18 Jan 2023 22:01:47 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.96) (envelope-from ) id 1pIGV8-002HAL-2V; Wed, 18 Jan 2023 17:01:46 -0500 Message-ID: <20230118220146.639491327@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 18 Jan 2023 16:54:38 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: "John Warthog9 Hawley" , Masami Hiramatsu , stable@vger.kernel.org Subject: [for-linus][PATCH 3/3] ktest.pl: Add RUN_TIMEOUT option with default unlimited References: <20230118215435.016435760@goodmis.org> MIME-Version: 1.0 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755399720048132285?= X-GMAIL-MSGID: =?utf-8?q?1755399720048132285?= From: Steven Rostedt There is a disconnect between the run_command function and the wait_for_input. The wait_for_input has a default timeout of 2 minutes. But if that happens, the run_command loop will exit out to the waitpid() of the executing command. This fails in that it no longer monitors the command, and also, the ssh to the test box can hang when its finished, as it's waiting for the pipe it's writing to to flush, but the loop that reads that pipe has already exited, leaving the command stuck, and the test hangs. Instead, make the default "wait_for_input" of the run_command infinite, and allow the user to override it if they want with a default timeout option "RUN_TIMEOUT". But this fixes the hang that happens when the pipe is full and the ssh session never exits. Cc: stable@vger.kernel.org Fixes: 6e98d1b4415fe ("ktest: Add timeout to ssh command") Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 20 ++++++++++++++++---- tools/testing/ktest/sample.conf | 5 +++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 78249c3a03a5..7c91d753a9f2 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -178,6 +178,7 @@ my $store_failures; my $store_successes; my $test_name; my $timeout; +my $run_timeout; my $connect_timeout; my $config_bisect_exec; my $booted_timeout; @@ -340,6 +341,7 @@ my %option_map = ( "STORE_SUCCESSES" => \$store_successes, "TEST_NAME" => \$test_name, "TIMEOUT" => \$timeout, + "RUN_TIMEOUT" => \$run_timeout, "CONNECT_TIMEOUT" => \$connect_timeout, "CONFIG_BISECT_EXEC" => \$config_bisect_exec, "BOOTED_TIMEOUT" => \$booted_timeout, @@ -1862,6 +1864,14 @@ sub run_command { $command =~ s/\$SSH_USER/$ssh_user/g; $command =~ s/\$MACHINE/$machine/g; + if (!defined($timeout)) { + $timeout = $run_timeout; + } + + if (!defined($timeout)) { + $timeout = -1; # tell wait_for_input to wait indefinitely + } + doprint("$command ... "); $start_time = time; @@ -1888,13 +1898,10 @@ sub run_command { while (1) { my $fp = \*CMD; - if (defined($timeout)) { - doprint "timeout = $timeout\n"; - } my $line = wait_for_input($fp, $timeout); if (!defined($line)) { my $now = time; - if (defined($timeout) && (($now - $start_time) >= $timeout)) { + if ($timeout >= 0 && (($now - $start_time) >= $timeout)) { doprint "Hit timeout of $timeout, killing process\n"; $hit_timeout = 1; kill 9, $pid; @@ -2066,6 +2073,11 @@ sub wait_for_input { $time = $timeout; } + if ($time < 0) { + # Negative number means wait indefinitely + undef $time; + } + $rin = ''; vec($rin, fileno($fp), 1) = 1; vec($rin, fileno(\*STDIN), 1) = 1; diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf index 2d0fe15a096d..f43477a9b857 100644 --- a/tools/testing/ktest/sample.conf +++ b/tools/testing/ktest/sample.conf @@ -817,6 +817,11 @@ # is issued instead of a reboot. # CONNECT_TIMEOUT = 25 +# The timeout in seconds for how long to wait for any running command +# to timeout. If not defined, it will let it go indefinitely. +# (default undefined) +#RUN_TIMEOUT = 600 + # In between tests, a reboot of the box may occur, and this # is the time to wait for the console after it stops producing # output. Some machines may not produce a large lag on reboot