Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-vpn/6tunnel/files/, net-vpn/6tunnel/
Date: Wed, 07 Oct 2020 08:41:40
Message-Id: 1602060086.d91b6f03ce75a70edb8c8eb95715c304fd19fe3c.juippis@gentoo
1 commit: d91b6f03ce75a70edb8c8eb95715c304fd19fe3c
2 Author: Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
3 AuthorDate: Fri Sep 18 10:41:07 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 7 08:41:26 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d91b6f03
7
8 net-vpn/6tunnel: fix tests
9
10 Closes: https://bugs.gentoo.org/728610
11 Package-Manager: Portage-3.0.4, Repoman-3.0.1
12 Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
13 Closes: https://github.com/gentoo/gentoo/pull/17585
14 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
15
16 net-vpn/6tunnel/6tunnel-0.13.ebuild | 7 +++-
17 net-vpn/6tunnel/files/6tunnel-0.13-test.patch | 56 +++++++++++++++++++++++++++
18 2 files changed, 61 insertions(+), 2 deletions(-)
19
20 diff --git a/net-vpn/6tunnel/6tunnel-0.13.ebuild b/net-vpn/6tunnel/6tunnel-0.13.ebuild
21 index 2947248fbba..0719d63523d 100644
22 --- a/net-vpn/6tunnel/6tunnel-0.13.ebuild
23 +++ b/net-vpn/6tunnel/6tunnel-0.13.ebuild
24 @@ -5,9 +5,12 @@ EAPI=7
25
26 DESCRIPTION="TCP proxy for applications that don't speak IPv6"
27 HOMEPAGE="https://github.com/wojtekka/6tunnel"
28 -SRC_URI="https://github.com/wojtekka/${PN}/releases/download/${PV}/${P}.tar.gz"
29 +SRC_URI="https://github.com/wojtekka/6tunnel/releases/download/${PV}/${P}.tar.gz"
30
31 LICENSE="GPL-2"
32 SLOT="0"
33 KEYWORDS="~amd64 ~s390 ~x86"
34 -IUSE=""
35 +
36 +PATCHES=(
37 + "${FILESDIR}/${P}-test.patch"
38 +)
39
40 diff --git a/net-vpn/6tunnel/files/6tunnel-0.13-test.patch b/net-vpn/6tunnel/files/6tunnel-0.13-test.patch
41 new file mode 100644
42 index 00000000000..1cac66ea73c
43 --- /dev/null
44 +++ b/net-vpn/6tunnel/files/6tunnel-0.13-test.patch
45 @@ -0,0 +1,56 @@
46 +From 9e4119f03f57eec67b97dddbf09d363b638791dc Mon Sep 17 00:00:00 2001
47 +From: Wojtek Kaniewski <wojtekka@×××××××.net>
48 +Date: Fri, 18 Sep 2020 20:36:19 +0200
49 +Subject: [PATCH] Move test script to Python 3
50 +
51 +---
52 + test.py | 14 +++++++-------
53 + 1 file changed, 7 insertions(+), 7 deletions(-)
54 +
55 +diff --git a/test.py b/test.py
56 +index c56feca..4a754bd 100755
57 +--- a/test.py
58 ++++ b/test.py
59 +@@ -1,4 +1,4 @@
60 +-#!/usr/bin/env python
61 ++#!/usr/bin/env python3
62 +
63 + import os
64 + import socket
65 +@@ -8,7 +8,7 @@ import select
66 + (SUCCESS, COMMAND_FAIL, CONNECT_FAIL, DISCONNECT, ACCEPT_FAIL, DATA_MISMATCH) = range(6)
67 + labels = ["success", "command fail", "connection fail", "disconnection", "accept fail", "data mismatch"]
68 +
69 +-def test(expect, client_af, server_af, from_ip, to_ip, args="", client_sends_first="NICK nick\r\n", server_receives="NICK nick\r\n", app_responds="", app_inserts="", server_sends_then=":localhost 001 nick :Welcome\r\n"):
70 ++def test(expect, client_af, server_af, from_ip, to_ip, args="", client_sends_first=b"NICK nick\r\n", server_receives=b"NICK nick\r\n", app_responds=b"", app_inserts=b"", server_sends_then=b":localhost 001 nick :Welcome\r\n"):
71 + # Open and close a socket to get random port available
72 +
73 + client_sock = socket.socket(client_af, socket.SOCK_STREAM, 0)
74 +@@ -26,7 +26,7 @@ def test(expect, client_af, server_af, from_ip, to_ip, args="", client_sends_fir
75 + server_port = server_sock.getsockname()[1]
76 +
77 + all_args = "-1 %s %d %s %d" % (args, client_port, to_ip, server_port)
78 +- print "Running with %s" % all_args
79 ++ print ("Running with %s" % all_args)
80 + if os.system("./6tunnel " + all_args) != 0:
81 + if expect != COMMAND_FAIL:
82 + raise Exception("expected %s yet command failed" % labels[expect])
83 +@@ -139,11 +139,11 @@ test(COMMAND_FAIL, socket.AF_INET6, socket.AF_INET6, '::1', '::1', '-6 -s 127.0.
84 +
85 + # Test IRC password options
86 +
87 +-test(SUCCESS, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-I password', app_inserts="PASS password\r\n")
88 ++test(SUCCESS, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-I password', app_inserts=b"PASS password\r\n")
89 +
90 +-test(ACCEPT_FAIL, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-i password', client_sends_first="NICK nick\r\n")
91 ++test(ACCEPT_FAIL, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-i password', client_sends_first=b"NICK nick\r\n")
92 +
93 +-test(ACCEPT_FAIL, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-i password', client_sends_first="PASS invalid\r\nNICK nick\r\n", app_responds=":6tunnel 464 * :Password incorrect\r\n")
94 ++test(ACCEPT_FAIL, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-i password', client_sends_first=b"PASS invalid\r\nNICK nick\r\n", app_responds=b":6tunnel 464 * :Password incorrect\r\n")
95 +
96 +-test(SUCCESS, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-i password', client_sends_first="PASS password\r\nNICK nick\r\n")
97 ++test(SUCCESS, socket.AF_INET, socket.AF_INET6, '127.0.0.1', '::1', '-i password', client_sends_first=b"PASS password\r\nNICK nick\r\n")
98 +
99 +--
100 +2.26.2
101 +