Skip to content

Commit 0d248c5

Browse files
committed
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
1 parent 9d02fc9 commit 0d248c5

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

scripts/test-in-container.sh

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ cd $script_dir
88

99
set -x
1010

11+
# sshd Linsten on 22 and 8022
12+
echo "Port 22" > /etc/ssh/sshd_config.d/mscp-test.conf
13+
echo "Port 8022" >> /etc/ssh/sshd_config.d/mscp-test.conf
14+
1115
# Run sshd
1216
if [ ! -e /var/run/sshd.pid ]; then
1317
/usr/sbin/sshd

test/test_e2e.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import os
1111
import shutil
1212

13-
from subprocess import check_call, PIPE, CalledProcessError
13+
from subprocess import check_call, CalledProcessError
1414
from util import File, check_same_md5sum
1515

1616

@@ -343,12 +343,18 @@ def test_dont_make_conns_more_than_chunks(mscp, src_prefix, dst_prefix):
343343

344344
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
345345
@pytest.mark.parametrize("src, dst", param_single_copy)
346-
def test_set_port(mscp, src_prefix, dst_prefix, src, dst):
346+
def test_set_port_ng(mscp, src_prefix, dst_prefix, src, dst):
347347
src.make()
348-
run2ng([mscp, "-H", "-vvv", "-p", 21, src_prefix + src.path, dst_prefix + dst.path])
349348
run2ng([mscp, "-H", "-vvv", "-P", 21, src_prefix + src.path, dst_prefix + dst.path])
350349
src.cleanup()
351350

351+
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
352+
@pytest.mark.parametrize("src, dst", param_single_copy)
353+
def test_set_port_ok(mscp, src_prefix, dst_prefix, src, dst):
354+
src.make()
355+
run2ok([mscp, "-H", "-vvv", "-P", 8022, src_prefix + src.path, dst_prefix + dst.path])
356+
src.cleanup()
357+
352358
def test_v4only(mscp):
353359
src = File("src", size = 1024).make()
354360
dst = File("dst")
@@ -361,7 +367,7 @@ def test_v4only(mscp):
361367
def test_v6only(mscp):
362368
src = File("src", size = 1024).make()
363369
dst = File("dst")
364-
dst_prefix = "localhost:{}/".format(os.getcwd())
370+
dst_prefix = "ip6-localhost:{}/".format(os.getcwd())
365371
run2ok([mscp, "-H", "-vvv", "-6", src.path, dst_prefix + dst.path])
366372
assert check_same_md5sum(src, dst)
367373
src.cleanup()
@@ -535,8 +541,8 @@ def test_checkpoint_dump_and_resume(mscp, src_prefix, dst_prefix):
535541
@pytest.mark.parametrize("timeout", [1,2,3])
536542
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
537543
def test_checkpoint_interrupt_and_resume(mscp, timeout, src_prefix, dst_prefix):
538-
src1 = File("src1", size = 512 * 1024 * 1024).make()
539-
src2 = File("src2", size = 512 * 1024 * 1024).make()
544+
src1 = File("src1", size = 1024 * 1024 * 1024).make()
545+
src2 = File("src2", size = 1024 * 1024 * 1024).make()
540546
dst1 = File("dst/src1")
541547
dst2 = File("dst/src2")
542548
run2ng([mscp, "-H", "-vv", "-W", "checkpoint",

0 commit comments

Comments
 (0)