From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 2/2] Nested hosts: Use hostnamepath() in create_webfile Date: Mon, 16 Nov 2015 15:20:44 +0000 Message-ID: <1447687244-16230-2-git-send-email-ian.jackson@eu.citrix.com> References: <22089.62523.390831.567056@mariner.uk.xensource.com> <1447687244-16230-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZyLaZ-0007cN-0e for xen-devel@lists.xenproject.org; Mon, 16 Nov 2015 15:21:03 +0000 In-Reply-To: <1447687244-16230-1-git-send-email-ian.jackson@eu.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: xen-devel@lists.xenproject.org Cc: Robert Ho , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org create_webfile needs a pathname in the shared public-html directory. These paths need to be (a) stable (b) unique across all running jobs. We achieve this by basing the filenames on the hostname and (for a guest) the guest name. But for an L2 guest we need to include the physical host name too, because the L1 `host' is not unique. Fix this by using hostnamepath(), replacing the open-coded single iteration. Reported-by: Ian Campbell CC: Robert Ho Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 47b3e6f..a66f8a9 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -2262,9 +2262,7 @@ sub await_webspace_fetch_byleaf ($$$$$) { sub create_webfile ($$$) { my ($ho, $tail, $contents) = @_; # $contents as for file_link_contents - my $wf_rhs= $ho->{Name}."_".$tail; - # $ho->{Host} is set if $ho is a guest. - $wf_rhs= $ho->{Host}{Name}."_${wf_rhs}" if $ho->{Host}; + my $wf_rhs= hostnamepath($ho)."_".$tail; my $wf_common= $c{WebspaceCommon}.$wf_rhs; my $wf_url= $c{WebspaceUrl}.$wf_common; my $wf_file= $c{WebspaceFile}.$wf_common; -- 1.7.10.4