summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2024-02-07 14:34:15 +0900
committerRyo Nakamura <upa@haeena.net>2024-02-07 15:14:27 +0900
commitb2628b54fb08ff0c91b352c4cfc09923a0896027 (patch)
tree1c77df426e9636c796e4568ac5cd12114b052a9d /test
parenta9c59f744a29f921ab55518a3b2b5b5c7ca6b95d (diff)
add -4 and -6 options to use either IPv4 or IPv6
Diffstat (limited to 'test')
-rw-r--r--test/test_e2e.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test_e2e.py b/test/test_e2e.py
index fa17a6a..bfe1c00 100644
--- a/test/test_e2e.py
+++ b/test/test_e2e.py
@@ -324,6 +324,38 @@ def test_set_port(mscp, src_prefix, dst_prefix, src, dst):
run2ng([mscp, "-H", "-vvv", "-P", 21, src_prefix + src.path, dst_prefix + dst.path])
src.cleanup()
+def test_v4only(mscp):
+ src = File("src", size = 1024).make()
+ dst = File("dst")
+ dst_prefix = "localhost:{}/".format(os.getcwd())
+ run2ok([mscp, "-H", "-vvv", "-4", src.path, dst_prefix + dst.path])
+ assert check_same_md5sum(src, dst)
+ src.cleanup()
+ dst.cleanup()
+
+def test_v6only(mscp):
+ src = File("src", size = 1024).make()
+ dst = File("dst")
+ dst_prefix = "localhost:{}/".format(os.getcwd())
+ run2ok([mscp, "-H", "-vvv", "-6", src.path, dst_prefix + dst.path])
+ assert check_same_md5sum(src, dst)
+ src.cleanup()
+ dst.cleanup()
+
+def test_v4_to_v6_should_fail(mscp):
+ src = File("src", size = 1024).make()
+ dst = File("dst")
+ dst_prefix = "[::1]:{}/".format(os.getcwd())
+ run2ng([mscp, "-H", "-vvv", "-4", src.path, dst_prefix + dst.path])
+ src.cleanup()
+
+def test_v6_to_v4_should_fail(mscp):
+ src = File("src", size = 1024).make()
+ dst = File("dst")
+ dst_prefix = "127.0.0.1:{}/".format(os.getcwd())
+ run2ng([mscp, "-H", "-vvv", "-6", src.path, dst_prefix + dst.path])
+ src.cleanup()
+
@pytest.mark.parametrize("src_prefix, dst_prefix", param_remote_prefix)
def test_set_conn_interval(mscp, src_prefix, dst_prefix):
srcs = []
@@ -442,3 +474,4 @@ def test_specify_invalid_password_via_env(mscp):
run2ng([mscp, "-H", "-vvv", "-l", "test",
src.path, "localhost:" + dst.path], env = env)
src.cleanup()
+