Message ID | 20240301194037.532117-4-mic@digikod.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-89041-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:fa17:b0:10a:f01:a869 with SMTP id ju23csp134430dyc; Fri, 1 Mar 2024 12:22:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX/0JfXhST+syHlePMYMvuAfvyfEP3Rua++aW4eKRmAX3N6liXT3WYRY2K5Ywn07gI5/s7SU7/pP+eMFen8ewJqZvk9uw== X-Google-Smtp-Source: AGHT+IE9equVcxPzpXoiNA2AXMBHaTy7zNmSY7ItBtMQKVHtuWGUrpxao0yyMcxTen2CgExQ4ap2 X-Received: by 2002:a05:6808:1291:b0:3c1:88d1:f051 with SMTP id a17-20020a056808129100b003c188d1f051mr3364201oiw.31.1709324522340; Fri, 01 Mar 2024 12:22:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709324522; cv=pass; d=google.com; s=arc-20160816; b=iK6hX3EPQ4DT7H5T2b+aK5pjmYajgWd2vrRQjyZxsRLx1EV4ROR5RTtLXMq8McSEok 0YfuWcwrYjXCWMd6o8PantbTI69ZjC7T/nE34R1UPpeYT1ErvjAUsnY92xnoeaaMW92l 6qdAhG6DRh/n8g/k6uLNysVXG2mKbQdGTEXgwqaXPFh/S6GR8/rKWVoaKCYGAg/QXhZ3 0gfFaIq3ZTWiKoNGwPcjMOnRJoJYVWG9z8Mpbiuypt2ukfGggjDPPKSxlRTTHtJcns8+ tsCwd1UaDthETjGBAw71xWDToCYm8lREzRYwXw6LmZ+A65j8wwEp6zlSuY2tIkiA4NzV 3nGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=BpqXJ/lwvMIYbzNZpRq0wAVeL/iFQENkAa0bt5dgsy4=; fh=MR/wbEn34JHmT+rtzWNq5RVU/RKi8DhjSvb3ywiuLkE=; b=zGGKUhliW6nmpSfhrg75PivuDQGaX0NI/EWrokf0WkBnrVbryERsXXuBjAng90K7dq Fyan7m4lV5NlEZS6oYuJ8UxTeapHMyQQLNj6hUQOq7OhfiDwbJHD8jBnshTn+1qu7fmW l9yzaTjbgk/xjj5a7jde67V+/MxAgxZez3EKC9a0cEIUtS4kesj8ZkadbSCpLa5D7M7N zUF0ZvxTSNqZxOZ1jgjY+rGul/bPQckBjHQ0WoKSDf0MDXkZXJazPYT2b3MfDTKoOgpD GOYzB9OkIUlJ1dXyshP06zqqRHt3jBuxmhF6f/Qb5/+Vw3dACRKCzoP4/z1yDVvSGU6c svmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=u9Fo3mrb; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-89041-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89041-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id r4-20020a63d904000000b005dc4c1f8c5dsi4247173pgg.579.2024.03.01.12.22.01 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 12:22:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89041-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=u9Fo3mrb; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-89041-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89041-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 7CD09B2AC59 for <ouuuleilei@gmail.com>; Fri, 1 Mar 2024 19:42:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32A583D962; Fri, 1 Mar 2024 19:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="u9Fo3mrb" Received: from smtp-8faf.mail.infomaniak.ch (smtp-8faf.mail.infomaniak.ch [83.166.143.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DBE93B796 for <linux-kernel@vger.kernel.org>; Fri, 1 Mar 2024 19:40:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.166.143.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709322057; cv=none; b=GeSY9RQeG8rHxsKbOLl7cEOki2GovEQ0vYKmNYduCh7Gk+VyfWmHzG3LFujKkR8mJTbLQMfOyYLY9UH9jsjlqBhgY67rlRp2BgyTDBuvKRXO2IyK4KxfnW4ZZN08WCyvbhAZbVi0nyh0hm8Md/5r+BnFdMQV3VOcpwBvYM9qVtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709322057; c=relaxed/simple; bh=ALcC3CaJfmLivYATmbVgo8sZG5WxbJSNk2vIXJaBKx4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EAXcmhhpP/ahmR6HNq5dGAGh1NeqU8ZmXsv+ctaO3WfIDMbFtaNPuu6FAuuLVfwGsBNYkHS3sj05usVpADVoROmqWrChcUZUseSGaDFS1UTD309YuQGpcuQCIfcZFuNcOjLw+zEXHE4w9OYOSVlLjF4vGTx3Mnecxw5HzdmlTl4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=u9Fo3mrb; arc=none smtp.client-ip=83.166.143.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Received: from smtp-4-0001.mail.infomaniak.ch (smtp-4-0001.mail.infomaniak.ch [10.7.10.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Tmdjx2frwzktW; Fri, 1 Mar 2024 20:40:53 +0100 (CET) Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4Tmdjw3y19zq0s; Fri, 1 Mar 2024 20:40:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1709322053; bh=ALcC3CaJfmLivYATmbVgo8sZG5WxbJSNk2vIXJaBKx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u9Fo3mrbl+44096yxCQqPJrxB9Bv0UdKRFIxq9dJBpVvCydwx9rXQ6mjH/NsGOLfA 2bUnjD3vO4V6KmPD6bW8Y938TLqRPJMs4C0K1COoDdxa8dquqmPIFKJExCqnEdghWE Wc/zD+duRRuF5SzUY+RAhKgkL9Kr1oVplaska6p4= From: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= <mic@digikod.net> To: Brendan Higgins <brendanhiggins@google.com>, David Gow <davidgow@google.com>, Kees Cook <keescook@chromium.org>, Rae Moar <rmoar@google.com>, Shuah Khan <skhan@linuxfoundation.org> Cc: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= <mic@digikod.net>, Alan Maguire <alan.maguire@oracle.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H . Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>, James Morris <jamorris@linux.microsoft.com>, Luis Chamberlain <mcgrof@kernel.org>, "Madhavan T . Venkataraman" <madvenka@linux.microsoft.com>, Marco Pagani <marpagan@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Sean Christopherson <seanjc@google.com>, Stephen Boyd <sboyd@kernel.org>, Thara Gopinath <tgopinath@microsoft.com>, Thomas Gleixner <tglx@linutronix.de>, Vitaly Kuznetsov <vkuznets@redhat.com>, Wanpeng Li <wanpengli@tencent.com>, Zahra Tarkhani <ztarkhani@microsoft.com>, kvm@vger.kernel.org, linux-hardening@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org Subject: [PATCH v2 3/7] kunit: Fix timeout message Date: Fri, 1 Mar 2024 20:40:33 +0100 Message-ID: <20240301194037.532117-4-mic@digikod.net> In-Reply-To: <20240301194037.532117-1-mic@digikod.net> References: <20240301194037.532117-1-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Infomaniak-Routing: alpha X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792356670154364831 X-GMAIL-MSGID: 1792356670154364831 |
Series |
Handle faults in KUnit tests
|
|
Commit Message
Mickaël Salaün
March 1, 2024, 7:40 p.m. UTC
The exit code is always checked, so let's properly handle the -ETIMEDOUT error code. Cc: Brendan Higgins <brendanhiggins@google.com> Cc: David Gow <davidgow@google.com> Cc: Rae Moar <rmoar@google.com> Cc: Shuah Khan <skhan@linuxfoundation.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Mickaël Salaün <mic@digikod.net> Link: https://lore.kernel.org/r/20240301194037.532117-4-mic@digikod.net --- Changes since v1: * Added Kees's Reviewed-by. --- lib/kunit/try-catch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c index 73f5007f20ea..cab8b24b5d5a 100644 --- a/lib/kunit/try-catch.c +++ b/lib/kunit/try-catch.c @@ -79,7 +79,6 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) time_remaining = wait_for_completion_timeout(&try_completion, kunit_test_timeout()); if (time_remaining == 0) { - kunit_err(test, "try timed out\n"); try_catch->try_result = -ETIMEDOUT; kthread_stop(task_struct); } @@ -94,6 +93,8 @@ void kunit_try_catch_run(struct kunit_try_catch *try_catch, void *context) try_catch->try_result = 0; else if (exit_code == -EINTR) kunit_err(test, "wake_up_process() was never called\n"); + else if (exit_code == -ETIMEDOUT) + kunit_err(test, "try timed out\n"); else if (exit_code) kunit_err(test, "Unknown error: %d\n", exit_code);