From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH OSSTEST v2 04/15] TestSupport: Add helper to fetch a URL on a host Date: Mon, 28 Apr 2014 11:41:25 +0100 Message-ID: <1398681696-2773-4-git-send-email-ian.campbell@citrix.com> References: <1398681672.29700.55.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1398681672.29700.55.camel@kazak.uk.xensource.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: ian.jackson@eu.citrix.com Cc: Ian Campbell , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Signed-off-by: Ian Campbell --- Osstest/TestSupport.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 6558fc8..35838a7 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -54,6 +54,7 @@ BEGIN { target_putfile target_putfile_root target_putfilecontents_stash target_putfilecontents_root_stash + target_fetchurl target_put_guest_image target_editfile_root target_file_exists target_run_apt @@ -1431,6 +1432,13 @@ END return $cfgpath; } +sub target_fetchurl($$$;$) { + my ($ho, $url, $path, $timeo) = @_; + $timeo ||= 2000; + target_cmd_root($ho, "wget --progress=dot:mega -O $path $url", $timeo); +} + + sub target_put_guest_image ($$$) { my ($ho, $gho, $default) = @_; my $specimage = $r{"$gho->{Guest}_image"}; -- 1.9.0