From 9e2476ac840efb55ae21d5126483b0dbb6a07c15 Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Tue, 17 Sep 2024 14:25:32 +0200 Subject: [PATCH] use mbuffer to simulate actual slow transfer (test_progress) --- tests/test_zfsautobackup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_zfsautobackup.py b/tests/test_zfsautobackup.py index 51131ed..f05f15e 100644 --- a/tests/test_zfsautobackup.py +++ b/tests/test_zfsautobackup.py @@ -883,7 +883,7 @@ test_target1/test_source2/fs2/sub@test-20101111000003 def test_progress(self): - r=shelltest("dd if=/dev/zero of=/test_source1/data.txt bs=200000 count=1") + r=shelltest("dd if=/dev/urandom of=/test_source1/data.txt bs=5M count=1") r = shelltest("zfs snapshot test_source1@test") l=LogConsole(show_verbose=True, show_debug=True, color=False) @@ -893,10 +893,15 @@ test_target1/test_source2/fs2/sub@test-20101111000003 sp=d.send_pipe([], prev_snapshot=None, resume_token=None, show_progress=True, raw=False, send_pipes=[], send_properties=True, write_embedded=True, zfs_compressed=True) + + with OutputIO() as buf: with redirect_stderr(buf): try: - n.run(["sleep", "3"], inp=sp) + + p=n.run(["mbuffer", "-R1M", "-m4096", "-o" ,"/dev/null"], inp=sp) + # p=n.run(["dd", "of=/dev/null"], inp=sp) + except: pass