summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2023-08-30 19:09:29 +0900
committerRyo Nakamura <upa@haeena.net>2023-08-30 19:09:29 +0900
commit13ec6521957ab0faadff36353d1ff3c8e0ac03ce (patch)
treee832e996d198a37531983d1d41629580141401ed /test
parent6b45cf7c9ccbdcb75f150d060652ef9e9d5f2dd4 (diff)
fix mscp_opendir, do not use `tls_sftp`, use `sftp` isntead.
The fixed issue causes mscp_opendir wrongly calls opendir() for local when tls_sftp is NULL although sftp is not NULL.
Diffstat (limited to 'test')
-rw-r--r--test/test_e2e.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/test_e2e.py b/test/test_e2e.py
index c63a09e..108ae71 100644
--- a/test/test_e2e.py
+++ b/test/test_e2e.py
@@ -11,11 +11,15 @@ from util import File, check_same_md5sum
def run2ok(args):
- check_call(list(map(str, args)))
+ cmd = list(map(str, args))
+ print("cmd: {}".format(" ".join(cmd)))
+ check_call(cmd)
def run2ng(args):
+ cmd = list(map(str, args))
+ print("cmd: {}".format(" ".join(cmd)))
with pytest.raises(CalledProcessError) as e:
- check_call(list(map(str, args)))
+ check_call(cmd)
""" usage test """
@@ -127,6 +131,23 @@ def test_dir_copy(mscp, src_prefix, dst_prefix, src_dir, dst_dir, src, dst, twic
df.cleanup()
tf.cleanup()
+
+param_dir_copy_single = [
+ ("src_dir", "dst_dir",
+ File("src_dir/t1", size = 1024 * 1024),
+ File("dst_dir/src_dir/t1"),
+ )
+]
+@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
+@pytest.mark.parametrize("src_dir, dst_dir, src, dst", param_dir_copy_single)
+def test_dir_copy_single(mscp, src_prefix, dst_prefix, src_dir, dst_dir, src, dst):
+ src.make()
+ os.mkdir(dst_dir)
+ run2ok(["mscp", "-H", "-vvv", src_prefix + src_dir, dst_prefix + dst_dir])
+ assert check_same_md5sum(src, dst)
+ src.cleanup()
+ dst.cleanup()
+
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
def test_override_single_file(mscp, src_prefix, dst_prefix):
src = File("src", size = 128).make()