mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 07:00:37 +02:00
Devices: fixes from review round 24
- While the connector is taking a queued reconnect off its list, the old connection no longer counts as live, so no install starts on it. - Importing a block without a Port takes the port ssh would really use (ssh -F <config> -G), e.g. one a later Host * sets. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
22863f2f87
commit
49378b2c80
4 files changed
+37
-5
No files matched your search
@@ -124,6 +124,13 @@ class Migration(Base):
|
||||
self.assertEqual([d["alias"] for d in self.reg.devices()], ["frame-2", "frame"])
|
||||
self.assertEqual(self.reg.active(), self.reg.by_alias("frame")["id"])
|
||||
|
||||
@unittest.skipUnless(shutil.which("ssh"), "needs ssh")
|
||||
def test_a_port_inherited_from_another_host_entry_is_kept(self):
|
||||
(self.ssh / "config").write_text(CONFIG.replace("Host *\n ServerAliveInterval 60", "Host *\n Port 2222"))
|
||||
self.reg.sync_from_config(seed=False)
|
||||
self.assertEqual(self.reg.by_alias("frame")["port"], 2222) # what ssh itself would use
|
||||
self.assertEqual(self.reg.by_alias("frame-2")["port"], 2222) # its own Port line
|
||||
|
||||
def test_setup_finding_a_new_address_adds_it(self):
|
||||
self.reg.sync_from_config(seed=False)
|
||||
(self.ssh / "config").write_text(CONFIG.replace("HostName frame.tail1234.ts.net", "HostName 192.168.1.237"))
|
||||
|
||||
@@ -328,6 +328,12 @@ class Connecting(unittest.TestCase):
|
||||
self.assertEqual(self.link.failed("login", ["steamos@frame: Permission denied (publickey)."], False, "frame"),
|
||||
"stop")
|
||||
|
||||
def test_a_reconnect_being_started_isnt_a_live_connection(self):
|
||||
self.link.state["phase"] = "connected"
|
||||
self.assertTrue(self.link.alive())
|
||||
self.link.busy = True # the loop took a Retry off the queue and is about to reconnect
|
||||
self.assertFalse(self.link.alive()) # so ensure() waits instead of starting work on it
|
||||
|
||||
def test_probes_from_an_earlier_attempt_leave_the_new_rows_alone(self):
|
||||
self.link.state.update(attempt=2, probes=[{"host": "b", "state": "waiting"}])
|
||||
self.link.probe_update(0, 1, state="answered", ip="10.0.0.2")
|
||||
|
||||
Reference in new issue
Block a user