From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Ho Subject: [OSSTest Nested v12 09/21] Wrapper and use core_dump_setup() for nested host and normal host to setup coredump sysctl Date: Fri, 28 Aug 2015 23:07:58 +0800 Message-ID: <1440774490-16725-10-git-send-email-robert.hu@intel.com> References: <1440774490-16725-1-git-send-email-robert.hu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1440774490-16725-1-git-send-email-robert.hu@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, robert.hu@intel.com Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, Ian.Jackson@eu.citrix.com, gordon.jin@intel.com, "longtao.pang" , di.zheng@intel.com List-Id: xen-devel@lists.xenproject.org This patch does these 4 things: 1. wrapper coredump setup code from original ts-host-install into TestSupport.pm 2. replace ts-host-install original code with this wrapper function 3. in debian-hvm-install, create '/var/core' in hvm host post installation. 4. in ts-nested-setup, call this function for l1 host. Signed-off-by: longtao.pang Signed-off-by: Robert Ho --- Osstest/TestSupport.pm | 19 +++++++++++++++++++ ts-debian-hvm-install | 1 + ts-host-install | 15 +-------------- ts-nested-setup | 2 ++ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index f2ec9be..1768c5e 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -116,6 +116,7 @@ BEGIN { iso_copy_content_from_image guest_editconfig_nocd host_install_postboot_complete + core_dump_setup ); %EXPORT_TAGS = ( ); @@ -2379,4 +2380,22 @@ sub host_install_postboot_complete ($) { target_cmd_root($ho, "update-rc.d osstest-confirm-booted start 99 2 ."); } +sub core_dump_setup ($) { + my ($ho) = @_; + target_cmd_root($ho, 'mkdir -p /var/core'); + target_editfile_root($ho, '/etc/sysctl.conf', + sub { target_editfile_kvp_replace( + "kernel.core_pattern", + # %p==pid,%e==executable name,%t==timestamp + "/var/core/%t.%p.%e.core") }); + target_cmd_root($ho, "sysctl --load /etc/sysctl.conf"); + my $coredumps_conf = <<'END'; +# +* soft core -1 +root soft core -1 +END + target_putfilecontents_root_stash($ho,10,$coredumps_conf, + '/etc/security/limits.d/coredumps.conf'); +} + 1; diff --git a/ts-debian-hvm-install b/ts-debian-hvm-install index e271af8..d569272 100755 --- a/ts-debian-hvm-install +++ b/ts-debian-hvm-install @@ -105,6 +105,7 @@ preseed_hook_command($gho, 'late_command', '', < -* soft core -1 -root soft core -1 -END - target_putfilecontents_root_stash($ho,10,$coredumps_conf, - '/etc/security/limits.d/coredumps.conf'); + core_dump_setup($ho); host_install_postboot_complete($ho); diff --git a/ts-nested-setup b/ts-nested-setup index 207ec85..2eff4ec 100755 --- a/ts-nested-setup +++ b/ts-nested-setup @@ -35,6 +35,8 @@ store_runvar($l1_ident,$l1->{Guest}); host_install_postboot_complete($l1); +core_dump_setup($l1); + # Just for efficiency reason to install genisoimage here target_install_packages_norec($l1, qw(lvm2 rsync genisoimage)); -- 1.8.3.1