Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1451149lqm; Thu, 2 May 2024 15:45:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWeG1309fWAU6It7MwJQBzk/z6i877qhkBducVx1pUsN8EY9uYwLlkSnGF4hXTWI1oY75Fcz2t5cvaCHaB/q53fEoOvwA7alluQTyBfBA== X-Google-Smtp-Source: AGHT+IEv4gRzUgbNSAA+40VjlHOGQSjPbj2c7O7evXhnzPyv+4JTvwjP8xiBiXQYeSn6MFf5gpEr X-Received: by 2002:ac8:7c52:0:b0:43a:c024:b73c with SMTP id o18-20020ac87c52000000b0043ac024b73cmr894201qtv.52.1714689937963; Thu, 02 May 2024 15:45:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714689937; cv=pass; d=google.com; s=arc-20160816; b=MbIQQM7d/eHL4IwfpSuviRpSM9N69ZcP0GPaWGfTwxU+ca4T8q1jXdzi2Q8Hb2sbWc cbzRrR+Ci/gAOOYgjbnDJzfZUGBvM9XEx6gGz9IyVpb0fNdCqI7C+JTQIKnwLa8fLrs2 QX8JbziSLV9lVvprlS6xB4DZiZUviGJJJ+Lo+d7zzFrzyhmRTgqjNfPiha/xnUn1kbWQ P3sYBQTcq2wTLKWwJtt1ALv7HL/nDKQ1mSnyCLEJx+euqThbaLNWEut9vW95ts0o+PzK p+0egfYIA3TMPbofdiv5zqvcKY1dndBxIpgH6igX5lZQgFhhBiIFfoYLvfkEPQQDCXHh KFfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=Ng8wdniletCwnFQX4IxNkyDUgPARM59dfJ0NnGdDa/E=; fh=kGazLs6/kqdhlz+fQPIDqkLHsN7lxD/dA9SGlR1gBDc=; b=ezYNtvwNRt1Qfh6CTV3fS2SqK4HvW1P0xeZIym9jJ/PAf1t+K4ClYOK96wkEYy+CTu F1uGwZBifRz1/BdMEKatfuxmCmYkDsqQZjujpgTPtIerP1+iAqiB0feXACwSuqMoIsvR RbNoQDLxPK5wL6+R37oWloOmBER5T2igJvb+xfyTNz0v70i+QBsUvwIcMm4P2TWTS0Wh TuuVtK2nW9a5SEUGwdvd2DsNV9OT7PDilgEJhmo7mkfcw60dKRjk9kWCnfOzbwOcUSg/ Ljl77LqhvcAIxQ0S6u87Hn6nd3nW/FZo6L8T7lxA/ycDvJWnkltPj9xqOH6kJ8yXNQV9 6hMg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=mZ7tGXWg; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-167015-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y19-20020ac85f53000000b0043abee88835si2129270qta.291.2024.05.02.15.45.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 15:45:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167015-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=mZ7tGXWg; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-167015-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ABB1D1C22EE7 for ; Thu, 2 May 2024 22:45:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BC781C2AD; Thu, 2 May 2024 22:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mZ7tGXWg" Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB0F81B28D for ; Thu, 2 May 2024 22:45:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714689927; cv=none; b=BfkoJxqey9DMM5CpRRj4QxWbkjbm5hcRAj8BVBsd9nTEjq/e15BEHADfsPwuMbjSieKkAHayjioqeoDj4k9XLbrfZvpGQjCb+uP/n9cK3jtaNT68DAtakyds8dY1bRDw9yokXb4dSBQJJJ4yfNBFtT5Au5Gs30a+/ci5QWPXdcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714689927; c=relaxed/simple; bh=I3uuLxNzOCssz8m+55xA6cGRFEwNKBKZs5w/RJydG7A=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=qYS0QgESkn4Vx3CFRSvmODogDJuETSF0+r7p0K030YqdM3KfiMWsQipbLKt76bq3+nP/kd1CbswDlnmdEYR3HRjV2s2ClwRXTPPpJrk0EnP+sF4PMsaRAkD6rD1VVS7ugmWQ1bZu95zZQyjuXdgmvhVlO0z1lFdfZyqMyvqI74s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mZ7tGXWg; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-de60321ce6cso8423728276.1 for ; Thu, 02 May 2024 15:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714689924; x=1715294724; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=Ng8wdniletCwnFQX4IxNkyDUgPARM59dfJ0NnGdDa/E=; b=mZ7tGXWg2jZXu408aU7lE3xcxXutK/7tP//AXPMwln79e9Uh/Q1sBWEoUE7ge2WboF zH7f3QtnQc8jfOVVwpkLFtnWxNN/b0yrc+B5fPjA6FQ8Z2t8FC/mikfHTxbmPCEjHSlw qNzdvEmTYI2Zu5KVVUxrg7HbKdrg1jDDyv90eVAtCKl3WMJ0rc4WlOL6+QiWsUPd0XZx I1QxR3n/27jZqlHOVCkXqt3iTagjdJmmbKCymY4aYx3Z9Ky66yrPGVu5gPZ54Rp+OASR +Udv2+2oAcBBXqiV54G2UuQYND0PrrNQvs4i0DTejSXxOFap9d9iZIDj5Y1EVvwwQUi7 +a1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714689924; x=1715294724; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Ng8wdniletCwnFQX4IxNkyDUgPARM59dfJ0NnGdDa/E=; b=XHfyrjSsAqVNJFOvo1f/aZnOn7C3F/Movj8XnhNPfWq/rdl0clp4upuScFUZlxbnOd 06gOTQDDufIz6MHPAkIFtTMpA3FGIpd8nk4J9zJgbX3/LpGe+e/DLwC+IWLfBQoiSY1N Ol50BHoToiiYL2VfZDhoRAoqpaUyfF8IYq7Bq/0vKebN/iSbObng/ibT03B96wm1aDlx SgwADn2mJqfOtoXcrgpl0HCVBh0xYpsllho/Y9GNtKdCn24SgApN5ekYLw341YVniuGQ +REHGIxejRLXLIFpLjF9DmRMIiTbx1zg6nzXn/+GT3uQCEBVo6YO9PDKJTaxLXO/V3gZ x0zw== X-Forwarded-Encrypted: i=1; AJvYcCVzA2LsbAE0BJEf3HooD0GFTUQXzWTiWBoo+kTp3nq6vLAzIZzSg59gcZdxwRF5hiycVZbuOkhnomvyzjUbpeZiQ65cMWCeKgDE2wE7 X-Gm-Message-State: AOJu0YxKHh3g3qyvzvvYSnLpK6x+CX3pugSwYvU38fDu5ro1wZotWku9 UMPekCV15b8jGTHmK4yA3CaztW1DBlUywOwoBbO8n+kw7ZRNvpwOmu6QazCbHMcPSwOfh2Pmqpw SnA== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:154f:b0:dc6:cd85:bcd7 with SMTP id r15-20020a056902154f00b00dc6cd85bcd7mr359179ybu.3.1714689923750; Thu, 02 May 2024 15:45:23 -0700 (PDT) Date: Thu, 2 May 2024 15:45:22 -0700 In-Reply-To: <20240502210926.145539-11-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240502210926.145539-1-mic@digikod.net> <20240502210926.145539-11-mic@digikod.net> Message-ID: Subject: Re: [PATCH v4 10/10] selftests/harness: Fix TEST_F()'s exit codes From: Sean Christopherson To: "=?utf-8?Q?Micka=C3=ABl_Sala=C3=BCn?=" Cc: Christian Brauner , Jakub Kicinski , Kees Cook , Mark Brown , Shengyu Li , Shuah Khan , "David S . Miller" , "=?utf-8?Q?G=C3=BCnther?= Noack" , Will Drewry , kernel test robot , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, May 02, 2024, Micka=C3=ABl Sala=C3=BCn wrote: > @@ -462,8 +462,10 @@ static inline pid_t clone3_vfork(void) > munmap(teardown, sizeof(*teardown)); \ > if (self && fixture_name##_teardown_parent) \ > munmap(self, sizeof(*self)); \ > - if (!WIFEXITED(status) && WIFSIGNALED(status)) \ > - /* Forward signal to __wait_for_test(). */ \ > + /* Forward exit codes and signals to __wait_for_test(). */ \ > + if (WIFEXITED(status)) \ > + _exit(_metadata->exit_code); \ This needs to be: if (WIFEXITED(status)) \ _exit(WEXITSTATUS(status)); \ otherwise existing tests that communicate FAIL/SKIP via exit() continue to = yield exit(0) and thus false passes. If that conflicts with tests that want to communicate via _metadata->exit_c= ode, then maybe this? if (WIFEXITED(status)) \ _exit(WEXITSTATUS(status) ?: _metadata->exit_code); \ Or I suppose _metadata->exit_code could have priority, but that seems weird= to me, e.g. if a test sets exit_code and then explodes, it seems like the expl= osion should be reported. > + if (WIFSIGNALED(status)) \ > kill(getpid(), WTERMSIG(status)); \ > __test_check_assert(_metadata); \ > } \ > --=20 > 2.45.0 >=20