summaryrefslogtreecommitdiff
path: root/test/test_e2e.py
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-04-15 22:06:53 +0900
committerRyo Nakamura <upa@haeena.net>2024-04-15 22:09:25 +0900
commita5bca0ebe03d877399c9c51cd0100ce5bd2ce92f (patch)
treee168cc7643ea6efeb1fc2aed5d484b3179eff962 /test/test_e2e.py
parent6373e24753257b4fb2448fd1586b5b684e19bb82 (diff)
resume: fix increment idx only when path is added (#16)
Diffstat (limited to 'test/test_e2e.py')
-rw-r--r--test/test_e2e.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/test/test_e2e.py b/test/test_e2e.py
index 9b1bc4a..e1c2cf3 100644
--- a/test/test_e2e.py
+++ b/test/test_e2e.py
@@ -628,9 +628,9 @@ def test_checkpoint_dump_and_resume(mscp, src_prefix, dst_prefix):
dst2.cleanup()
os.remove("checkpoint")
-@pytest.mark.parametrize("timeout", [1, 2, 3, 4, 5, 6])
+@pytest.mark.parametrize("timeout", [ 1, 2, 3, 4, 5 ])
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
-def test_checkpoint_interrupt_and_resume(mscp, timeout, src_prefix, dst_prefix):
+def test_checkpoint_interrupt_large_file(mscp, timeout, src_prefix, dst_prefix):
"""Copy two 100MB files with 200Mbps -> 4 sec + 4 sec """
src1 = File("src1", size = 100 * 1024 * 1024).make()
src2 = File("src2", size = 100 * 1024 * 1024).make()
@@ -650,3 +650,31 @@ def test_checkpoint_interrupt_and_resume(mscp, timeout, src_prefix, dst_prefix):
dst2.cleanup()
os.remove("checkpoint")
+@pytest.mark.parametrize("timeout", [ 1, 2, 3, 4, 5 ])
+@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
+def test_checkpoint_interrupt_many_files(mscp, timeout, src_prefix, dst_prefix):
+ """Copy 100 1-MB files with 4 connections, and interrupt and
+ resume the transfer
+ """
+
+ files = []
+ for x in range(100):
+ files.append((
+ File("src/{:03d}".format(x), size = 1024 * 1024).make(),
+ File("dst/{:03d}".format(x))
+ ))
+
+ run2ng([mscp, "-vv", "-W", "checkpoint", "-L", "80m", "-n", 4,
+ src_prefix + "src", dst_prefix + "dst"],
+ timeout = timeout)
+ assert os.path.exists("checkpoint")
+
+ run2ok([mscp, "-vv", "-R", "checkpoint"])
+
+ for src, dst in files:
+ assert check_same_md5sum(src, dst)
+ src.cleanup()
+ dst.cleanup()
+
+ os.remove("checkpoint")
+