Xen-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [OSSTEST PATCH 1/3] known_hosts handling: Fix over-broad SQL query
@ 2020-10-16 16:36 Ian Jackson
  2020-10-16 16:36 ` [OSSTEST PATCH 2/3] known hosts handling: Ensure things are good for multi-host jobs Ian Jackson
  2020-10-16 16:36 ` [OSSTEST PATCH 3/3] Revert "host reuse: Reuse hosts only in same role (for now)" Ian Jackson
  0 siblings, 2 replies; 3+ messages in thread
From: Ian Jackson @ 2020-10-16 16:36 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This should match only "*_host" and "host".  We don't want it matching
"*host" without a "_".

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 Osstest/TestSupport.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index f2d8a0e1..5e6b15d9 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -2796,7 +2796,7 @@ sub known_hosts () {
 
     my $hostsq= $dbh_tests->prepare(<<END);
         SELECT val FROM runvars
-         WHERE flight=? AND name LIKE '%host'
+         WHERE flight=? AND (name = 'host' OR name LIKE '%\\_host')
          GROUP BY val
 END
     $hostsq->execute($flight);
-- 
2.20.1



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

* [OSSTEST PATCH 2/3] known hosts handling: Ensure things are good for multi-host jobs
  2020-10-16 16:36 [OSSTEST PATCH 1/3] known_hosts handling: Fix over-broad SQL query Ian Jackson
@ 2020-10-16 16:36 ` Ian Jackson
  2020-10-16 16:36 ` [OSSTEST PATCH 3/3] Revert "host reuse: Reuse hosts only in same role (for now)" Ian Jackson
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2020-10-16 16:36 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

When a multi-host job reuses host(s) from earlier jobs, the set of
hosts set up in the on-host known_hosts files may be insufficient,
since the hosts we are using now may not have been in any of the
flight's runvars when the earlier job set them up.

So we need to update the known_hosts.  We use the flight's current
set, which will include all of our hosts.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 ts-host-reuse | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ts-host-reuse b/ts-host-reuse
index 8d674257..ea8a471d 100755
--- a/ts-host-reuse
+++ b/ts-host-reuse
@@ -135,6 +135,14 @@ sub noop_if_playing () {
     }
 }
 
+sub ensure_known_hosts ($) {
+    my ($ho) = @_;
+    # Don't need to bother if job uses only one host
+    return if scalar(grep { m/(_|^)host$/ } keys %r) == 1;
+    target_putfilecontents_root_stash($ho, 30, known_hosts(),
+				      '/root/.ssh/known_hosts');
+}
+
 #---------- actions ----------
 
 sub act_prealloc () {
@@ -153,6 +161,7 @@ sub act_start_test () {
     return unless $ho->{Shared};
     my %oldstate = map { $_ => 1 } qw(prep ready);
     host_shared_mark_ready($ho, $sharetype, \%oldstate, 'mid-test');
+    ensure_known_hosts($ho);
 }
 
 sub act_final () {
-- 
2.20.1



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

* [OSSTEST PATCH 3/3] Revert "host reuse: Reuse hosts only in same role (for now)"
  2020-10-16 16:36 [OSSTEST PATCH 1/3] known_hosts handling: Fix over-broad SQL query Ian Jackson
  2020-10-16 16:36 ` [OSSTEST PATCH 2/3] known hosts handling: Ensure things are good for multi-host jobs Ian Jackson
@ 2020-10-16 16:36 ` Ian Jackson
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Jackson @ 2020-10-16 16:36 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson

This workaround is no longer needed because I have fixed the problem
properly.

Also, it didn't work anyway, because at that point $ho isn't set, so
all this did was produce some Perl warnings.

This reverts commit f3668acae2c6201c680dc7b4e9085ab184136d7e.
---
 ts-host-reuse | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ts-host-reuse b/ts-host-reuse
index ea8a471d..e2498bb6 100755
--- a/ts-host-reuse
+++ b/ts-host-reuse
@@ -67,7 +67,6 @@ sub sharetype_add ($$) {
 sub compute_test_sharetype () {
     my @runvartexts;
     my %done;
-    push @runvartexts, $ho->{Ident};
     foreach my $key (runvar_glob(@accessible_runvar_pats)) {
 	next if runvar_is_synth($key);
 	my $val = $r{$key};
-- 
2.20.1



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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 16:36 [OSSTEST PATCH 1/3] known_hosts handling: Fix over-broad SQL query Ian Jackson
2020-10-16 16:36 ` [OSSTEST PATCH 2/3] known hosts handling: Ensure things are good for multi-host jobs Ian Jackson
2020-10-16 16:36 ` [OSSTEST PATCH 3/3] Revert "host reuse: Reuse hosts only in same role (for now)" Ian Jackson

Xen-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/xen-devel/0 xen-devel/git/0.git
	git clone --mirror https://lore.kernel.org/xen-devel/1 xen-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 xen-devel xen-devel/ https://lore.kernel.org/xen-devel \
		xen-devel@lists.xenproject.org xen-devel@lists.xen.org
	public-inbox-index xen-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.xenproject.lists.xen-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git