From: Ian Campbell Subject: [PATCH OSSTEST v3 01/19] TestSupport: Add helper to fetch a URL on a host Date: Mon, 1 Dec 2014 12:57:18 +0000 Message-ID: <1417438656-15451-1-git-send-email-ian.campbell@citrix.com> References: <1417438571.29138.22.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1417438571.29138.22.camel@citrix.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 --- v3: Make sure wget is installed --- Osstest/Debian.pm | 2 +- Osstest/TestSupport.pm | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index c8db601..89cd205 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -492,7 +492,7 @@ d-i apt-setup/another boolean false d-i apt-setup/non-free boolean false d-i apt-setup/contrib boolean false -d-i pkgsel/include string openssh-server, ntp, ntpdate, ethtool, $extra_packages +d-i pkgsel/include string openssh-server, ntp, ntpdate, ethtool, wget, $extra_packages $xopts{ExtraPreseed} diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 46b6720..477ad18 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -55,6 +55,7 @@ BEGIN { target_putfilecontents_stash target_putfilecontents_root_stash target_put_guest_image target_editfile + target_fetchurl target_editfile_root target_file_exists target_run_apt target_install_packages target_install_packages_norec @@ -1472,6 +1473,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"}; -- 2.1.1