From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02A013009C7 for ; Fri, 20 Mar 2026 13:12:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774012328; cv=none; b=dmfR7mjJe2yRfkq38jSo7ozmoswDzLhg9f3vDHHHtXYFhY/C38aWJr+aEKz+9gAycDj6pQaVdLzfN805c9ha8y0yB4ganrkCmEvIK05a5iSm8GWEqSeGg+4LAknVsqlUvgrJwWt6CPJhtC4JzrB+xV/WKJKjEZssrb+EKNBj8AE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774012328; c=relaxed/simple; bh=i0a09aXhOP/QlBqzizvEoGUl0WgcS81yzRiwfsaclx4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ilYQ6Y8tLcg/+yn67DP4OIbMYh7orD+olwHnGSoQkTc8XkAxx+A2HxfiHA8hGkuWHJywWHlT7ZdShR0PL63f59bOSAWfgcsrYRSFdUkKUlc6KU3lpzkg4mxSCrT1KTeKXOV3mkWyjizrNpfr9ijTf4QvRDxy7mrLFxn5y0ISKEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=MHQk18xd; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="MHQk18xd" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4870206f73bso2135265e9.3 for ; Fri, 20 Mar 2026 06:12:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774012325; x=1774617125; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XuiKHSkZ3E5unJ4q4dyvIHV5c5AfIhyVuPpE5qhhaFU=; b=MHQk18xddch3LA4u1Cq/Am55SsN1zw+h8A1Kq5NvvDvpg8CNhe9JWX58dZZk+oz/XX YoZiJfLPPv+a3veMOjiTwgVBmlVTugxKMa9ULfk0Kd08CvljTlOQSGp2SocShfwCSFCy /eLlm+HT4Kt6MFtlqePMIcqy7aJnm+jD6V8dKhvp1fUuzdpXtbehqr2G4+0BZapeLOD6 bS2KtvHcWSvxgHeXXtPFm2334SBHKR20ztjsfMQY+MxJxyi7Pz+znAaxZWONaFkA9+PP Zc0e4PKBFJZVgFIoIBkNRC4iLRph9yRRM4el9OD1uYBZ7i+s3XXhzlanuv5obDdnt1ta 5vbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774012325; x=1774617125; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XuiKHSkZ3E5unJ4q4dyvIHV5c5AfIhyVuPpE5qhhaFU=; b=AvMWYjD2JTSoDtGARSXuUwHKOHRBjgqjxF/G/JNArlXYz4e50sj35NTaC5W/WSGqzw /xQrQ25A5ahJ3ZfCm4ilF5nWngAU//h3CqFH/cEcFojOk11+4k9/+FRHBraO56ms1VC8 XwI2cIllH3NotvNigU9sAOqkxKBy3BQSYpR7WweGGrvu6l/ypRDOLfMaKHbd7bVTCDpi Ca32uGPK0HRyTY8bKChn5uDG4ZDY27ngU7u/eSxoXOzURqp4ZY7Q5t9jxrWZ/ZqfsiOf GXw1mNNhxIkhlVbx2+H9Hcft67yFT7vVYPQMvnZEN4Mzz3WoOsoGXwmONmz2NTYxzPLe mAVQ== X-Forwarded-Encrypted: i=1; AJvYcCUGZtGQICvwVtKvaQEoc6+QqJppW5kJCYqwHB0LqWkfMyOqdvDTUO+QDE4N4ENrEIWc1rO8XAt3Txd0qn0=@vger.kernel.org X-Gm-Message-State: AOJu0YwAy8zhAceM7oSoi+IyKg924efMyYwvdvHBStIRj9RlVqN6ke15 Q0U2pqbZHFU+e3QWriSGLxDovD4dhCa+Hh9HLVg6hRTIuCnCG9lugqemnFOzOjLcT88= X-Gm-Gg: ATEYQzxzhK7OIkYtgZDCvd4WjQs/nBF2szadpjk5MAv5AZ3I6sG+Rch+Py0AYjOPc84 bZlCBWMyFlHyhAPW5Ar2oq7TlOhR+/mVZIhuFCG+E0EgcB08VsIBnD5T/jqe48C+GMc9N/TVOk2 CEZ/KX4qYbxgyHYmxMAlgTGuLNn5sK8q0lbN2P4th2PnxZ2SdK0jR6D2AYBz78RsDg6m8fPdJou bFMHihDxhWg94RurFNlil+ZIsL5AzCH0HU6qMM/lWhILGPQZJA5gmYiwtAxqlKkk1/PKkJReZYf HFYAGRMgHPvETlUqleT3Cd65dQ6koSNoutX7Az+sU79KEay5pRRzLFQdQtPz4CEUVC+lGxDwa8F nRVvw3237vEqP98nSwUeqAk9Vz9re1qXQv7cBuacaTdvPnyTscYy/Rf8pX+OA1DQKNXvWdmjU9i sIg4PmYJgG3CTqNhazkXxFRkAZUA== X-Received: by 2002:a05:600c:3e16:b0:486:fad0:b166 with SMTP id 5b1f17b1804b1-486fee0b74emr47326835e9.17.1774012325282; Fri, 20 Mar 2026 06:12:05 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b64703c27sm6624281f8f.18.2026.03.20.06.12.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2026 06:12:04 -0700 (PDT) Date: Fri, 20 Mar 2026 14:12:03 +0100 From: Petr Mladek To: Marcos Paulo de Souza Cc: Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Joe Lawrence , Shuah Khan , live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/8] selftests: livepatch: sysfs: Split tests of replace attribute Message-ID: References: <20260313-lp-tests-old-fixes-v1-0-71ac6dfb3253@suse.com> <20260313-lp-tests-old-fixes-v1-5-71ac6dfb3253@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260313-lp-tests-old-fixes-v1-5-71ac6dfb3253@suse.com> On Fri 2026-03-13 17:58:36, Marcos Paulo de Souza wrote: > In order to run the selftests on older kernels, split the sysfs tests to > another file, making it able to skip the tests when the attributes > don't exists. > > No functional changes. > > Signed-off-by: Marcos Paulo de Souza > --- > tools/testing/selftests/livepatch/Makefile | 1 + > .../selftests/livepatch/test-sysfs-replace-attr.sh | 75 ++++++++++++++++++++++ > tools/testing/selftests/livepatch/test-sysfs.sh | 48 -------------- > 3 files changed, 76 insertions(+), 48 deletions(-) > > diff --git a/tools/testing/selftests/livepatch/Makefile b/tools/testing/selftests/livepatch/Makefile > index a080eb54a215d..b95aa6e78a273 100644 > --- a/tools/testing/selftests/livepatch/Makefile > +++ b/tools/testing/selftests/livepatch/Makefile > @@ -10,6 +10,7 @@ TEST_PROGS := \ > test-state.sh \ > test-ftrace.sh \ > test-sysfs.sh \ > + test-sysfs-replace-attr.sh \ > test-syscall.sh \ > test-kprobe.sh > > diff --git a/tools/testing/selftests/livepatch/test-sysfs-replace-attr.sh b/tools/testing/selftests/livepatch/test-sysfs-replace-attr.sh > new file mode 100755 > index 0000000000000..d1051211fe320 > --- /dev/null > +++ b/tools/testing/selftests/livepatch/test-sysfs-replace-attr.sh > @@ -0,0 +1,75 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (C) 2022 Song Liu > + > +. $(dirname $0)/functions.sh > + > +MOD_LIVEPATCH=test_klp_livepatch > + > +setup_config > + > +# - load a livepatch and verifies the sysfs replace attribute exists > + > +start_test "check sysfs replace attribute" > + > +load_lp $MOD_LIVEPATCH > + > +check_sysfs_exists "$MOD_LIVEPATCH" "replace" > +file_exists=$? > + > +disable_lp $MOD_LIVEPATCH > + > +unload_lp $MOD_LIVEPATCH > + > +if [[ "$file_exists" == "0" ]]; then > + skip "sysfs attribute doesn't exists." Nit: I would write "is not supported by this kernel version" instead of "doesn't exist". I think that it better describes the situation. "doesn't exist" sounds more like an error description. > +fi This extra code is repeated in 6th and 7th patch as well. It would be nice to hide it into some helper function so that we could use here something like: check_sysfs_attr_or_skip "replace" or if has_klp_sysfs_attr "replace" ; then skip "sysfs \"replace\" attribute is not supported" fi Best Regards, Petr