xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH OSSTEST] Allow per-host TFTP setup
@ 2014-02-12 14:16 Ian Campbell
  2014-02-12 14:50 ` Ian Jackson
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2014-02-12 14:16 UTC (permalink / raw)
  To: ian.jackson; +Cc: Ian Campbell, xen-devel

I run osstest against machines which are in both the XenServer and XenClient
administrative domains, and hence which have different TFTP servers, accessible
locally via different NFS mounted paths.

Make it possible to specify various bits of TFTP path via ~/.xen-osstest/config

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Osstest/Debian.pm      |  6 +++++-
 Osstest/TestSupport.pm |  5 ++++-
 ts-host-install        | 16 ++++++++++------
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 6759263..a70d35b 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -554,7 +554,11 @@ END
     foreach my $kp (keys %{ $ho->{Flags} }) {
 	$kp =~ s/need-kernel-deb-// or next;
 
-	my $d_i= $c{TftpPath}.'/'.$c{TftpDiBase}.'/'.$r{arch}.'/'.$c{TftpDiVersion}.'-'.$ho->{Suite};
+	my $tftppath = get_host_property($ho, "TftpPath", $c{TftpPath});
+	my $tftpdibase = get_host_property($ho, "TftpDiBase", $c{TftpDiBase});
+	my $tftpdiversion = get_host_property($ho, "TftpDiVersion", $c{TftpDiVersion});
+
+	my $d_i= $tftppath.'/'.$tftpdibase.'/'.$r{arch}.'/'.$tftpdiversion.'-'.$ho->{Suite};
 
 	my $kurl = create_webfile($ho, "kernel", sub {
 	    copy("$d_i/$kp.deb", $_[0]);
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index a513540..5c01ffa 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -1839,8 +1839,11 @@ sub host_pxefile ($) {
 
 sub setup_pxeboot ($$) {
     my ($ho, $bootfile) = @_;
+    my $p= get_host_property($ho, "TftpPath", $c{TftpPath});
+    my $d= get_host_property($ho, "TftpPxeDir", $c{TftpPxeDir});
     my $f= host_pxefile($ho);
-    file_link_contents("$c{TftpPath}$c{TftpPxeDir}$f", $bootfile);
+
+    file_link_contents("$p$d$f", $bootfile);
 }
 
 sub setup_pxeboot_local ($) {
diff --git a/ts-host-install b/ts-host-install
index 5c0018e..2e711fe 100755
--- a/ts-host-install
+++ b/ts-host-install
@@ -122,19 +122,23 @@ END
 sub setup_pxeboot_firstboot($) {
     my ($ps_url) = @_;
     
-    my $d_i= $c{TftpDiBase}.'/'.$r{arch}.'/'.$c{TftpDiVersion}.'-'.$ho->{Suite};
+    my $tftppath = get_host_property($ho, "TftpPath", $c{TftpPath});
+    my $tftpdibase = get_host_property($ho, "TftpDiBase", $c{TftpDiBase});
+    my $tftpdiversion = get_host_property($ho, "TftpDiVersion", $c{TftpDiVersion});
+
+    my $d_i= $tftpdibase.'/'.$r{arch}.'/'.$tftpdiversion.'-'.$ho->{Suite};
     
     my @installcmdline= qw(vga=normal);
     push @installcmdline, di_installcmdline_core($ho, $ps_url, %xopts);
 
     my $src_initrd= "$d_i/initrd.gz";
-    my @initrds= "$c{TftpPath}/$src_initrd";
+    my @initrds= "$tftppath/$src_initrd";
 
     my $kernel;
 
     foreach my $fp (keys %{ $ho->{Flags} }) {
         $fp =~ s/^need-firmware-deb-// or next;
-        my $cpio= "$c{TftpPath}/$d_i/$fp.cpio.gz";
+        my $cpio= "$tftppath/$d_i/$fp.cpio.gz";
         if (stat $cpio) {
             logm("using firmware from: $cpio");
             push @initrds, $cpio;
@@ -147,7 +151,7 @@ sub setup_pxeboot_firstboot($) {
 
     foreach my $kp (keys %{ $ho->{Flags} }) {
         $kp =~ s/need-kernel-deb-// or next;
-        my $kern= "$c{TftpPath}/$d_i/linux.$kp";
+        my $kern= "$tftppath/$d_i/linux.$kp";
         if (stat $kern) {
             logm("using kernel from: $kern");
             $kernel = "/$d_i/linux.$kp";
@@ -157,7 +161,7 @@ sub setup_pxeboot_firstboot($) {
             die "$kp $kern $!";
         }
 
-        my $cpio= "$c{TftpPath}/$d_i/$kp.cpio.gz";
+        my $cpio= "$tftppath/$d_i/$kp.cpio.gz";
         if (stat $cpio) {
             logm("using kernel modules from: $cpio");
             push @initrds, $cpio;
@@ -195,7 +199,7 @@ END
 
     logm("using initrds: @initrds");
     my $initrd= "$c{TftpTmpDir}$ho->{Name}--initrd.gz";
-    system_checked("cat -- @initrds >$c{TftpPath}$initrd");
+    system_checked("cat -- @initrds >$tftppath$initrd");
     
     push @installcmdline, ("initrd=/$initrd",
                            "domain=$c{TestHostDomain}",
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH OSSTEST] Allow per-host TFTP setup
  2014-02-12 14:16 [PATCH OSSTEST] Allow per-host TFTP setup Ian Campbell
@ 2014-02-12 14:50 ` Ian Jackson
  2014-02-12 14:53   ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Jackson @ 2014-02-12 14:50 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("[PATCH OSSTEST] Allow per-host TFTP setup"):
