Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4518716yba; Wed, 17 Apr 2019 13:16:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJ+tqOjSeeL/GyhRzTS1AIn0FbM0B5XXBnRY84mN3wP7fJF/kz3KKzQHHqFj2E02S6Glmj X-Received: by 2002:a63:d5f:: with SMTP id 31mr81684798pgn.208.1555532199069; Wed, 17 Apr 2019 13:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555532199; cv=none; d=google.com; s=arc-20160816; b=yR55XE6U6L2+kPcoM2+DV1+IkBHilooluBUZXhoqrpoc5A5XWbzvmU4l95GBIZwy1a jNSOBpxkxQbHSwQg9c+QYXjE6Ep7ED3D7+mzZ3lmcAY3fZGPk2wtt4caprX+1ld5hiOd J+AQmxRXUGfaIBvI0voMTlEdSmxmWpr6ZhgqYiK71AzrDVO73oIVh2LjvOVYff/Jzjpb F5P17MYeo98TXwiyJHQEeM8npg03Ua72e1zJZOoOWHRAq6B2iRN0uY+HKcrhKjqYlF2Q 4+ZGVfuxjuFXl7AccIryXeKiPCVxOF5Ij/YrB1sfA4Ie4h4xVPrLDHpI6QnwH30/P3Iq csjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6v6KcEkS75wpAGqPcJpaPyTimG1OBw8fyJVHX7mRFl8=; b=uWIYZspNWyLISU3jGT3RwPj2mw1TUJ4O8Zm8ZOD6NeWrM4sCYS86vZ6yW0AAxxL+Iu jY9xG0dRHjPBFBEdgYs+gYzu0+0obzD7b3wVbYcibzxIUgGleAT+FHkMKikBMJLadWQ6 yLaHxrjlBnCjciWvp63P8f4pD/gUaZmmtj3jD7BDfKdaxLhWiAXkQXLlaPMBe9q6TNMe Tn4fqLmVNe8y4xwFjYC5DNKJmhtCwX0i3QwkwHWwykRXyoy9P7IoGSJdn8CWqbEVm+zr Sg72e4x7JHhcim9oh/pHg6CsQYNYe5Fnu8l7QaKjOB96GsbD4+bcgTezUBxPjClBsBf0 9mPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XcWBjlU0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10si25638pfg.172.2019.04.17.13.16.23; Wed, 17 Apr 2019 13:16:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XcWBjlU0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732749AbfDQUPD (ORCPT + 99 others); Wed, 17 Apr 2019 16:15:03 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:38770 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfDQUPC (ORCPT ); Wed, 17 Apr 2019 16:15:02 -0400 Received: by mail-qt1-f195.google.com with SMTP id d13so28881201qth.5 for ; Wed, 17 Apr 2019 13:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6v6KcEkS75wpAGqPcJpaPyTimG1OBw8fyJVHX7mRFl8=; b=XcWBjlU0atGDp0IkBW8UtiiKtCtoNHVtKPiCZ7+Ub+mfp5wddAP2LaJUYwnFEr6PMe Md83s6scLr1gKQP3i5Q66MwR0DW+RmCotvEoo+vHYUTOGwWZptv76A68IADVmkuVlqdB 2HUBK/xmedLSrcZJgTTx3GV6+VdBuawX+GkyfYwte9FJvh2ROLqCw5Cv2/JY12xrUvxW BMsN2ZHcYvaSc5t+IABrlSZ3UhU5lF9qogxP2TZEMzx+EeWjFGI9Pq3/Q8ZREgbC8PCx GEacCPbHaFf63UnC5ivQiopPhn3OX3V+U666ZVyL05eH4VTD++SuFNmyYBtZeP8jOlce SYWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6v6KcEkS75wpAGqPcJpaPyTimG1OBw8fyJVHX7mRFl8=; b=Y0LBjGvPkpXDaH4aoVP3XjdZ6vzykJcHjC/efbqstUCME194oFl5t24JuT9YlXx7o2 v8exWL7iW3NtCbZqdJEi4s8Bq+dhSMIX/FEcXXJdyf4DC27XiRpJP2vTDcSFEgZVkkgd +SLmr2Pn6ILvtzhyyLYNrO07gZI3jT2/ytMy0JjyX4XuNnEFjFIOwxe30zfTR5xSZXgX pLRVQZEmCY5bzv66YfV2B2Qzbd7XuupX6qfdtZwhOq8hezPxOrWrSleWAlpe6WgmoRkc XH4oKrTQSeirqj9zfHreTtGRwgTug/9FbcsBRLMn37Nkq/8KvzhMlLiNyUphfGqqUV28 AuCw== X-Gm-Message-State: APjAAAUX9Z5FtmWzAnXodgZFy4I8KHqAzd4DfSXMiID22n/hucV8eMAx WPIRpGep5Q1+KZr4o1iO9w== X-Received: by 2002:ac8:4685:: with SMTP id g5mr73338754qto.242.1555532101502; Wed, 17 Apr 2019 13:15:01 -0700 (PDT) Received: from gabell.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id d142sm35319783qke.20.2019.04.17.13.15.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 13:15:00 -0700 (PDT) From: Masayoshi Mizuma To: Steven Rostedt Cc: Masayoshi Mizuma , Masayoshi Mizuma , linux-kernel@vger.kernel.org Subject: [PATCH] ktest: Add workaround to avoid unexpected power cycle Date: Wed, 17 Apr 2019 16:14:42 -0400 Message-Id: <20190417201442.15030-1-msys.mizuma@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masayoshi Mizuma Unexpected power cycle occurs while the installation of the kernel. That is because the default reboot command, "ssh $SSH_USER@$MACHINE reboot" exits as 255 even if the reboot is successfully done, like as: ]# ssh root@Test reboot Connection to Test closed by remote host. ]# echo $? 255 ]# To avoid the unexpected power cycle, the reboot is considered as successfully done if the reboot is the default command and the return code is 255. Signed-off-by: Masayoshi Mizuma --- tools/testing/ktest/ktest.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index ea07d43856b8..765c6bc83ab4 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -1737,6 +1737,11 @@ sub run_command { my $dord = 0; my $dostdout = 0; my $pid; + my $is_default_reboot = 0; + + if ($command eq $default{REBOOT}) { + $is_default_reboot = 1; + } $command =~ s/\$SSH_USER/$ssh_user/g; $command =~ s/\$MACHINE/$machine/g; @@ -1791,6 +1796,10 @@ sub run_command { # shift 8 for real exit status $run_command_status = $? >> 8; + if ($run_command_status == 255 && $is_default_reboot) { + $run_command_status = 0; + } + close(CMD); close(LOG) if ($dolog); close(RD) if ($dord); -- 2.20.1