Skip to content

Commit

Permalink
use mbuffer to simulate actual slow transfer (test_progress)
Browse files Browse the repository at this point in the history
  • Loading branch information
psy0rz committed Sep 17, 2024
1 parent 4c5339d commit 9e2476a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_zfsautobackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ def test_keep0(self):

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)
Expand All @@ -893,10 +893,15 @@ def test_progress(self):
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

Expand Down

0 comments on commit 9e2476a

Please sign in to comment.