Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2875178pxu; Sat, 19 Dec 2020 05:02:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGOkQJ6qt3xs0qLkfA2SuPT0hkJ7nCQIt4HUHornkpvpbuziMlj8xcDfkXUl6T/Xeeei3j X-Received: by 2002:a17:906:c04d:: with SMTP id bm13mr8207157ejb.519.1608382943608; Sat, 19 Dec 2020 05:02:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608382943; cv=none; d=google.com; s=arc-20160816; b=bIjiFDKe8MGLMNeB+HwKESmrPL/QUZOH8W1LCZvZ21MEpZxXNsaPDhM1OerrJU/IOu WTwqXmop+AAky+0a0CeAILXP+p6wS0mKw1eyrOZKWEC79+k31o4z3xxsE1Vbsk/1lSb4 P3iCIKqlZ3hg+EyiajjNNkljEXw+IooHdo+SOBKZwFqybHKB+ys0RjEQ0735XRDt18Gv e/ptH1Zr5lAOvYdM4z8q4EYjnAjyT27VqLl8yFfHmx+V19XrS2ghFBrSVsNQhZFh8L/O gunRSEy2Cmc/MCtQ+sJRemBtKnYzbfaJ+eh8V624nKY84vOHAEwFwDWcKFQ6Qp0Qcl0n 7k0g== 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=+iwn+ssLPA0AjaknGu+5hSvLRx1zvk+XSdxTqJvFbbk=; b=kYygVzp40W1g7GQucHM754FdPDvyhdKbMEndWhnDzJTt/gZJ8BLpH9MHVSbKQVBrqI 8q1QJbH5LhL3QvNIUgl8pIu4Sn2XQp9O1oJYN4YqQpMgv+J8aIN9oB6wywvKyB3RyJOX ijNAz9FJQf4I9Cn7/HW1VnMHHTIRtXgdqsMmXUBEf9eNZ0vltdQho3kHWU5uWZJZMQ7L 0jnj9FGUQzvPCLkW42y2X9m5Huqa2+oNpYqY8cJXA1xhqKwW9NxY7Cbvt6GuwoQ4peqC irIKnlhsRuVGTw7i5f0jBW0N7K3643WtwZAC7z2iy8eFLZp0ry6ZmKdAp1dbYRhrKS4t /Npw== 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 b21si6056422ejk.520.2020.12.19.05.02.01; Sat, 19 Dec 2020 05:02:23 -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 S1727255AbgLSNAc (ORCPT + 99 others); Sat, 19 Dec 2020 08:00:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:47284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728381AbgLSNAA (ORCPT ); Sat, 19 Dec 2020 08:00:00 -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.9 33/49] ktest.pl: If size of log is too big to email, email error message Date: Sat, 19 Dec 2020 13:58:37 +0100 Message-Id: <20201219125346.291323430@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201219125344.671832095@linuxfoundation.org> References: <20201219125344.671832095@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 @@ -4253,7 +4253,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 {