From: Robert Ho Subject: [PATCH OSSTEST 05/12] Add and expose some testsupport APIs Date: Wed, 11 Feb 2015 17:52:14 +0800 Message-ID: <1423648341-203755-6-git-send-email-robert.hu@intel.com> References: <1423648341-203755-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: <1423648341-203755-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 Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, ian.jackson@eu.citrix.com, jfehlig@suse.com, Robert Ho , longtaox.pang@intel.com List-Id: xen-devel@lists.xenproject.org When install L2 guest, we will need to invoke 'select_ether' to get guest MAC address. So here expose select_ether(). And also, we added another function 'guest_editconfig_cd' and expose it. This function bascically changes guest boot device sequence and alter its on_reboot behavior to restart. --- Osstest/TestSupport.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 1053409..8975652 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -67,7 +67,7 @@ BEGIN { selecthost get_hostflags get_host_property get_host_native_linux_console power_state power_cycle power_cycle_time - serial_fetch_logs + serial_fetch_logs select_ether propname_massage get_stashed open_unique_stashfile compress_stashed @@ -109,6 +109,7 @@ BEGIN { iso_gen_flags_basic iso_copy_content_from_image guest_editconfig_nocd + guest_editconfig_cd ); %EXPORT_TAGS = ( ); @@ -2081,4 +2082,14 @@ sub guest_editconfig_nocd ($$) { }); } +sub guest_editconfig_cd ($) { + my ($gho) = @_; + guest_editconfig($gho->{Host}, $gho, sub { + if (m/^\s*boot\s*= '\s*d\s*c\s*'/) { + s/dc/cd/; + } + s/^on_reboot.*/on_reboot='restart'/; + }); +} + 1; -- 1.8.3.1