diff options
author | Ryo Nakamura <upa@haeena.net> | 2024-04-12 23:08:22 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2024-04-12 23:08:22 +0900 |
commit | a1b9afefe50fbbdf6391e94ab21e6e7645eabe4d (patch) | |
tree | 8f0fa87ac9c014395a60781c9a3af55060d6b70a /test/test_e2e.py | |
parent | bf7e2c3ae340464d4de7b4ba105decdbd7c40450 (diff) |
add -o SSH_OPTION option
Diffstat (limited to 'test/test_e2e.py')
-rw-r--r-- | test/test_e2e.py | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/test/test_e2e.py b/test/test_e2e.py index 9e0b313..b6ac1dc 100644 --- a/test/test_e2e.py +++ b/test/test_e2e.py @@ -496,6 +496,40 @@ def test_config_ng(mscp, src_prefix, dst_prefix): src.cleanup() dst.cleanup() + +param_valid_option_ok = [ + [ "-o", "Port=8022" ], + [ "-o", "Port=8022", "-o", "User=root" ], + [ "-o", "unknown-option-is-silently-ignored" ], +] +@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix) +@pytest.mark.parametrize("option", param_valid_option_ok) +def test_inline_option_ok(mscp, src_prefix, dst_prefix, option): + """ change port number with -o option. it should be ok. """ + src = File("src", size = 1024 * 1024).make() + dst = File("dst") + run2ok([mscp, "-vvv"] + option + + [src_prefix + src.path, dst_prefix + dst.path]) + assert check_same_md5sum(src, dst) + src.cleanup() + dst.cleanup() + + +param_valid_option_ng = [ + [ "-o", "Port=8023" ], + [ "-o", "User=invaliduser" ], +] +@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix) +@pytest.mark.parametrize("option", param_valid_option_ng) +def test_inline_option_ng(mscp, src_prefix, dst_prefix, option): + """ change port number with -o option. it should be ng. """ + src = File("src", size = 1024 * 1024).make() + dst = File("dst") + run2ng([mscp, "-vvv"] + option + + [src_prefix + src.path, dst_prefix + dst.path]) + src.cleanup() + + # username test assumes that this test runs inside a container, see Dockerfiles def test_specify_passphrase_via_env(mscp): src = File(os.getcwd() + "/src", size = 1024).make() @@ -552,8 +586,8 @@ def test_10k_files(mscp, src_prefix, dst_prefix): @pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix) def test_checkpoint_dump_and_resume(mscp, src_prefix, dst_prefix): - src1 = File("src1", size = 512 * 1024 * 1024).make() - src2 = File("src2", size = 512 * 1024 * 1024).make() + src1 = File("src1", size = 64 * 1024 * 1024).make() + src2 = File("src2", size = 64 * 1024 * 1024).make() dst1 = File("dst/src1") dst2 = File("dst/src2") run2ok([mscp, "-vvv", "-W", "checkpoint", "-D", |