]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Nested hosts: Use hostnamepath() in create_webfile
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 16 Nov 2015 12:19:54 +0000 (12:19 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 16 Nov 2015 16:45:41 +0000 (16:45 +0000)
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 <ian.campbell@citrix.com>
CC: Robert Ho <robert.hu@intel.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Osstest/TestSupport.pm

index 47b3e6f108eebb53dfb400c2d474cddf7c646272..a66f8a9e4bb70daf42a59c76709bb6ded460c9d3 100644 (file)
@@ -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;