[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v1 OSSTEST 3/3] ts-livepatch: Expand testcase to include global/local symbols



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 <konrad.wilk@xxxxxxxxxx>
---
 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);
+    }
 }
 
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.