From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CC93C3524A for ; Tue, 4 Feb 2020 06:41:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E43D22087E for ; Tue, 4 Feb 2020 06:41:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iu0Id/we" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726684AbgBDGll (ORCPT ); Tue, 4 Feb 2020 01:41:41 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42677 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbgBDGll (ORCPT ); Tue, 4 Feb 2020 01:41:41 -0500 Received: by mail-pg1-f196.google.com with SMTP id w21so3392470pgl.9; Mon, 03 Feb 2020 22:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to; bh=yaKe1siexgkghfuXyyVMtu7FqrPaWKb5BcT/yW/rvqU=; b=iu0Id/we7thuNm03dUaMlyf4jqnKVPQG1JuqxwLwkHPLkPJSyAMl/d9dA0g9eya/8J qWDf8vf0J+QM8EXG4cqHrZAZdVlXxybScgwFi8ZjCTPRps7RYVglw+XvUndPNVQupqny j1H67WjnJ8X2PxOc3XD7h8AvyNJ9BFaFMb8mVtuSC13XNxr5hON63Y96TvygYV+axq8o PZcieNKw37aQEcQRX14WfGZR8HGz+AewTQsCF6p/dR+dWX//G9LvCVLmemlTqEOX/Pz7 vsNT0sTVX96pipG9y0uYGNjNlSPa74PNo6GfNhsd+lb4lzOuMvif2pCUGMyRkNuZNP7x GznQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to; bh=yaKe1siexgkghfuXyyVMtu7FqrPaWKb5BcT/yW/rvqU=; b=AL9CbbXJL8QR49dKiw4Uk/2Up/REv9nahabsTWmmtaT5W6GrOLapdzPcoHkQG6WvZb PWmeUUxckH5WQUuhoZwcBZ50Sgkw8NhXbb+1U35yzpbfLJPh4Ul7KGymm44bzg2AvpLc EvnsgCNO/iClds/bUvuZ8YMIUXaLWmaT68yEsvBtqIkJKjaQSBb3brgkqepmF+BFil7x jD1/zEdGTuX/KZe6HSPwm15NGzVFRJkNjBho5oVhsHZ+eJ4rFMSin5ZFcQe0ZmjmFAm9 leDmj7wONiyWQCW/al/rCouwkTnKWSFRENjg4Mr7VAnkDaehQuqO4ray1EjA6do9RSCP gROA== X-Gm-Message-State: APjAAAWeoamc7qWUAJ61loLL7qTO6IV3LstVh7JFcaoH6CLBoKfYouPC a9sDh7bM9tJruQMk8k4f53o= X-Google-Smtp-Source: APXvYqzkD7oRT/xhxds+G4gJnMatFwe0kUy0+D+knfi/41Azmd6utM5/Dsy6nF0wRcwHVn4tzM+v6Q== X-Received: by 2002:a62:1dca:: with SMTP id d193mr29801977pfd.140.1580798499088; Mon, 03 Feb 2020 22:41:39 -0800 (PST) Received: from localhost.localdomain ([106.254.212.20]) by smtp.gmail.com with ESMTPSA id v7sm22547213pfn.61.2020.02.03.22.41.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 22:41:38 -0800 (PST) From: SeongJae Park To: sj38.park@gmail.com Cc: brendanhiggins@google.com, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, SeongJae Park Subject: Re: [PATCH] kunit/kunit_kernel: Rebuild .config if .kunitconfig is modified Date: Tue, 4 Feb 2020 07:41:29 +0100 Message-Id: <20200204064129.4947-1-sj38.park@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200126015924.4198-1-sj38.park@gmail.com> (raw) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping? Thanks, SeongJae Park On Sun, 26 Jan 2020 01:59:24 +0000 sj38.park@gmail.com wrote: > From: SeongJae Park > > Deletions of configs in the '.kunitconfig' is not applied because kunit > rebuilds '.config' only if the '.config' is not a subset of the > '.kunitconfig'. To allow the deletions to applied, this commit modifies > the '.config' rebuild condition to addtionally check the modified times > of those files. > > Signed-off-by: SeongJae Park > --- > tools/testing/kunit/kunit_kernel.py | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py > index cc5d844ecca1..a3a5d6c7e66d 100644 > --- a/tools/testing/kunit/kunit_kernel.py > +++ b/tools/testing/kunit/kunit_kernel.py > @@ -111,17 +111,22 @@ class LinuxSourceTree(object): > return True > > def build_reconfig(self, build_dir): > - """Creates a new .config if it is not a subset of the .kunitconfig.""" > + """Creates a new .config if it is not a subset of, or older than the .kunitconfig.""" > kconfig_path = get_kconfig_path(build_dir) > if os.path.exists(kconfig_path): > existing_kconfig = kunit_config.Kconfig() > existing_kconfig.read_from_file(kconfig_path) > - if not self._kconfig.is_subset_of(existing_kconfig): > - print('Regenerating .config ...') > - os.remove(kconfig_path) > - return self.build_config(build_dir) > - else: > + subset = self._kconfig.is_subset_of(existing_kconfig) > + > + kunitconfig_mtime = os.path.getmtime(kunitconfig_path) > + kconfig_mtime = os.path.getmtime(kconfig_path) > + older = kconfig_mtime < kunitconfig_mtime > + > + if subset and not older: > return True > + print('Regenerating .config ...') > + os.remove(kconfig_path) > + return self.build_config(build_dir) > else: > print('Generating .config ...') > return self.build_config(build_dir) > -- > 2.17.1