Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2879502pxu; Sat, 19 Dec 2020 05:08:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7UW61r9mqmvPvhhpErdWH8ntASDLS19AgcIt4LzAIxctNN9N1GZ8+FyDeRiEEJaLsCwy8 X-Received: by 2002:a17:906:25e:: with SMTP id 30mr8161553ejl.544.1608383296211; Sat, 19 Dec 2020 05:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608383296; cv=none; d=google.com; s=arc-20160816; b=XysU76mfo7q5VL31xlqEjgAr7HbMZg77vi+fWtqxBZb0ES+OBMG+emzbJiytojBin3 VGSdRBB2vZ2pncE47H9Gil4hnm32EVeXzuEVS9aHZ0DvkbE7Qq33wz4o0sDvjsOfzpGX 8sJZJbhDTWziZya+yEkBLFZJvGUIqQQhJGA2ZhyQBMgtqDtFbDdukVXb8rycJ7vv8LXx mG0mn4v3yay6BHcAG/zYlH6bbF6fAQ4f3HvX1B6F3VtsdXC2FaiwD0DPYSn5SPvb1x21 5Mk5udTczSHCcj5FMYiE21FX7/ScJ13VhzORlgGyvRYYG5266iQjlIV0oHFtF5EYFYY0 GieA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=5xRDGQFY67Cf3aLdNKmydkZ9ja3TO50ifwY2EmPuh9E=; b=tIuSAWWLdoIItGlA0yP/cduNqQ1+VJOJM+mjCT4fA7UhrLWJYTfnd1fCSdrnJK4qnK h1Iuw16f/xOwa7cnewMMbQLqvj0hK18YaMvGne8DNOQ4lVsA6z/UJjqITvxJJhl1Tda3 gFBDOtjeEVIF+iCsL5p86qP1au7WuuN1FRgGTFXBM/BPOtdmr9gnAU83IABBEVEWj9OH ACKKrgvFAzwP98evmRGFNdno7qePH+HJmOGhbBgxpRPkwK017IYH8GD5XamWqTrv+FpH XzRndGQpo5b4D5E5bcnMqDZMZxNofJ4wqTmzugP7P+69azhAOi6y9xyDNX4Xb21x1S3a r8dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 33si7957430edq.375.2020.12.19.05.07.53; Sat, 19 Dec 2020 05:08:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728464AbgLSNDq (ORCPT + 99 others); Sat, 19 Dec 2020 08:03:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:51326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728355AbgLSNDn (ORCPT ); Sat, 19 Dec 2020 08:03:43 -0500 From: Greg Kroah-Hartman Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Steven Rostedt (VMware)" Subject: [PATCH 5.4 19/34] ktest.pl: If size of log is too big to email, email error message Date: Sat, 19 Dec 2020 14:03:16 +0100 Message-Id: <20201219125342.332549484@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125341.384025953@linuxfoundation.org> References: <20201219125341.384025953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Steven Rostedt (VMware) commit 8cd6bc0359deebd8500e6de95899a8a78d3ec4ba upstream. If the size of the error log is too big to send via email, and the sending fails, it wont email any result. This can be confusing for the user who is waiting for an email on the completion of the tests. If it fails to send email, then try again without the log file stating that it failed to send an email. Obviously this will not be of use if the sending of email failed for some other reasons, but it will at least give the user some information when it fails for the most common reason. Cc: stable@vger.kernel.org Fixes: c2d84ddb338c8 ("ktest.pl: Add MAIL_COMMAND option to define how to send email") Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- tools/testing/ktest/ktest.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -4197,7 +4197,12 @@ sub do_send_mail { $mail_command =~ s/\$SUBJECT/$subject/g; $mail_command =~ s/\$MESSAGE/$message/g; - run_command $mail_command; + my $ret = run_command $mail_command; + if (!$ret && defined($file)) { + # try again without the file + $message .= "\n\n*** FAILED TO SEND LOG ***\n\n"; + do_send_email($subject, $message); + } } sub send_email {