> I run osstest against machines which are in both the XenServer and
> XenClient administrative domains, and hence which have different
> TFTP servers, accessible locally via different NFS mounted paths.
> 
> Make it possible to specify various bits of TFTP path via
> ~/.xen-osstest/config

As I said in person: this would be much better if instead the host
property referred to a named TFTP scope/server.  Otherwise you have to
set a whole bunch of host properties identically.

Something like:
  * Replace references to $c{Tftp*} with a new indirection involving
    $ho.  Perhaps just $ho->{Tftp}{*}.  (Involves formulaic patch made
    with perl -i, perhaps.)
  * In selecthost, look up a TftpScope host property and then
    $c{TftpFoo_$scope} for each TftpFoo (except, I guess, when
    $scope is "default" or something).
  * In selectguest, copy a reference to the hosts's $ho->{Tftp}.

> +	my $tftpdiversion = get_host_property($ho, "TftpDiVersion", $c{TftpDiVersion});

This definitely shouldn't be a host property because it needs push
gate version control.


Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH OSSTEST] Allow per-host TFTP setup
  2014-02-12 14:50 ` Ian Jackson
@ 2014-02-12 14:53   ` Ian Campbell
  2014-02-14 18:04     ` Dario Faggioli
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Campbell @ 2014-02-12 14:53 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On Wed, 2014-02-12 at 14:50 +0000, Ian Jackson wrote:
> Ian Campbell writes ("[PATCH OSSTEST] Allow per-host TFTP setup"):
> > I run osstest against machines which are in both the XenServer and
> > XenClient administrative domains, and hence which have different
> > TFTP servers, accessible locally via different NFS mounted paths.
> > 
> > Make it possible to specify various bits of TFTP path via
> > ~/.xen-osstest/config
> 
> As I said in person: this would be much better if instead the host
> property referred to a named TFTP scope/server.  Otherwise you have to
> set a whole bunch of host properties identically.
> 
> Something like:
>   * Replace references to $c{Tftp*} with a new indirection involving
>     $ho.  Perhaps just $ho->{Tftp}{*}.  (Involves formulaic patch made
>     with perl -i, perhaps.)
>   * In selecthost, look up a TftpScope host property and then
>     $c{TftpFoo_$scope} for each TftpFoo (except, I guess, when
>     $scope is "default" or something).
>   * In selectguest, copy a reference to the hosts's $ho->{Tftp}.
> 
> > +	my $tftpdiversion = get_host_property($ho, "TftpDiVersion", $c{TftpDiVersion});
> 
> This definitely shouldn't be a host property because it needs push
> gate version control.
> 

Ack. I'll put this on my todo list.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH OSSTEST] Allow per-host TFTP setup
  2014-02-12 14:53   ` Ian Campbell
@ 2014-02-14 18:04     ` Dario Faggioli
  2014-02-18 10:06       ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Dario Faggioli @ 2014-02-14 18:04 UTC (permalink / raw)
  To: Ian Campbell; +Cc: Ian Jackson, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1477 bytes --]

On mer, 2014-02-12 at 14:53 +0000, Ian Campbell wrote:
> On Wed, 2014-02-12 at 14:50 +0000, Ian Jackson wrote:
> > Ian Campbell writes ("[PATCH OSSTEST] Allow per-host TFTP setup"):

> > > Make it possible to specify various bits of TFTP path via
> > > ~/.xen-osstest/config
> > 
> > As I said in person: this would be much better if instead the host
> > property referred to a named TFTP scope/server.  Otherwise you have to
> > set a whole bunch of host properties identically.
> > 
> 
> Ack. I'll put this on my todo list.
> 
Also, the README file has a, far than comprehensive, list of host
properties. I'm unsure whether that file is the proper place, but it
would be nice to have one actual place where a list and a brief
description of all the supported host properties could live.

When I previously added or had to deal with some undocumented host
properties, I added it in the README file, so I'd say do the same. If
then README is not deemed as the proper place, fine, but I still would
recommend putting the info somewhere...

It's not different from what we require in Xen, of having actual patches
updating the docs too, after all.

What do you think?

Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH OSSTEST] Allow per-host TFTP setup
  2014-02-14 18:04     ` Dario Faggioli
@ 2014-02-18 10:06       ` Ian Campbell
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2014-02-18 10:06 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: Ian Jackson, xen-devel

On Fri, 2014-02-14 at 19:04 +0100, Dario Faggioli wrote:
> On mer, 2014-02-12 at 14:53 +0000, Ian Campbell wrote:
> > On Wed, 2014-02-12 at 14:50 +0000, Ian Jackson wrote:
> > > Ian Campbell writes ("[PATCH OSSTEST] Allow per-host TFTP setup"):
> 
> > > > Make it possible to specify various bits of TFTP path via
> > > > ~/.xen-osstest/config
> > > 
> > > As I said in person: this would be much better if instead the host
> > > property referred to a named TFTP scope/server.  Otherwise you have to
> > > set a whole bunch of host properties identically.
> > > 
> > 
> > Ack. I'll put this on my todo list.
> > 
> Also, the README file has a, far than comprehensive, list of host
> properties. I'm unsure whether that file is the proper place, but it
> would be nice to have one actual place where a list and a brief
> description of all the supported host properties could live.

Yes, I'll do this.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-18 10:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 14:16 [PATCH OSSTEST] Allow per-host TFTP setup Ian Campbell
2014-02-12 14:50 ` Ian Jackson
2014-02-12 14:53   ` Ian Campbell
2014-02-14 18:04     ` Dario Faggioli
2014-02-18 10:06       ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).