From 53ec98f397575c9e68e7d5e58f3a34d494e57664 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Sun, 19 Mar 2023 18:46:47 +0100 Subject: [PATCH] add test --- src/subprocess_util/test.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/subprocess_util/test.py b/src/subprocess_util/test.py index 93ed458..6112d1b 100644 --- a/src/subprocess_util/test.py +++ b/src/subprocess_util/test.py @@ -6,6 +6,8 @@ from pathlib import Path from subprocess_util.exec_capture import execute_capture from subprocess_util.exec_print_capture import execute_print_capture from subprocess_util.exec_produce_chunks import execute_produce_chunks +from subprocess_util.chunked_transfer.active_send.exec_receive_chunks_passive import exec_receive_chunks_passive +from subprocess_util.chunked_transfer.active_send.exec_send_chunks_active import exec_send_chunks_active def test(): @@ -18,7 +20,10 @@ def test(): # test11() # test12() # test13() - test14() + # test14() + + test15_recieve() + test15_send() def test1(): @@ -167,6 +172,28 @@ def test14(): f'sudo btrfs-receive-chunks-active {ssh_source} {source_chunk_dir} {target_path}') +def test15_recieve(): + """ + First start the passive side. + """ + exec_receive_chunks_passive( + command=['cat'], + target_chunk_dir=Path('/home/yoda/15'), + ) + + +def test15_send(): + """ + Then run the active side. + """ + exec_send_chunks_active( + command=['ls', '/home'], + ssh_target='nas', + source_chunk_dir=Path('test/15'), + target_chunk_dir=Path('/home/yoda/15'), + ) + + def _init(test_number: int): print(f"TEST {test_number}") test_dir = Path('test')