mirror of
https://github.com/upa/mscp.git
synced 2026-02-04 03:24:58 +08:00
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
This commit is contained in:
@@ -8,6 +8,10 @@ cd $script_dir
|
|||||||
|
|
||||||
set -x
|
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
|
# Run sshd
|
||||||
if [ ! -e /var/run/sshd.pid ]; then
|
if [ ! -e /var/run/sshd.pid ]; then
|
||||||
/usr/sbin/sshd
|
/usr/sbin/sshd
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import time
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from subprocess import check_call, PIPE, CalledProcessError
|
from subprocess import check_call, CalledProcessError
|
||||||
from util import File, check_same_md5sum
|
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_prefix, dst_prefix", param_remote_prefix)
|
||||||
@pytest.mark.parametrize("src, dst", param_single_copy)
|
@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()
|
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])
|
run2ng([mscp, "-H", "-vvv", "-P", 21, src_prefix + src.path, dst_prefix + dst.path])
|
||||||
src.cleanup()
|
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):
|
def test_v4only(mscp):
|
||||||
src = File("src", size = 1024).make()
|
src = File("src", size = 1024).make()
|
||||||
dst = File("dst")
|
dst = File("dst")
|
||||||
@@ -361,7 +367,7 @@ def test_v4only(mscp):
|
|||||||
def test_v6only(mscp):
|
def test_v6only(mscp):
|
||||||
src = File("src", size = 1024).make()
|
src = File("src", size = 1024).make()
|
||||||
dst = File("dst")
|
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])
|
run2ok([mscp, "-H", "-vvv", "-6", src.path, dst_prefix + dst.path])
|
||||||
assert check_same_md5sum(src, dst)
|
assert check_same_md5sum(src, dst)
|
||||||
src.cleanup()
|
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("timeout", [1,2,3])
|
||||||
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
|
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
|
||||||
def test_checkpoint_interrupt_and_resume(mscp, timeout, src_prefix, dst_prefix):
|
def test_checkpoint_interrupt_and_resume(mscp, timeout, src_prefix, dst_prefix):
|
||||||
src1 = File("src1", size = 512 * 1024 * 1024).make()
|
src1 = File("src1", size = 1024 * 1024 * 1024).make()
|
||||||
src2 = File("src2", size = 512 * 1024 * 1024).make()
|
src2 = File("src2", size = 1024 * 1024 * 1024).make()
|
||||||
dst1 = File("dst/src1")
|
dst1 = File("dst/src1")
|
||||||
dst2 = File("dst/src2")
|
dst2 = File("dst/src2")
|
||||||
run2ng([mscp, "-H", "-vv", "-W", "checkpoint",
|
run2ng([mscp, "-H", "-vv", "-W", "checkpoint",
|
||||||
|
|||||||
Reference in New Issue
Block a user