Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2014818ybv; Fri, 21 Feb 2020 07:21:07 -0800 (PST) X-Google-Smtp-Source: APXvYqxcK7OGybwYfsBfGH/RFUAVEO2eHDmBcnIHsJaUW9VhOStudtgJGZ06AwTFIbiW3MpnYule X-Received: by 2002:aca:4994:: with SMTP id w142mr2325621oia.178.1582298467137; Fri, 21 Feb 2020 07:21:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582298467; cv=none; d=google.com; s=arc-20160816; b=XOQ9baCtbqU5yMMmdiWQCFIZu0j0Z1xR4AtNNJnYeT59nLurmXXOsiwuhOM0wFzUKU 0wcuFKug9vla8UnmT9j+FRBgp/orYFbK6qTp8WOdQTb7A9+/6Ra5M5BATwvxrGjHKy2P 0LEz4L72TssonRSN2zUo+ZxubE88NihO7gRwsU/TwOW0nlI3eeJnL8VJJydyR0gQwRRH lubWYrnUla79X+r+OAOLRgXdH9q/QENl27D9FICqekBJTdduPTJUHdrKbmZZgiEoWT/7 aCCre5Kwu8ag0K54kVjbwa8KoBXKkOvYawa//j3S+pFh5c6IQcw/RmaXoJOBaO9jR7lK foJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=SX7k/vfQV/dhyQP7ClRzTcNKQX94s9izZKM/kr6C8dY=; b=VLqzh9+K56s7wVpFz+oHFkeFwScFnRSn61FBRECfDSDQR0CUvUOAaUZMn/OPrLkrl5 aShqIT8l+EuTtirr/ZiitnusmCl0EUSYHGgEhmmnsk/8pLVM0qciuzXhsXFY/NR8xbOi oqwWBij0lsv/O3rbRYfu+UqPh6yEpjsXPIvRRA7In1HociBFlnQQcaBlDacgnT12KeE/ Nn3c8t/Xirzlgco1v6OK9EwlbvQNc6X0X38P1eH8q34BtZbY/Mp7KxL8RLHaLFod1FYC HUVa4XsIMvtx9rhUSB+Ml7b8VL+Yqj9gnRmdw7dMyyhVx247hJISEaWH/S5n4L6A7elw RmuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=d2szQq4p; 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 y6si829867oih.217.2020.02.21.07.20.53; Fri, 21 Feb 2020 07:21:07 -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=@linuxfoundation.org header.s=google header.b=d2szQq4p; 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 S1729062AbgBUPT7 (ORCPT + 99 others); Fri, 21 Feb 2020 10:19:59 -0500 Received: from mail-il1-f193.google.com ([209.85.166.193]:47103 "EHLO mail-il1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727352AbgBUPT6 (ORCPT ); Fri, 21 Feb 2020 10:19:58 -0500 Received: by mail-il1-f193.google.com with SMTP id t17so1887373ilm.13 for ; Fri, 21 Feb 2020 07:19:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=SX7k/vfQV/dhyQP7ClRzTcNKQX94s9izZKM/kr6C8dY=; b=d2szQq4psDdAZ2NrsbGdyppq9zPx9TfbathddBEW7BQkNKcY7+Nvti9PY6H2821yOG dCjWcr4TmsHXmCLUbLo8aqbuy9nCnYtsxul9U/skDECmY3z+3uqOQi4BGvIMCrzTWiS6 mbl0POX5r94ZmNzClM/MaiQ/akzYT1i+qTjNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SX7k/vfQV/dhyQP7ClRzTcNKQX94s9izZKM/kr6C8dY=; b=KCa/WiQYc/VSA1+BezWocqQaZjpBbuvvDwn7+wOF00OhDUgSVCOWN3w6UStrHGZFMz oSr3pilW+2Qkr1zJ5QMwbrCsywnfNR3PFJVjW64Mcgp0Muip8ncUv8uoByns34w/yIQe 3B5yzk/RNX9tdKwg3iOLLS3+eJFMCbrga4io3cqQZHbO9j1rcckjWyRgOcFiKMJlsS0R yOplss/J6T6gRA8XBQNNpAw2NW5UMHfdzk8eSJqXyF4G9Z3aIfDr+e9fpH03fYBHWoDK 1f5PYFC/RsS+evoXb+jRZJ0kQBlMpP4yX+rsdNu+E74cm/bbMcLIMyEVEb5Te8LbXOii gPVA== X-Gm-Message-State: APjAAAVW4gw+NqRG28/39x/vnVGKgb0/GIiXlHRyDuUiA7YHA4EKcknC RD0UZOO4MhQKcmAnxBXGo88oQA== X-Received: by 2002:a92:8307:: with SMTP id f7mr38094818ild.73.1582298397884; Fri, 21 Feb 2020 07:19:57 -0800 (PST) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id r10sm771889iot.28.2020.02.21.07.19.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2020 07:19:57 -0800 (PST) Subject: Re: [PATCH] selftests: Install settings files to fix TIMEOUT failures To: Michael Ellerman , Kees Cook Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20200220044241.2878-1-mpe@ellerman.id.au> <202002201450.A4BB99421@keescook> <87o8tsed6s.fsf@mpe.ellerman.id.au> From: Shuah Khan Message-ID: Date: Fri, 21 Feb 2020 08:19:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <87o8tsed6s.fsf@mpe.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/20/20 10:12 PM, Michael Ellerman wrote: > 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. I am not seeing a whole lot of benefit in doing this in lib.mk Test authors have to think about which files to include in TEST_FILES and add it to Makefile anyway. My second reason is I would like authors to think about the settings as opposed to just duplicate from another test. This timeout changes the kselftest run-time and behavior. I am also finding making features generic has downsides to it unless we are smart about it. We have several overrides already for things that made perfect sense to make generic. > 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 > Thanks for the patch though. We can consider adding it a later time, if we see value in making this generic. thanks, -- Shuah