mirror of
https://github.com/upa/mscp.git
synced 2026-02-13 00:24:42 +08:00
add -g option to specify TCP cc algorithm
This commit introduce SSH_OPTIONS_CCALGO option to the libssh patch and add -g CONGESTION option to mscp.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
test_e2e.py: End-to-End test for mscp executable.
|
||||
"""
|
||||
|
||||
import platform
|
||||
import pytest
|
||||
import os
|
||||
|
||||
@@ -268,6 +269,21 @@ def test_compression(mscp, src_prefix, dst_prefix, compress):
|
||||
src.cleanup()
|
||||
dst.cleanup()
|
||||
|
||||
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
|
||||
def test_ccalgo(mscp, src_prefix, dst_prefix):
|
||||
src = File("src", size = 1024 * 1024).make()
|
||||
dst = File("dst").make()
|
||||
if platform.system() == "Darwin":
|
||||
# Darwin does not support TCP_CONGESTION
|
||||
algo = "cubic"
|
||||
run = run2ng
|
||||
elif platform.system() == "Linux":
|
||||
# Linux supports TCP_CONGESTION
|
||||
with open("/proc/sys/net/ipv4/tcp_allowed_congestion_control", r) as f:
|
||||
algo = f.read().strip().split().pop()
|
||||
run = run2ok
|
||||
run([mscp, "-H", "-vvv", "-g", algo, src_prefix + src.path, dst_prefix + "dst"])
|
||||
|
||||
|
||||
testhost = "mscptestlocalhost"
|
||||
testhost_prefix = "{}:{}/".format(testhost, os.getcwd()) # use current dir
|
||||
|
||||
@@ -121,6 +121,7 @@ param_invalid_kwargs = [
|
||||
{ "cipher": "invalid" },
|
||||
{ "hmac": "invalid"},
|
||||
{ "compress": "invalid"},
|
||||
{ "ccalgo": "invalid"},
|
||||
]
|
||||
|
||||
@pytest.mark.parametrize("kw", param_invalid_kwargs)
|
||||
|
||||
Reference in New Issue
Block a user