All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [OSSTEST PATCH 7/9] NTP servers: Introduce new NtpServer host property
Date: Tue, 17 Feb 2015 17:50:29 +0000	[thread overview]
Message-ID: <1424195431-1493-8-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1424195431-1493-1-git-send-email-ian.jackson@eu.citrix.com>

Allow the specification of NTP servers in a dedicated NtpServer host
property, which we honour in preseed_create.

Change the documentation to recommend this, rather than use of
ad-hoc text in DebianPreseed.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index a044f8f..cc075a4 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -506,7 +506,7 @@ sub di_installcmdline_core ($$;@) {
 sub preseed_base ($$$;@) {
     my ($ho,$suite,$extra_packages,%xopts) = @_;

-    return <<"END";
+    my $preseed = <<"END";
 d-i mirror/suite string $suite

 d-i debian-installer/locale string en_GB
@@ -572,10 +572,22 @@ d-i pkgsel/include string openssh-server, ntp, ntpdate, ethtool, chiark-utils-bi

 $xopts{ExtraPreseed}

-### END OF DEBIAN PRESEED BASE
+END
+
+    my $ntpserver = get_target_property($ho,'NtpServer');
+use Data::Dumper;
+print STDERR "PRESEED NTP ", Dumper($ntpserver);
+    $preseed .= <<"END" if $ntpserver;
+d-i clock-setup/ntp-server string $ntpserver
+END

+    $preseed .= <<"END";
+
+### END OF DEBIAN PRESEED BASE
 END
-}
+
+    return $preseed;
+}

 sub preseed_create ($$;@) {
     my ($ho, $sfx, %xopts) = @_;
diff --git a/README b/README
index 6e63e97..0a0242c 100644
--- a/README
+++ b/README
@@ -334,6 +334,11 @@ HostProp_<testbox>_TftpScope
    Defines the Tftp scope (i.e. subnet) where this host resides. See
    "TftpFoo_<scope> and TftpFoo" below.

+HostProp_<testbox>_NtpServer
+   NTP server to use.  You should probably have your own local
+   NTP server for production use; the default is to use the operating
+   system's default (normally, Debian's pool.ntp.org servers).
+
 HostFlags_<testbox>
    Defines a set of flags for the host. Flags is a list separated by
    whitespace, comma or semi-colon. A flag can be unset by prepending
@@ -357,9 +362,7 @@ HostGroupFlags_<group>
    merged with the host specific flags. Only used in standalone mode.

 DebianPreseed
-   Text to add to the debian-installer preseed file.  Optional
-   but you will need to set some NTP servers here if your firewall
-   doesn't permit NTP to Debian's pool.ntp.org servers.
+   Text to add to the debian-installer preseed file.  Optional.

 ========================================

diff --git a/production-config b/production-config
index 515bd98..5fbca50 100644
--- a/production-config
+++ b/production-config
@@ -77,8 +77,9 @@ XenUseUser osstest
 #DebianMirrorHost debian.uk.xensource.com
 DebianMirrorHost 10.80.16.196

+HostProp_NtpServer ntp.uk.xensource.com
+
 DebianPreseed= <<'END'
-d-i clock-setup/ntp-server string ntp.uk.xensource.com
 END

 HostProp_Serial sympathy woking
---
 Osstest/Debian.pm |    5 +++++
 README            |    9 ++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 315d25c..7633b51 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -574,6 +574,11 @@ $xopts{ExtraPreseed}
 
 END
 
+    my $ntpserver = get_target_property($ho,'NtpServer');
+    $preseed .= <<"END" if $ntpserver;
+d-i clock-setup/ntp-server string $ntpserver
+END
+
     $preseed .= <<"END";
 
 ### END OF DEBIAN PRESEED BASE
diff --git a/README b/README
index 6e63e97..0a0242c 100644
--- a/README
+++ b/README
@@ -334,6 +334,11 @@ HostProp_<testbox>_TftpScope
    Defines the Tftp scope (i.e. subnet) where this host resides. See
    "TftpFoo_<scope> and TftpFoo" below.
 
+HostProp_<testbox>_NtpServer
+   NTP server to use.  You should probably have your own local
+   NTP server for production use; the default is to use the operating
+   system's default (normally, Debian's pool.ntp.org servers).
+
 HostFlags_<testbox>
    Defines a set of flags for the host. Flags is a list separated by
    whitespace, comma or semi-colon. A flag can be unset by prepending
@@ -357,9 +362,7 @@ HostGroupFlags_<group>
    merged with the host specific flags. Only used in standalone mode.
 
 DebianPreseed
-   Text to add to the debian-installer preseed file.  Optional
-   but you will need to set some NTP servers here if your firewall
-   doesn't permit NTP to Debian's pool.ntp.org servers.
+   Text to add to the debian-installer preseed file.  Optional.
 
 ========================================
 
-- 
1.7.10.4

  parent reply	other threads:[~2015-02-17 18:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-17 17:50 [OSSTEST PATCH 0/9] Fix NTP unreliability, and other fixes Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 1/9] cs-adjust-flight: Add missing `use Data::Dumper' Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 2/9] sg-report-job-history: Increase default history depth to 500 Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 3/9] config: Tiny fixes Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 4/9] TestSupport: Provide get_target_property Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 5/9] Debian.pm: Pass $ho/$gho to preseed_base Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 6/9] Debian.pm: Slightly refactor preseed_base Ian Jackson
2015-02-17 17:50 ` Ian Jackson [this message]
2015-02-17 17:50 ` [OSSTEST PATCH 8/9] NTP servers: Use NtpServer host property Ian Jackson
2015-02-17 17:50 ` [OSSTEST PATCH 9/9] NTP servers: Work around Debian's failure to honour preseed Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424195431-1493-8-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.