]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
osstest: introduce helper to get per-host tftp prefix
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 23 Oct 2017 10:05:39 +0000 (11:05 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 24 Oct 2017 11:04:31 +0000 (12:04 +0100)
This is used in order to get the per-host tftp prefix, used to store
the host initrd file.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v1:
 - New in this version.

Osstest/TestSupport.pm
ts-host-install

index 76730f101c23bc4acf6573cb63940d061cb43420..214b12c3ce32c8534f2ae6bae89c254af57b2881 100644 (file)
@@ -69,7 +69,7 @@ BEGIN {
                       target_run_apt
                       target_install_packages target_install_packages_norec
                       target_jobdir target_extract_jobdistpath_subdir
-                      target_extract_jobdistpath
+                      target_extract_jobdistpath target_tftp_prefix
                       lv_create lv_dev_mapper
 
                       poll_loop tcpconnect await_tcp
@@ -2328,6 +2328,12 @@ sub target_extract_jobdistpath ($$$$$) {
     target_cmd_root($ho, "cd / && tar -hzxf $distcopy", 300);
 }
 
+sub target_tftp_prefix ($) {
+    my ($ho) = @_;
+
+    return "$ho->{Tftp}{TmpDir}/" . hostnamepath($ho);
+}
+
 sub guest_find_domid ($$) {
     my ($ho,$gho) = @_;
     return if defined $gho->{Domid};
index 20b8a60da40c5d04e306ffe2c6b3208b13608aa4..11c14a74c2ba77205a8033f337f4d4b603d5184a 100755 (executable)
@@ -253,7 +253,7 @@ END
     push @initrds, "$initrd_overlay.cpio.gz";
 
     logm("using initrds: @initrds");
-    my $initrd= "$ho->{Tftp}{TmpDir}".hostnamepath($ho)."--initrd.gz";
+    my $initrd= target_tftp_prefix($ho) . "--initrd.gz";
     system_checked("cat -- @initrds >$ho->{Tftp}{Path}$initrd");
     
     push @dicmdline, "domain=$c{TestHostDomain}";