Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1869282imu; Sat, 8 Dec 2018 08:55:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/UbV8XR8fWtodJ65QahBsUxTQ/+4J6ie9iyqwPEiwgvTfRYzXNbo3eBMv629rMTDA64Zmef X-Received: by 2002:a62:81c1:: with SMTP id t184mr6611128pfd.40.1544288117059; Sat, 08 Dec 2018 08:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544288117; cv=none; d=google.com; s=arc-20160816; b=Q1BaeOXM55tyVcRSKKbMBMbfj04H0wXFvlkN9A87A67H/yfN7CY91H8Vk1+K7sB9m3 qKtA5+n3xyUoRo/akG7rPQ4kalIF9PKs8F3Mw6by/POUw1bo9ndAeZTAkJMQbp/3VcjP 3QS8xbkDVEv2Xtg7GHLIVLYb3YieVcUSZKLNiMF7jdb5YcCnmVLkqSX27UxETKVmXeGU KyoLs/8E8C2iGyaUjB+uiOF8mUXdCKiMh/4PIPEeY5dMHapcpYyz4vpeh61DBMzNsiNi sPXFsQ1l/8863n+W7v/vgXY/1Zr3gugM8bevdupgoVMK7B3rd7f5hiQaRpgW26TNPTYU BsSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=2hct+ZRR8rRYEFyDei6ndHl0ehIYvmcohzDWZ+SpS7M=; b=nowXCNOQlzsFe2AqlB/TMs2i7OY3SJMm2m4vs8TndQLa+dHdkJsKglMU3vSE73USls YfUPPLnUftNQqgIF0Q0Gt2x3IzVc5F6BFsp8vo9Zf6tgIVYVCvGsanJS/FDn9H/lrPcV veFlAj0Vfuh8CXPm3rHrPoNYRrXnItbTJgJLThqIzWZxRT9DWMFIMUaURPpu0vHTEJ0G U+pafzHiZL4FRqke1aMkiGWuZDiAsI2iGos5bqBj7Z9myFeaGxrhwRjb9hhF7NxXJSRF yWRa1Sc1WnZiVqDvms+3ij9vZrLsXEKnuJgKBrS0lx5eCzot5MtHzN1yC+JB5UfNdIh8 GbuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IYk3lsO+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o124si6091895pfb.256.2018.12.08.08.54.54; Sat, 08 Dec 2018 08:55:17 -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=@gmail.com header.s=20161025 header.b=IYk3lsO+; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726180AbeLHQyV (ORCPT + 99 others); Sat, 8 Dec 2018 11:54:21 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39834 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726148AbeLHQyU (ORCPT ); Sat, 8 Dec 2018 11:54:20 -0500 Received: by mail-pg1-f193.google.com with SMTP id w6so3057811pgl.6; Sat, 08 Dec 2018 08:54:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=2hct+ZRR8rRYEFyDei6ndHl0ehIYvmcohzDWZ+SpS7M=; b=IYk3lsO+jcq0Ng7UyT2HllDNgaHPmrsXuWGgMWm4JZIq1Opr0fYMcGEPZkIa4k5wMw pijQO1wRdeMuEaF08L09VWOCdwpHEn6d6zaKMF/23pWjHKl9q78vzpXntyy5btGG04R4 fF4Y9jsZoQkkOsxzC+zGMY6sV4wbFhUH0JNU0kLEweH5OsmgQ2u32TXkFApuJXoH65TK RVU0N24hBmLvx94Ea73P1/c8IuJEkRev2+XlB4phoqrI4FcQ/KwLB8/QA6xE9I7U4tjh EJEINuISx209QLsyXLMoeR8U7MTlYL7NV32WhpQj3+TmobbVm84z9lW+0MkjljuxFSSs cwSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2hct+ZRR8rRYEFyDei6ndHl0ehIYvmcohzDWZ+SpS7M=; b=C6fB7wPlzhUTeGhhbr2gU4kydfuX62PQlwPmRCzvFKOHNFqEDJj8OuFdnbRpKDTPXF kxATLPYCpWhHnotLODVtKEO8kCEHnzfphCe72mHt2S41vQM47uNiW6fF7UPyCdVUPeKH Orrmjv8vQ/WB+WrrlykoN1xaNuEfLBOssFuAMqPI1XJp8AFdXhPVxT1FFmLnMPoueswI myjFbOdchlKOXQBR+L7JPyJAvGm+zmeITcyr4ia0ywtY/zcchLt8w1jRWSN01t0pI0EP FIuayK59GI3+j09VMCBtCbn58fP/wJvnrCVxejcW+qMXhjU3J8hJTh4+o1d2P3LWYyQj GqvA== X-Gm-Message-State: AA+aEWYv4hTNXHotgmeUBaew50wjbxG0GT+OqSTRpnW3f/hZ/8wt45Hb 7U4c8QnblTC9pIH2BMuK/uk= X-Received: by 2002:a63:7a5b:: with SMTP id j27mr5638920pgn.112.1544288059718; Sat, 08 Dec 2018 08:54:19 -0800 (PST) Received: from magata (i219-164-165-113.s42.a013.ap.plala.or.jp. [219.164.165.113]) by smtp.gmail.com with ESMTPSA id z186sm9193244pfz.119.2018.12.08.08.54.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Dec 2018 08:54:18 -0800 (PST) Date: Sun, 9 Dec 2018 01:54:10 +0900 From: Alice Ferrazzi To: Petr Mladek Cc: Jiri Kosina , Josh Poimboeuf , Miroslav Benes , Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v14 11/11] selftests/livepatch: introduce tests Message-ID: <20181208165410.GA19464@magata> References: <20181129094431.7801-1-pmladek@suse.com> <20181129094431.7801-12-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20181129094431.7801-12-pmladek@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29-11-2018 10:44, Petr Mladek wrote: > From: Joe Lawrence > > Add a few livepatch modules and simple target modules that the included > regression suite can run tests against: > > - basic livepatching (multiple patches, atomic replace) > - pre/post (un)patch callbacks > - shadow variable API > > Signed-off-by: Joe Lawrence > Signed-off-by: Petr Mladek > --- > Documentation/livepatch/callbacks.txt | 489 +---------------- > MAINTAINERS | 1 + > lib/Kconfig.debug | 21 + > lib/Makefile | 2 + > lib/livepatch/Makefile | 15 + > lib/livepatch/test_klp_atomic_replace.c | 57 ++ > lib/livepatch/test_klp_callbacks_busy.c | 43 ++ > lib/livepatch/test_klp_callbacks_demo.c | 121 +++++ > lib/livepatch/test_klp_callbacks_demo2.c | 93 ++++ > lib/livepatch/test_klp_callbacks_mod.c | 24 + > lib/livepatch/test_klp_livepatch.c | 51 ++ > lib/livepatch/test_klp_shadow_vars.c | 236 +++++++++ > tools/testing/selftests/Makefile | 1 + > tools/testing/selftests/livepatch/Makefile | 8 + > tools/testing/selftests/livepatch/README | 43 ++ > tools/testing/selftests/livepatch/config | 1 + > tools/testing/selftests/livepatch/functions.sh | 203 +++++++ > .../testing/selftests/livepatch/test-callbacks.sh | 587 +++++++++++++++++++++ > .../testing/selftests/livepatch/test-livepatch.sh | 168 ++++++ > .../selftests/livepatch/test-shadow-vars.sh | 60 +++ > 20 files changed, 1740 insertions(+), 484 deletions(-) > create mode 100644 lib/livepatch/Makefile > create mode 100644 lib/livepatch/test_klp_atomic_replace.c > create mode 100644 lib/livepatch/test_klp_callbacks_busy.c > create mode 100644 lib/livepatch/test_klp_callbacks_demo.c > create mode 100644 lib/livepatch/test_klp_callbacks_demo2.c > create mode 100644 lib/livepatch/test_klp_callbacks_mod.c > create mode 100644 lib/livepatch/test_klp_livepatch.c > create mode 100644 lib/livepatch/test_klp_shadow_vars.c > create mode 100644 tools/testing/selftests/livepatch/Makefile > create mode 100644 tools/testing/selftests/livepatch/README > create mode 100644 tools/testing/selftests/livepatch/config > create mode 100644 tools/testing/selftests/livepatch/functions.sh > create mode 100755 tools/testing/selftests/livepatch/test-callbacks.sh > create mode 100755 tools/testing/selftests/livepatch/test-livepatch.sh > create mode 100755 tools/testing/selftests/livepatch/test-shadow-vars.sh I tested the livepatch selftest and it works for me: ``` gentoo_07 linux-dev (alice/livepatch) # make -C tools/testing/selftests TARGETS=livepatch run_tests make: Entering directory '/root/linux-dev/tools/testing/selftests' make[1]: Entering directory '/root/linux-dev/tools/testing/selftests/livepatch' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/root/linux-dev/tools/testing/selftests/livepatch' make[1]: Entering directory '/root/linux-dev/tools/testing/selftests/livepatch' TAP version 13 selftests: livepatch: test-livepatch.sh ======================================== TEST: basic function patching ... ok TEST: multiple livepatches ... ok TEST: atomic replace livepatch ... ok ok 1..1 selftests: livepatch: test-livepatch.sh [PASS] selftests: livepatch: test-callbacks.sh ======================================== TEST: target module before livepatch ... ok TEST: module_coming notifier ... ok TEST: module_going notifier ... ok TEST: module_coming and module_going notifiers ... ok TEST: target module not present ... ok TEST: pre-patch callback -ENODEV ... ok TEST: module_coming + pre-patch callback -ENODEV ... ok TEST: multiple target modules ... ok TEST: busy target module ... ok TEST: multiple livepatches ... ok TEST: atomic replace ... ok ok 1..2 selftests: livepatch: test-callbacks.sh [PASS] selftests: livepatch: test-shadow-vars.sh ======================================== TEST: basic shadow variable API ... ok ok 1..3 selftests: livepatch: test-shadow-vars.sh [PASS] make[1]: Leaving directory '/root/linux-dev/tools/testing/selftests/livepatch' make: Leaving directory '/root/linux-dev/tools/testing/selftests' ``` Tested-by: Alice Ferrazzi