Skip to content

Commit

Permalink
fix port tests and v6only test.
Browse files Browse the repository at this point in the history
port test: sshd listens on 8022 and run mscp with -P 8022
v6only test: change remote name from localhost to ip6-localhost
  • Loading branch information
upa committed Mar 12, 2024
1 parent 9d02fc9 commit 0d248c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions scripts/test-in-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 12 additions & 6 deletions test/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
import shutil

from subprocess import check_call, PIPE, CalledProcessError
from subprocess import check_call, CalledProcessError
from util import File, check_same_md5sum


Expand Down Expand Up @@ -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")
Expand All @@ -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()
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0d248c5

Please sign in to comment.