Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1469156ybv; Thu, 20 Feb 2020 21:12:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxiYAjPoTFUUvheBaf5T9j/PUN13a4TRbNbTt9eYNxl+65ek1CQ0aThfGO6hnx9Oc3jW8DL X-Received: by 2002:a05:6830:1651:: with SMTP id h17mr25265517otr.167.1582261978398; Thu, 20 Feb 2020 21:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582261978; cv=none; d=google.com; s=arc-20160816; b=qY1uD8y0u0N3e06l8BMVz6iCElYOEbF6uXM2qmO9xZZoeJH2fhj8rrdDP1mRThREAl yavgLNGifQLJ6FwfUH33J6U40Hw8nA9ttUy8KScp4OuEl//enEY6VOPpNPeFmi14V1io 3ZDxeiuUEEDv74wY/LiKxegmzL/OyqPbST9UcKJGM+dgI1+NqEt8fgco+G65sdGlmvE8 FwFs+AetwePGni5IA/BgW3wWVZP3T0fdPj39t88bW92QtWjJbslper7YGyvdbueja/2R EN+ufaEjuCZ3yqE3+0v+713HiBFBDysyej4UOGJWYSsemPBESgrS9GtjQpZnzuYU7trA z/Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=xXe7fKZqMl/qwNgrqJA9r6OJTASmz4/DQx4xGHyo/7g=; b=Sk7euiCDWBprQBsWr/z17Fe5+drRqQzFGG/LQvHVQZU4PqcPgvP/88tMGLP+lmZJYn sSBlHAxiJDSV7WZbk+KjS3fSVDzXL6XkR9ZMnCx8LgCa1qYIDK+jyXMMWOy8vhu/+1+i 1Y5fylLX0+wuTwsXWFuk3VRuftpaIux5bHsxEFpi3OYaPzCN/hS/rQ94leGuzqpaozXH wibL/gsZSRR5l9IFPsFms8A1vVFUe+3abmamJly+jEafeqPtWw+3AEkESreP4u1jX05T hy3NEp439lc3TVgSL7qV2NOvE9+MNImi4Mo6Qln3OGH/3fbsfa5eQ/JXkY9dw8n8l8F5 WtZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=R+XtdpLE; 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 94si894217otw.297.2020.02.20.21.12.46; Thu, 20 Feb 2020 21:12:58 -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; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=R+XtdpLE; 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 S1726258AbgBUFMd (ORCPT + 99 others); Fri, 21 Feb 2020 00:12:33 -0500 Received: from ozlabs.org ([203.11.71.1]:53129 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbgBUFMd (ORCPT ); Fri, 21 Feb 2020 00:12:33 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 48P02R2Bh2z9sPk; Fri, 21 Feb 2020 16:12:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1582261951; bh=VN01LPmrMRRE7xnQaiPGlfuivp3p3nCGU9JeUtjz/7s=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=R+XtdpLEozvcl4JlLLYpijxvQ3ZHQ0ZijmxlvQlNWwRx5fdDNKl9AtanwNuf6YSnh 9t1peF/9ZWC5WMOdzPPuJNIGWAMxXbNxqjnpYJVEqCqxG7VLMQekya3eZw6PHNITGr /Uudf/Qlewr4yRXBn7cmfEcwW/EwwUf12ltS5B1QVQTNqK8uHTpCIdmA4FptDytkTV nUv0Esfr9v0ndMoSJGXvqvdF6aaVYqERN55P/NGlpvQxCuBhdTA+sjiSNPePE3G/QZ 5Fzir81AZ0ix9bnCLr18CH7u44SrcOaXxL5pJmAsnF2eVb06236eBMPt8e37z21I0x 6IY7O9q0I5gqg== From: Michael Ellerman To: Shuah Khan , Kees Cook Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan Subject: Re: [PATCH] selftests: Install settings files to fix TIMEOUT failures In-Reply-To: References: <20200220044241.2878-1-mpe@ellerman.id.au> <202002201450.A4BB99421@keescook> Date: Fri, 21 Feb 2020 16:12:27 +1100 Message-ID: <87o8tsed6s.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shuah Khan writes: > On 2/20/20 3:51 PM, Kees Cook wrote: >> On Thu, Feb 20, 2020 at 03:42:41PM +1100, Michael Ellerman wrote: >>> Commit 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second >>> timeout per test") added a 45 second timeout for tests, and also added >>> a way for tests to customise the timeout via a settings file. >>> >>> For example the ftrace tests take multiple minutes to run, so they >>> were given longer in commit b43e78f65b1d ("tracing/selftests: Turn off >>> timeout setting"). >>> >>> This works when the tests are run from the source tree. However if the >>> tests are installed with "make -C tools/testing/selftests install", >>> the settings files are not copied into the install directory. When the >>> tests are then run from the install directory the longer timeouts are >>> not applied and the tests timeout incorrectly. >> >> Eek, yes, nice catch. >> >>> So add the settings files to TEST_FILES of the appropriate Makefiles >>> to cause the settings files to be installed using the existing install >>> logic. >> >> Instead, shouldn't lib.mk "notice" the settings file and automatically >> include it in TEST_FILES instead of having to do this in each separate >> Makefile? >> > > Let's keep it custom per test for now. Yeah that seems less magical. FWIW the patch below does work, so it's a small patch, but I'm not sure it's worth the added complexity vs just listing the file in the few tests that need it. cheers diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 1c8a1963d03f..82086c6ad5e7 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -20,6 +20,10 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS)) TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED)) TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) +ifeq ($(wildcard settings),settings) + TEST_FILES += settings +endif + ifdef KSFT_KHDR_INSTALL top_srcdir ?= ../../../.. include $(top_srcdir)/scripts/subarch.include