diff options
author | Ryo Nakamura <upa@haeena.net> | 2024-03-12 15:24:09 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2024-03-12 15:24:09 +0900 |
commit | 0d248c5f6b9e8c91181950e0382d79723ab0f35e (patch) | |
tree | ee35bce364191b2a9f9c163a2323542c7823da63 | |
parent | 9d02fc9122cb32a5aeeaea4b694447e1ff751c94 (diff) |
fix port tests and v6only test.
port test: sshd listens on 8022 and run mscp with -P 8022
v6only test: change remote name from localhost to ip6-localhost
-rwxr-xr-x | scripts/test-in-container.sh | 4 | ||||
-rw-r--r-- | test/test_e2e.py | 18 |
2 files changed, 16 insertions, 6 deletions
diff --git a/scripts/test-in-container.sh b/scripts/test-in-container.sh index f24bfe4..eeaf9b5 100755 --- a/scripts/test-in-container.sh +++ b/scripts/test-in-container.sh @@ -8,6 +8,10 @@ cd $script_dir set -x +# sshd Linsten on 22 and 8022 +echo "Port 22" > /etc/ssh/sshd_config.d/mscp-test.conf +echo "Port 8022" >> /etc/ssh/sshd_config.d/mscp-test.conf + # Run sshd if [ ! -e /var/run/sshd.pid ]; then /usr/sbin/sshd diff --git a/test/test_e2e.py b/test/test_e2e.py index 2398cce..e4dbe49 100644 --- a/test/test_e2e.py +++ b/test/test_e2e.py @@ -10,7 +10,7 @@ import time import os import shutil -from subprocess import check_call, PIPE, CalledProcessError +from subprocess import check_call, CalledProcessError from util import File, check_same_md5sum @@ -343,12 +343,18 @@ def test_dont_make_conns_more_than_chunks(mscp, src_prefix, dst_prefix): @pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix) @pytest.mark.parametrize("src, dst", param_single_copy) -def test_set_port(mscp, src_prefix, dst_prefix, src, dst): +def test_set_port_ng(mscp, src_prefix, dst_prefix, src, dst): src.make() - run2ng([mscp, "-H", "-vvv", "-p", 21, src_prefix + src.path, dst_prefix + dst.path]) run2ng([mscp, "-H", "-vvv", "-P", 21, src_prefix + src.path, dst_prefix + dst.path]) src.cleanup() +@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix) +@pytest.mark.parametrize("src, dst", param_single_copy) +def test_set_port_ok(mscp, src_prefix, dst_prefix, src, dst): + src.make() + run2ok([mscp, "-H", "-vvv", "-P", 8022, src_prefix + src.path, dst_prefix + dst.path]) + src.cleanup() + def test_v4only(mscp): src = File("src", size = 1024).make() dst = File("dst") @@ -361,7 +367,7 @@ def test_v4only(mscp): def test_v6only(mscp): src = File("src", size = 1024).make() dst = File("dst") - dst_prefix = "localhost:{}/".format(os.getcwd()) + dst_prefix = "ip6-localhost:{}/".format(os.getcwd()) run2ok([mscp, "-H", "-vvv", "-6", src.path, dst_prefix + dst.path]) assert check_same_md5sum(src, dst) src.cleanup() @@ -535,8 +541,8 @@ def test_checkpoint_dump_and_resume(mscp, src_prefix, dst_prefix): @pytest.mark.parametrize("timeout", [1,2,3]) @pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix) def test_checkpoint_interrupt_and_resume(mscp, timeout, src_prefix, dst_prefix): - src1 = File("src1", size = 512 * 1024 * 1024).make() - src2 = File("src2", size = 512 * 1024 * 1024).make() + src1 = File("src1", size = 1024 * 1024 * 1024).make() + src2 = File("src2", size = 1024 * 1024 * 1024).make() dst1 = File("dst/src1") dst2 = File("dst/src2") run2ng([mscp, "-H", "-vv", "-W", "checkpoint", |