diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/fs.py | 12 | ||||
| -rw-r--r-- | test/fs_namespace.zig | 3 |
2 files changed, 8 insertions, 7 deletions
@@ -602,23 +602,23 @@ def test(binary, quic=False): assert old.read_fid(held_screen, count=1) == b'{' old.write('/pane/1/body', b'changed after dump\n', truncate=True) # Unsaved text is asked about once, as Exit asks; the second - # Restore goes ahead. + # Restore goes ahead, and is answered before the hang-up. try: execute(old, control, 'Restore ' + str(saved)) except OSError as refused: assert 'Modified' in str(refused), refused assert old.read('/pane/1/body') == b'changed after dump\n' - try: - execute(old, control, 'Restore ' + str(saved)) - except (EOFError, ConnectionResetError, BrokenPipeError): - pass + execute(old, control, 'Restore ' + str(saved)) + # Refused while the connections are cut, or cut already. try: old.read_fid(held_body) - except (EOFError, ConnectionResetError, BrokenPipeError): + except (EOFError, OSError): pass else: raise AssertionError('Restore left an old body fid usable') with Client(address) as restored: + # The new log names its panes, then where they came from. + assert restored.read('/log').endswith(b'\nrestore ' + str(saved).encode() + b'\n'), restored.read('/log') restored_ids = [int(row.split()[0]) for row in restored.read('/index').splitlines()] assert len(restored_ids) == 2 and old_ids.isdisjoint(restored_ids), restored_ids file_id, control_id = restored_ids diff --git a/test/fs_namespace.zig b/test/fs_namespace.zig index 822577d8..2f78ca1a 100644 --- a/test/fs_namespace.zig +++ b/test/fs_namespace.zig @@ -88,7 +88,7 @@ test "transactional restore preserves host capabilities and advances pane identi p.fs.tcp_address = .{ .ip4 = .loopback(5640) }; p.fs.quic_address = .{ .ip6 = .loopback(5641) }; try pardes.dump.dumpState(p); - const restored = try pardes.dump.restore(p, p.dump_out.?); + const restored = try pardes.dump.restore(p, p.dump_out.?, "test"); defer restored.deinit(); try std.testing.expectEqual(@as(u32, 41), restored.lsp_seq); try std.testing.expectEqual(@as(u32, 73), restored.pipe.seq); @@ -103,6 +103,7 @@ test "transactional restore preserves host capabilities and advances pane identi try std.testing.expectError(error.BadDumpMagic, pardes.dump.restore( p, ".{ .magic = \"wrong\", .screen = .{.cols = 80, .rows = 24} }", + "test", )); try std.testing.expect(p.panes[0] == pane); try std.testing.expectEqualStrings("before\n", pane.file.?.content); |
