From patchwork Tue Jun 20 02:47:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Rzeszutek Wilk X-Patchwork-Id: 9798419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3470B6020B for ; Tue, 20 Jun 2017 02:51:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 32B1E27968 for ; Tue, 20 Jun 2017 02:51:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2664527A98; Tue, 20 Jun 2017 02:51:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C48E7274A3 for ; Tue, 20 Jun 2017 02:51:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN9DY-0005Ft-3z; Tue, 20 Jun 2017 02:48:36 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dN9DW-0005F1-JW for xen-devel@lists.xenproject.org; Tue, 20 Jun 2017 02:48:34 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id F4/6A-02956-20D88495; Tue, 20 Jun 2017 02:48:34 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgkeJIrShJLcpLzFFi42KZM10+UJex1yP S4MFFVYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNaPv9lL2ggMiFb+nzmJuYJwu0MXIxSEk0MEk 8fj8chYI5wujxM1Zr5kgnI2MEnN+rWKFcPoYJU7f7ARyODjYBEwk3qxy7GLk5BARiJX4sHMvC 4jNLJAh8XDfVzBbGCj+a1kzO4jNIqAqce/EXGYQm1fAWmLel+VgcQkBOYml26+DxTkFbCS2/Z oB1isEVDP/GMhekBpjib5ZfSwTGPkWMDKsYtQoTi0qSy3SNTTRSyrKTM8oyU3MzNE1NDDTy00 tLk5MT81JTCrWS87P3cQIDBUGINjBeH1jwCFGSQ4mJVHe5AyPSCG+pPyUyozE4oz4otKc1OJD jDIcHEoSvO7dQDnBotT01Iq0zBxg0MKkJTh4lER4txUCpXmLCxJzizPTIVKnGHU5Nqxe/4VJi CUvPy9VSpz3ThdQkQBIUUZpHtwIWARdYpSVEuZlBDpKiKcgtSg3swRV/hWjOAejkjBvWivQFJ 7MvBK4Ta+AjmACOoL5jAvIESWJCCmpBkaxvWHSL9l3vMq4ls/++KKBhMrWc3ppZnei2H+0747 gse+Lf1/7QqS/k6fx1sRaXYvqr/0hrl8VTj6L8lS6lNnPrj7Z7rHCF7OCR0nW36YzSW03Ofji qUBONP/9z38zzWW5Z/9KtNSvV0m7cFRW1v/QEbe1e750Tds+y2pypfCRBzEcbfwtC5RYijMSD bWYi4oTAfiNZHabAgAA X-Env-Sender: konrad.wilk@oracle.com X-Msg-Ref: server-3.tower-27.messagelabs.com!1497926911!108170945!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 33505 invoked from network); 20 Jun 2017 02:48:33 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Jun 2017 02:48:33 -0000 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v5K2mRw8020036 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Jun 2017 02:48:27 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.13.8/8.14.4) with ESMTP id v5K2mQ5S012679 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Jun 2017 02:48:27 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v5K2mQch022355; Tue, 20 Jun 2017 02:48:26 GMT Received: from x230.dumpdata.com.com (/10.154.148.136) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Jun 2017 19:48:26 -0700 From: Konrad Rzeszutek Wilk To: xen-devel@lists.xenproject.org, ian.jackson@citrix.com, ross.lagerwall@citrix.com Date: Mon, 19 Jun 2017 22:47:59 -0400 Message-Id: <20170620024759.32562-4-konrad.wilk@oracle.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170620024759.32562-1-konrad.wilk@oracle.com> References: <20170620024759.32562-1-konrad.wilk@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Cc: andrew.cooper3@citrix.com, jbeulich@suse.com, Konrad Rzeszutek Wilk Subject: [Xen-devel] [PATCH v1 OSSTEST 3/3] ts-livepatch: Expand testcase to include global/local symbols X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP testing. The test is to verify that the local symbols of payloads are ignored during loading. See Xen's patch "livepatch: Add local and global symbol resolution." Signed-off-by: Konrad Rzeszutek Wilk --- ts-livepatch-run | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/ts-livepatch-run b/ts-livepatch-run index f119458..1eaceff 100755 --- a/ts-livepatch-run +++ b/ts-livepatch-run @@ -27,6 +27,7 @@ my @livepatch_files = qw(xen_hello_world.livepatch xen_bye_world.livepatch xen_nop.livepatch); +my $livepatch_dir="/usr/lib/debug/xen-livepatch"; my $xen_extra_info; my $xen_minor_ver; @@ -128,6 +129,24 @@ my @livepatch_tests = ( { C => "xen-livepatch unload xen_nop" }, ); +my @livepatch_tests_symbols = ( + { C => "xen-livepatch load xen_hello_world.livepatch" }, + { C => "xen-livepatch list", + OutputCheck => sub { m/xen_hello_world/ } }, + { C => "xl info", + OutputCheck => \&check_for_hello_world }, + # This would normally fail as xen_local_symbols has the same local + # symbols as xen_hello_world.livepatch but with + # "livepatch: Add local and global symbol resolution." it works. + { C => "xen-livepatch upload xen_local_symbols xen_local_symbols.livepatch" }, + { C => "xen-livepatch replace xen_local_symbols" }, + { C => "xl info", + OutputCheck => \&check_for_hello_world }, + { C => "xen-livepatch revert xen_local_symbols" }, + { C => "xen-livepatch unload xen_hello_world" }, + { C => "xen-livepatch unload xen_local_symbols" }, + ); + our $ho = selecthost('host'); sub livepatch_test () { @@ -138,7 +157,7 @@ sub livepatch_test () { foreach my $test (@livepatch_tests) { # Default rc is zero. my $expected_rc = defined($test->{rc}) ? $test->{rc} : 0; - my $cmd = "(set -e;cd /usr/lib/debug/xen-livepatch;$test->{C})"; + my $cmd = "(set -e;cd $livepatch_dir;$test->{C})"; my ($rc, $output) = target_cmd_output_root_status($ho, $cmd); if ($rc != $expected_rc) { @@ -158,10 +177,13 @@ sub livepatch_test () { sub livepatch_check () { foreach my $file (@livepatch_files) { - if (!target_file_exists($ho, "/usr/lib/debug/xen-livepatch/$$file")) { + if (!target_file_exists($ho, "$$livepatch_dir/$$file")) { die "$file is missing!\n"; } } + if (target_file_exists($ho, "$livepatch_dir/xen_local_symbols.livepatch")) { + @livepatch_tests = (@livepatch_tests, @livepatch_tests_symbols); + } }