Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp976928ybp; Fri, 4 Oct 2019 07:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFyDx/YRBoJ1WELKDiRfNS4eyS8CBd1CpNQBpxnZ+EjixZHQD4FO33ZWh7spiHcfcu0wRe X-Received: by 2002:a50:91d0:: with SMTP id h16mr16082508eda.152.1570200645966; Fri, 04 Oct 2019 07:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570200645; cv=none; d=google.com; s=arc-20160816; b=Z7MfmoDTbiJFz1ANqj2a2fG+GIBB37AsJpI494o5o+qcsNSffCJslCMXB3Ac1FEatr dV0wBK5HnPqPUdI4+JXrHUwjmGthUt31E2hKZMXLw3EjSyTT0XK0+Za4sI42AVhAZU7q MH+hKzf3bEw5Jxw76tnb2Wqu3S7ve2a+FoId3oD1+ao8N12sXtSV8EDvWPt+Ki9nQL1T wW08hec2K46JH9BDSRRGEscpolkHlXIc+/G9MURUnmwbKNBd3AptPOoszFd7F30YWxL4 l8MeOXMAN4JPy6RGi8cRbrtoCqvyrKmbbmm8+JNTBiaL57IChz6H93AIM53EqEY9iGit rDNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VKDj3fACsT62jR9D1oUH3bx4e5/BCe8DEUE2Yt6++hc=; b=Yq07Hm5/ttSKmTnI1TR+PJZD53KAOnetn8HiUaFh3ishK0nLLl11p1rlltfS7496YD M5SIrDdaOU3m/IDb8ypTFv2qwvUt3d85ui/tXbH2x99L1w+YM0caaUjY2vBxVNWCaun+ sxgHAkOl+ebVpL4pK1cCrZe54rqOLG2cvs7lT4wMEKSbaHY1qlh5i/AhyX+lnnvy1dSc t7sDTNCh5yzSgF9JK4274DWrxE1LrMdRz4HqyyvIz8IgasMGbAE8EVDglUEFU+E81HA/ mFSgYue3Wa8FVpvmr6uIEirK01m62M+fgvImmyG4zkYJaWKC5u+AHBC5W0NFf005SksK 6jlA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3si3556270edu.432.2019.10.04.07.50.21; Fri, 04 Oct 2019 07:50:45 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389390AbfJDOrr (ORCPT + 99 others); Fri, 4 Oct 2019 10:47:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45326 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388870AbfJDOrq (ORCPT ); Fri, 4 Oct 2019 10:47:46 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D55892CD7E5; Fri, 4 Oct 2019 14:47:45 +0000 (UTC) Received: from redhat.com (ovpn-122-165.rdu2.redhat.com [10.10.122.165]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A17E61017CD5; Fri, 4 Oct 2019 14:47:44 +0000 (UTC) Date: Fri, 4 Oct 2019 10:47:42 -0400 From: Joe Lawrence To: Petr Mladek Cc: Jiri Kosina , Josh Poimboeuf , Miroslav Benes , Kamalesh Babulal , Nicolai Stange , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 5/5] livepatch: Selftests of the API for tracking system state changes Message-ID: <20191004144742.GB3768@redhat.com> References: <20191003090137.6874-1-pmladek@suse.com> <20191003090137.6874-6-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191003090137.6874-6-pmladek@suse.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 04 Oct 2019 14:47:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 03, 2019 at 11:01:37AM +0200, Petr Mladek wrote: > Four selftests for the new API. > > Signed-off-by: Petr Mladek > Acked-by: Miroslav Benes > --- > lib/livepatch/Makefile | 5 +- > lib/livepatch/test_klp_state.c | 161 ++++++++++++++++++++ > lib/livepatch/test_klp_state2.c | 190 ++++++++++++++++++++++++ > lib/livepatch/test_klp_state3.c | 5 + > tools/testing/selftests/livepatch/Makefile | 3 +- > tools/testing/selftests/livepatch/test-state.sh | 180 ++++++++++++++++++++++ > 6 files changed, 542 insertions(+), 2 deletions(-) > create mode 100644 lib/livepatch/test_klp_state.c > create mode 100644 lib/livepatch/test_klp_state2.c > create mode 100644 lib/livepatch/test_klp_state3.c > create mode 100755 tools/testing/selftests/livepatch/test-state.sh > > [ ... snip ... ] > diff --git a/tools/testing/selftests/livepatch/test-state.sh b/tools/testing/selftests/livepatch/test-state.sh > new file mode 100755 > index 000000000000..1139c664c11c > --- /dev/null > +++ b/tools/testing/selftests/livepatch/test-state.sh > @@ -0,0 +1,180 @@ > +#!/bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (C) 2018 Joe Lawrence > + nit: this should probably read as: # Copyright (C) 2019 Petr Mladek > +. $(dirname $0)/functions.sh > + > +MOD_LIVEPATCH=test_klp_state > +MOD_LIVEPATCH2=test_klp_state2 > +MOD_LIVEPATCH3=test_klp_state3 > + > +set_dynamic_debug > + > + > +# TEST: Loading and removing a module that modifies the system state > + > +echo -n "TEST: system state modification ... " > +dmesg -C > + > +load_lp $MOD_LIVEPATCH > +disable_lp $MOD_LIVEPATCH > +unload_lp $MOD_LIVEPATCH > + > +check_result "% modprobe test_klp_state > +livepatch: enabling patch 'test_klp_state' > +livepatch: 'test_klp_state': initializing patching transition > +test_klp_state: pre_patch_callback: vmlinux > +test_klp_state: allocate_loglevel_state: allocating space to store console_loglevel > +livepatch: 'test_klp_state': starting patching transition > +livepatch: 'test_klp_state': completing patching transition > +test_klp_state: post_patch_callback: vmlinux > +test_klp_state: fix_console_loglevel: fixing console_loglevel > +livepatch: 'test_klp_state': patching complete > +% echo 0 > /sys/kernel/livepatch/test_klp_state/enabled > +livepatch: 'test_klp_state': initializing unpatching transition > +test_klp_state: pre_unpatch_callback: vmlinux > +test_klp_state: restore_console_loglevel: restoring console_loglevel > +livepatch: 'test_klp_state': starting unpatching transition > +livepatch: 'test_klp_state': completing unpatching transition > +test_klp_state: post_unpatch_callback: vmlinux > +test_klp_state: free_loglevel_state: freeing space for the stored console_loglevel > +livepatch: 'test_klp_state': unpatching complete > +% rmmod test_klp_state" > + nit: a matter of style, and I don't mind either, but the other test scripts used $MOD_LIVEPATCH{2,3} variable replacement in the check_result string. I think I originally did that when we were reviewing the first self-test patchset and the filenames may or may not have changed. Those names are stable now, so I don't have a strong opinion either way. FWIW, if someone wants to make the copyright change on merge, I'm cool with this version. -- Joe