change chunk_pool from list to pool

This commit is contained in:
Ryo Nakamura
2024-02-11 21:28:03 +09:00
parent d65a49768c
commit a828ca3f5a
7 changed files with 89 additions and 722 deletions

View File

@@ -6,6 +6,7 @@ test_e2e.py: End-to-End test for mscp executable.
import platform
import pytest
import getpass
import time
import os
import shutil
@@ -317,6 +318,26 @@ def test_dont_truncate_dst(mscp, src_prefix, dst_prefix):
assert md5_before == md5_after
f.cleanup()
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
def test_dont_make_conns_more_than_chunks(mscp, src_prefix, dst_prefix):
# copy 100 files with -n 20 -I 1 options. if mscp creates 20 SSH
# connections although all files have been copied, it is error.
srcs = []
dsts = []
for n in range(100):
srcs.append(File("src/src-{:06d}".format(n), size=1024).make())
dsts.append(File("dst/src-{:06d}".format(n)))
start = time.time()
run2ok([mscp, "-H", "-v", "-n", "20", "-I", "1",
src_prefix + "src/*", dst_prefix + "dst"])
end = time.time()
for s, d in zip(srcs, dsts):
assert check_same_md5sum(s, d)
shutil.rmtree("src")
shutil.rmtree("dst")
assert((end - start) < 10)
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
@pytest.mark.parametrize("src, dst", param_single_copy)
def test_set_port(mscp, src_prefix, dst_prefix, src, dst):