All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <iwj@xenproject.org>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <iwj@xenproject.org>
Subject: [OSSTEST PATCH 2/3] known hosts handling: Ensure things are good for multi-host jobs
Date: Fri, 16 Oct 2020 17:36:14 +0100	[thread overview]
Message-ID: <20201016163615.5086-2-iwj@xenproject.org> (raw)
In-Reply-To: <20201016163615.5086-1-iwj@xenproject.org>

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



  reply	other threads:[~2020-10-16 16:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-10-16 16:36 ` [OSSTEST PATCH 3/3] Revert "host reuse: Reuse hosts only in same role (for now)" 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=20201016163615.5086-2-iwj@xenproject.org \
    --to=iwj@xenproject.org \
    --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.