a73x

0023a4d0

test: a handoff target nobody spawns is spelled as the argv it would be

a73x   2026-08-29 00:46

Commit message
test: a handoff target nobody spawns is spelled as the argv it would be

src/client/client.zig
Old New
@@ -2027,7 +2027,7 @@ test "openFailure: a handoff separates a missing announce from an ssh that never
2027 var buf: [open_err_len]u8 = undefined; 2027 var buf: [open_err_len]u8 = undefined;
2028 const h: Target = .{ .hand = .{ 2028 const h: Target = .{ .hand = .{
2029 .host = "box", 2029 .host = "box",
2030 .ssh_argv = &.{ "/bin/sh", "-c", "ssh box mux d endpoint" }, 2030 .ssh_argv = &.{ "ssh", "box", "mux d endpoint" },
2031 .cache_path = null, 2031 .cache_path = null,
2032 } }; 2032 } };
2033 2033
@@ -2210,7 +2210,7 @@ test "client: a target spells itself back as one wall argument per session" {
2210 "vm1#work", 2210 "vm1#work",
2211 try wallSpelling(&buf, .{ .hand = .{ 2211 try wallSpelling(&buf, .{ .hand = .{
2212 .host = "vm1", 2212 .host = "vm1",
2213 .ssh_argv = &.{ "/bin/sh", "-c", "ssh vm1 mux d endpoint" }, 2213 .ssh_argv = &.{ "ssh", "vm1", "mux d endpoint" },
2214 .cache_path = null, 2214 .cache_path = null,
2215 } }, "work"), 2215 } }, "work"),
2216 ); 2216 );
@@ -2227,8 +2227,8 @@ test "client: every spelling this writes, the wall grammar reads back the same"
2227 .{ Target{ .sock = "/run/user/1000/muxd.sock" }, "0" }, 2227 .{ Target{ .sock = "/run/user/1000/muxd.sock" }, "0" },
2228 // `user@host`: nothing inside it parses, which is what keeps ssh's 2228 // `user@host`: nothing inside it parses, which is what keeps ssh's
2229 // own config working — and the wall must not start parsing it now. 2229 // own config working — and the wall must not start parsing it now.
2230 .{ Target{ .hand = .{ .host = "ubuntu@sandbox-a609d8", .ssh_argv = &.{ "/bin/sh", "-c", "x" }, .cache_path = null } }, "build" }, 2230 .{ Target{ .hand = .{ .host = "ubuntu@sandbox-a609d8", .ssh_argv = &.{"x"}, .cache_path = null } }, "build" },
2231 .{ Target{ .hand = .{ .host = "vm1", .ssh_argv = &.{ "/bin/sh", "-c", "x" }, .cache_path = null } }, "0" }, 2231 .{ Target{ .hand = .{ .host = "vm1", .ssh_argv = &.{"x"}, .cache_path = null } }, "0" },
2232 // The port rides through untouched, and so does its absence. 2232 // The port rides through untouched, and so does its absence.
2233 .{ Target{ .quic = .{ .host_port = "box:8787", .key_path = "/k" } }, "work" }, 2233 .{ Target{ .quic = .{ .host_port = "box:8787", .key_path = "/k" } }, "work" },
2234 .{ Target{ .quic = .{ .host_port = "box", .key_path = "/k" } }, "0" }, 2234 .{ Target{ .quic = .{ .host_port = "box", .key_path = "/k" } }, "0" },
@@ -2304,7 +2304,7 @@ test "hydratedCreates: a saved LOCAL line may create the session; every remote s
2304 } })); 2304 } }));
2305 try std.testing.expect(!hydratedCreates(.{ .hand = .{ 2305 try std.testing.expect(!hydratedCreates(.{ .hand = .{
2306 .host = "box", 2306 .host = "box",
2307 .ssh_argv = &.{ "/bin/sh", "-c", "ssh box mux d endpoint" }, 2307 .ssh_argv = &.{ "ssh", "box", "mux d endpoint" },
2308 .cache_path = null, 2308 .cache_path = null,
2309 } })); 2309 } }));
2310 // `.via` has no wall spelling at all, so it can never come off the 2310 // `.via` has no wall spelling at all, so it can never come off the