Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2517618ybc; Sun, 17 Nov 2019 23:44:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwM10cJdT/GU3jp3C7h2deM0XBIVHpL5BJJ/bkyjLA99TBnYcTtpEcYOGfaADH+j4W0ZWlj X-Received: by 2002:a17:906:d143:: with SMTP id br3mr24712487ejb.215.1574063059433; Sun, 17 Nov 2019 23:44:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574063059; cv=none; d=google.com; s=arc-20160816; b=GvcvtfBUgYwGV8b//gEQwzK9BaTdk4qteLxjwm8i5bUbVcbWsedIY3jJIvyRbujuTz 3wNJgNVRG0uo6STroOCqa+foHEpaW+O5nU+jMo8qxndjiNvdZGBHEANJkXJW4X84Yl2Z z/A6AmquOqKbwR8BQvbT2cknG6o5EWOOAnQ0O0sYYqHjBRkeDa3R/6DnK7LhNSg1avaY 7VWc3bx15TpQ3eRNsKL9FCn1gTCBiBQ096tVu0VtPL723jthZRIbNsq51j4DVFxO6wI+ dmWeTfRlWu+ynFQ0NJzWGRmE3eBZJ1oseasI28akIAno+xgIn8n+SGs9mdi6hzbVel8X WmUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=CqWwMIle1hTMGQ75ktxITuz4yZnatFPrXRhS7PX8P0U=; b=p5Bv6Verfr7gGYVI/vXjL5vBHG9p+GnXJBUBC5u2OBxbzsxawADTrJFIF6uC/NkdFT sb7CW+cxXIr+bcmv6C/Puudy5g/KSbD+MkpvU++hqMncbxgaA6ZOqtqu38DhQSC1hgqA /aoO0vpBuOM736WUyr+OzEVt6OaQxZPkDQ/yCIFWk5hw9Y0q+HVDs/TlSyx6DTTyypkp Jte6PUUpLQ4+Uv7EET/Whxl+FK1RXa9371gXmwczovAFU2nnyy0IvpO2nUOCurNSjhhO Sl3cEdQjFybOHpGUn1g9ypSnGodbpUU9yQJrcfozEU3NhhyXLO3fhWQWM0VryY0kHuWk W/Gg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rv3si11030797ejb.249.2019.11.17.23.43.55; Sun, 17 Nov 2019 23:44:19 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726607AbfKRHmn (ORCPT + 99 others); Mon, 18 Nov 2019 02:42:43 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:48317 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726425AbfKRHmm (ORCPT ); Mon, 18 Nov 2019 02:42:42 -0500 Received: from [213.220.153.21] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iWbg8-0004wZ-Kx; Mon, 18 Nov 2019 07:42:32 +0000 Date: Mon, 18 Nov 2019 08:42:31 +0100 From: Christian Brauner To: Andrei Vagin Cc: Adrian Reber , Eric Biederman , Pavel Emelyanov , Jann Horn , Oleg Nesterov , Dmitry Safonov <0x7f454c46@gmail.com>, Rasmus Villemoes , linux-kernel@vger.kernel.org, Mike Rapoport , Radostin Stoyanov Subject: Re: [PATCH v11 2/2] selftests: add tests for clone3() with *set_tid Message-ID: <20191118074231.fvczfgrbinzgajqg@wittgenstein> References: <20191115123621.142252-1-areber@redhat.com> <20191115123621.142252-2-areber@redhat.com> <20191118014642.GC391304@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191118014642.GC391304@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 17, 2019 at 05:46:42PM -0800, Andrei Vagin wrote: > On Fri, Nov 15, 2019 at 01:36:21PM +0100, Adrian Reber wrote: > > + if (!WIFEXITED(status)) > > + ksft_test_result_fail("Child error\n"); > > + > > + if (WEXITSTATUS(status)) > > + /* > > + * Update the number of total tests with the tests from the > > + * child processes. > > + */ > > + ksft_cnt.ksft_pass = WEXITSTATUS(status); > > I just found that accounting of failed test cases in this test doesn't > work properly. And if one of the test cases fails in a child process, > the whole test will have the pass status. > > > For example, if we add a fake fail: > > diff --git a/tools/testing/selftests/clone3/clone3_set_tid.c b/tools/testing/selftests/clone3/clone3_set_tid.c > index 3480e1c46..82c99c42f 100644 > --- a/tools/testing/selftests/clone3/clone3_set_tid.c > +++ b/tools/testing/selftests/clone3/clone3_set_tid.c > @@ -301,7 +301,7 @@ int main(int argc, char *argv[]) > * namespaces. Again assuming this is running in the host's > * PID namespace. Not yet nested. > */ > - test_clone3_set_tid(set_tid, 4, CLONE_NEWPID, -EINVAL, 0, 0); > + test_clone3_set_tid(set_tid, 4, CLONE_NEWPID, -EPERM, 0, 0); > > /* > * This should work and from the parent we should see > > $ make run_tests > .... > # ok 21 [21104] Result (0) matches expectation (0) > # # unshare PID namespace > # # [21104] Trying clone3() with CLONE_SET_TID to 21106 and 0x0 > # # Invalid argument - Failed to create new process > # # [21104] clone3() with CLONE_SET_TID 21106 says :-22 - expected -22 > # ok 22 [21104] Result (-22) matches expectation (-22) > # # [21104] Child is ready and waiting > # ok 26 PIDs in all namespaces as expected (21106,42,1) > # # Planned tests != run tests (27 != 26) > # # Pass 26 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 > ok 3 selftests: clone3: clone3_set_tid Thanks for reporting this. With your patch series you just sent this problem should be addressed. Thanks! Christian