Skip to contentSkip to conversation

mg-repro-setup: Use new syntax for cs-adjust-flight

PATCH Superseded Ian Jackson 1 participant 5 messages Jun 15, 2017 – Jun 16, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 mg-repro-setup: Use new syntax for cs-adjust-flight

In 497b2c6c933d "Rework runvar-build-set new value handling" we fixed bugs in cs-adjust-flight which would make mg-repro-setup's attempt to adjust build jobs sometimes not match at all, but we also changed the syntax for specifying just a new flight. I forgot to update the one in-tree user of that feature.

---
 mg-repro-setup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mg-repro-setup +1 -1
index 4f2fe54..9663497 100755
@@ -199,7 +199,7 @@ if $skipcapture; then adjrunvar skip_testids "capture-logs*"; fi
 
 ./cs-adjust-flight $flight						\
 	copy-jobs $example_flight $job					\
-	runvar-build-set . '/buildjob$' "^$flight\\." $example_flight \
+	runvar-build-set . '/buildjob$' "^$flight\\." $example_flight.  \
 	"${adjusts[@]}"
 
 progress "executing ..."
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw

PATCH 2/4 tcl/daemonlib: tolerate no $c(...Host)

From: osstest service user <[email protected]>

We are going to want a daemon that bins to * rather than to a known address.

We achieve this by simply tolerating the lack of the FooHost config setting; and, in that case, not passing -myaddr to Tcl's socket command (and adjusting messages accordingly).

---
 tcl/daemonlib.tcl | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
tcl/daemonlib.tcl +13 -4
index 1e86d5f..b23caea 100644
@@ -195,7 +195,7 @@ proc newconn {chan addr port} {
 proc main-daemon {which setup} {
     global c argv
 
-    set host $c(${which}DaemonHost)
+    catch { set host $c(${which}DaemonHost) }
     set port $c(${which}DaemonPort)
 
     foreach arg $argv {
@@ -210,12 +210,21 @@ proc main-daemon {which setup} {
     fconfigure stdout -buffering line
     fconfigure stderr -buffering none
 
-    log "starting $host:$port"
+    set desc $port
+
+    set sockcmd {socket -server newconn}
+    if {[info exists host]} {
+        set desc "$host:$port"
+        lappend sockcmd [list -myaddr $host]
+    }
+    lappend sockcmd $port
+
+    log "starting $desc"
 
     uplevel 1 $setup
 
-    socket -server newconn -myaddr $host $port
-    log "listening $host:$port"
+    eval $sockcmd
+    log "listening $desc"
 
     vwait forever
 }
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#2 lore raw

PATCH 3/4 dhcp leases: Introduce new client/server leases query mechanism

In reply to Ian Jackson

From: osstest service user <[email protected]>

osstest needs to know (from the DHCP server) what addresses its guests have. Until now, the only way to do this has been to read the DHCP server's leases file - if necessary, fetching the leases file from the server.

Of course the size of the leases file is proportional to the size of the installation, as is the number of simultaneous test jobs. So the overall impact of this is O(n^2); currently, the leases file in Massachusetts is about 300kby and is being fetched fairly frequently.

So, we provide an alternative arrangement.

The ISC DHCP server does not support a standard way of querying it about leases (eg, SNMP). It does support an ISC protocol called "OMAPI".

We don't want to have each osstest test job talk to the DHCP server via OMAPI because this would involve giving them a password to the DHCP server. So we need to provide, effectively, a proxy daemon.

The available OMAPI client libraries are synchronous; the best available library is written in Python. We could write the whole daemon in Python but that would involve doing our own select and line buffering/reassembly, reimplementing command parsing, etc. - which we already have implementations of in tcl/daemonlib.tcl.

So we provide, instead:

* A Python program `ms-leases-omapiproxy' which speaks OMAPI to the DHCP server, and a simple synchronous query protocol on its stdin/stdout. OMAPI authentication is based on a shared secret; to avoid duplicating it any more than necessary, ms-leases-omapiproxy half-arsedly parses the relevant DHCP server config fragment.

* A Tcl daemon `ms-leasesdaemon' which multiplexes the multiple clients, and issues queries to the Python program. It speaks a protocol similar to the other Tcl daemons.

* A client implementation in Osstest/DhcpWatch/leasesdaemon.pm which can be requested by per-host configuration, as the DHCP lease method.

Like with the `leases' access method, the hostname of the DHCP server must be specified in the host property. The Tcl daemon binds to *, so does not need to know its hostname. So the config has only the port, and the on-DHCP-server settings.

---
 Osstest.pm                        |  4 ++
 Osstest/DhcpWatch/leasesdaemon.pm | 98 +++++++++++++++++++++++++++++++++++++++
 ms-leases-omapiproxy              | 43 +++++++++++++++++
 ms-leasesdaemon                   | 51 ++++++++++++++++++++
 4 files changed, 196 insertions(+)
 create mode 100644 Osstest/DhcpWatch/leasesdaemon.pm
 create mode 100755 ms-leases-omapiproxy
 create mode 100755 ms-leasesdaemon
Osstest.pm +4 -0
index a78728c..9fdefde 100644
@@ -104,6 +104,10 @@ our %c = qw(
     HostnameSortSwapWords 0
 
     Timezone UTC
+
+    DhcpServerOmapiKeyFile /etc/dhcp/osstest-omapi-key
+    DhcpServerOmapiPort 7991
+    LeasesDaemonPort 4033
 );
 
 $c{$_}='' foreach qw(
Osstest/DhcpWatch/leasesdaemon.pm new file +98 -0

98 lines not on this page · raw message

ms-leases-omapiproxy new file +43 -0

43 lines not on this page · raw message

ms-leasesdaemon new file +51 -0

51 lines not on this page · raw message

Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#3 lore raw

Re: [OSSTEST PATCH 3/4] dhcp leases: Introduce new client/server leases query mechanism

Ian Jackson writes ("[OSSTEST PATCH 3/4] dhcp leases: Introduce new client/server leases query mechanism"):

Quoted 5 lines

* A Python program `ms-leases-omapiproxy' which speaks OMAPI to the DHCP server, and a simple synchronous query protocol on its stdin/stdout. OMAPI authentication is based on a shared secret; to avoid duplicating it any more than necessary, ms-leases-omapiproxy half-arsedly parses the relevant DHCP server config fragment.

This does not work, for this reason:

https://lists.isc.org/pipermail/dhcp-hackers/2005-August/001399.html

I have backed out this change, and filed a bug with ISC [ISC-Bugs #45398].

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw

PATCH 4/4 production-config: Use the new leases server for all hosts by default

In reply to Ian Jackson
---
 production-config | 2 ++
 1 file changed, 2 insertions(+)
production-config +2 -0
index 96831c7..63d6641 100644
@@ -94,6 +94,8 @@ TftpNetbootGroup osstest
 TftpDiVersion_wheezy 2016-06-08
 TftpDiVersion_jessie 2017-04-06
 
+HostProp_DhcpWatchMethod leasesdaemon infra
+
 # For ISO installs
 DebianImageVersion_wheezy 7.2.0
 DebianImageVersion_jessie 8.2.0
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel