Received: by 10.192.165.148 with SMTP id m20csp681278imm; Fri, 4 May 2018 18:15:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrgrHzb45xCw9ZB8nMi0lN+2aFfob0eoqJHBBJSUW8d+U2nOU0AHEeiULvv9Id1QQ9c0y73 X-Received: by 2002:a63:a50a:: with SMTP id n10-v6mr24242286pgf.141.1525482916323; Fri, 04 May 2018 18:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525482916; cv=none; d=google.com; s=arc-20160816; b=PYrtnwHVdtUHeMORWCLtGTQqcgURRrBngOTYF3CsefoPkUEBeqFANUocTOfbiMoH4T JzVQPSfKAQWi70GsYl3tXhL56+zGyAKIG8qC4L+H4LpJ80MXnHGWRCTtVtJkW8RhYawD 6+h84fmymyRJZarC8RB2zL7kUegYHqZfw947/EWSLQxmaUv/ljTr0TmkLchY7u7zK1XD zOMVQUw2AUybobktwghmC9h0wOEb5VZHr7EJ/kXYTxlPnyzHWl205bMl0MMVgMxvPIhX z1JwizCtrGDj/igGk1JhVZIqnktRiHE29WqDVteqFYIATsd0dG01KXbjbJUXT3c5dW1e QA1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=JMYRmjupOBSghEYJGsNXeVLtzOfRNPfpIY0Ml4nZGLQ=; b=NDBw4jrmm4u1GmNh7gHPC25uJpur2jHhog6t7xEHdhaxqYt1hmqpo3AYfcO/Y2u3Ei 1jSzkeGgajDQVHJuG6QfihXVkm1IPfVdh00qa53Z9sHRd+z4+7GWXHCPgAHvOjOGDEVU 4Wud388N5eFQf2/0G3niNpnBPJ8jBPOP74WCgmvNhO275EqJvkzJtbka+9gyjwCgi5Ef KS91iw1b9/4QqS0Y+SFl/BAnYpFgHcRjZGdazvxAMyAqJ0gCSTUvnFm2+/BlIhboEuRZ /dIja6cqQbtO2uI8vicsRqVgCC52CE0a4G9cr1013rzlithPMmHVESBlrInSErMbK9pK DZBg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v26-v6si13895726pgc.230.2018.05.04.18.15.00; Fri, 04 May 2018 18:15:16 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752003AbeEEBOh (ORCPT + 99 others); Fri, 4 May 2018 21:14:37 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:50389 "EHLO mailout.easymail.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeEEBOg (ORCPT ); Fri, 4 May 2018 21:14:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id BAB8A21235; Sat, 5 May 2018 01:14:35 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo02-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NT7OPANB7BiZ; Sat, 5 May 2018 01:14:35 +0000 (UTC) Received: from localhost.localdomain (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id E64D321020; Sat, 5 May 2018 01:14:29 +0000 (UTC) From: "Shuah Khan (Samsung OSG)" To: shuah@kernel.org, smuckle.linux@gmail.com Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/24] selftests: exec: return Kselftest Skip code for skipped tests Date: Fri, 4 May 2018 19:13:10 -0600 Message-Id: <20180505011328.32078-6-shuah@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180505011328.32078-1-shuah@kernel.org> References: <20180505011328.32078-1-shuah@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When execveat test is skipped because of unmet dependencies and/or unsupported configuration, it exits with error which is treated as a fail by the Kselftest framework. This leads to false negative result even when the test could not be run. Change it to return kselftest skip code when a test gets skipped to clearly report that the test could not be run. Change it to use ksft_exit_skip() when kernel doesn't support execveat. Signed-off-by: Shuah Khan (Samsung OSG) --- tools/testing/selftests/exec/execveat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/exec/execveat.c b/tools/testing/selftests/exec/execveat.c index 67cd4597db2b..47cbf54d0801 100644 --- a/tools/testing/selftests/exec/execveat.c +++ b/tools/testing/selftests/exec/execveat.c @@ -20,6 +20,8 @@ #include #include +#include "../kselftest.h" + static char longpath[2 * PATH_MAX] = ""; static char *envp[] = { "IN_TEST=yes", NULL, NULL }; static char *argv[] = { "execveat", "99", NULL }; @@ -249,8 +251,8 @@ static int run_tests(void) errno = 0; execveat_(-1, NULL, NULL, NULL, 0); if (errno == ENOSYS) { - printf("[FAIL] ENOSYS calling execveat - no kernel support?\n"); - return 1; + ksft_exit_skip( + "ENOSYS calling execveat - no kernel support?\n"); } /* Change file position to confirm it doesn't affect anything */ -- 2.14.1