summaryrefslogtreecommitdiff
path: root/test/test_e2e.py
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-08-03 20:26:13 +0900
committerRyo Nakamura <upa@haeena.net>2023-08-03 20:26:13 +0900
commitba6f53d25333fed24aa9d602262554080697bdf2 (patch)
tree63573c4226cd01e15a963c2d970c9f06d6effb99 /test/test_e2e.py
parent9f7c135b1515ae297b839f54ea08c1fd16c9521e (diff)
add glob for source paths
https://github.com/upa/mscp/issues/3
Diffstat (limited to 'test/test_e2e.py')
-rw-r--r--test/test_e2e.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test_e2e.py b/test/test_e2e.py
index 31d9b44..988e308 100644
--- a/test/test_e2e.py
+++ b/test/test_e2e.py
@@ -150,6 +150,33 @@ def test_min_chunk(mscp, src_prefix, dst_prefix):
src.cleanup()
dst.cleanup()
+
+param_glob_copy = [
+ (
+ "src*", "dstx",
+ [ File("src1"), File("src2"), File("src3") ],
+ [ File("dstx/src1"), File("dstx/src2"), File("dstx/src3") ],
+ ),
+ (
+ "src*", "dstx",
+ [ File("src1/s1"), File("src2/s2"), File("src3/s3") ],
+ [ File("dstx/s1"), File("dstx/s2"), File("dstx/s3") ],
+ )
+]
+
+@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
+@pytest.mark.parametrize("src_glob_path, dst_path, srcs, dsts", param_glob_copy)
+def test_glob_src_path(mscp, src_prefix, dst_prefix,
+ src_glob_path, dst_path, srcs, dsts):
+ for src in srcs:
+ src.make(size = 1024 * 1024)
+
+ run2ok([mscp, "-H", "-vvv", src_prefix + src_glob_path, dst_prefix + dst_path])
+ for src, dst in zip(srcs, dsts):
+ assert check_same_md5sum(src, dst)
+ src.cleanup()
+ dst.cleanup()
+
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
def test_thread_affinity(mscp, src_prefix, dst_prefix):
src = File("src", size = 64 * 1024).make()