add -H option to disable host key check

tests use this option.
This commit is contained in:
Ryo Nakamura
2022-11-05 22:46:02 +09:00
parent 8cb5c81fcf
commit 243bf1fa57
6 changed files with 380 additions and 24 deletions

View File

@@ -49,7 +49,7 @@ param_single_copy = [
@pytest.mark.parametrize("src, dst", param_single_copy)
def test_single_copy_remote2local(mscp, src, dst):
src.make()
run2ok([mscp, remote_prefix + src.path, dst.path])
run2ok([mscp, "-H", remote_prefix + src.path, dst.path])
assert check_same_md5sum(src, dst)
src.cleanup()
dst.cleanup()
@@ -57,7 +57,7 @@ def test_single_copy_remote2local(mscp, src, dst):
@pytest.mark.parametrize("src, dst", param_single_copy)
def test_single_copy_local2remote(mscp, src, dst):
src.make()
run2ok([mscp, src.path, remote_prefix + dst.path])
run2ok([mscp, "-H", src.path, remote_prefix + dst.path])
assert check_same_md5sum(src, dst)
src.cleanup()
dst.cleanup()
@@ -92,11 +92,11 @@ def test_dir_copy_remote2local(mscp, src_dir, dst_dir, src, dst, twice):
for f in src:
f.make()
run2ok([mscp, remote_prefix + src_dir, dst_dir])
run2ok([mscp, "-H", remote_prefix + src_dir, dst_dir])
for sf, df in zip(src, dst):
assert check_same_md5sum(sf, df)
run2ok([mscp, remote_prefix + src_dir, dst_dir])
run2ok([mscp, "-H", remote_prefix + src_dir, dst_dir])
for sf, df in zip(src, twice):
assert check_same_md5sum(sf, df)
@@ -110,11 +110,11 @@ def test_dir_copy_local2remote(mscp, src_dir, dst_dir, src, dst, twice):
for f in src:
f.make()
run2ok([mscp, src_dir, remote_prefix + dst_dir])
run2ok([mscp, "-H", src_dir, remote_prefix + dst_dir])
for sf, df in zip(src, dst):
assert check_same_md5sum(sf, df)
run2ok([mscp, src_dir, remote_prefix + dst_dir])
run2ok([mscp, "-H", src_dir, remote_prefix + dst_dir])
for sf, df in zip(src, twice):
assert check_same_md5sum(sf, df)
@@ -133,7 +133,7 @@ def test_override_single_file(mscp, src_prefix, dst_prefix):
dst = File("dst", size = 128).make()
assert not check_same_md5sum(src, dst)
run2ok([mscp, src_prefix + src.path, dst_prefix + dst.path])
run2ok([mscp, "-H", src_prefix + src.path, dst_prefix + dst.path])
assert check_same_md5sum(src, dst)
src.cleanup()
@@ -144,7 +144,7 @@ def test_min_chunk(mscp, src_prefix, dst_prefix):
src = File("src", size = 16 * 1024).make()
dst = File("dst")
run2ok([mscp, "-s", 8192, src_prefix + src.path, dst_prefix + dst.path])
run2ok([mscp, "-H", "-s", 8192, src_prefix + src.path, dst_prefix + dst.path])
assert check_same_md5sum(src, dst)
src.cleanup()
@@ -155,7 +155,7 @@ def test_cannot_override_file_with_dir(mscp, src_prefix, dst_prefix):
src = File("src", size = 128).make()
dst = File("dst").make()
run2ng([mscp, src_prefix + src.path, dst_prefix + "dst/src"])
run2ng([mscp, "-H", src_prefix + src.path, dst_prefix + "dst/src"])
src.cleanup()
dst.cleanup()
@@ -164,7 +164,7 @@ def test_cannot_override_file_with_dir(mscp, src_prefix, dst_prefix):
def test_transfer_zero_bytes(mscp, src_prefix, dst_prefix):
src = File("src", size = 0).make()
dst = File("dst")
run2ok([mscp, src_prefix + src.path, dst_prefix + "dst"])
run2ok([mscp, "-H", src_prefix + src.path, dst_prefix + "dst"])
assert os.path.exists("dst")
src.cleanup()
dst.cleanup()