summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-python/dugong/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-python/dugong/files')
-rw-r--r--dev-python/dugong/files/3.2-aborted_write.patch45
-rw-r--r--dev-python/dugong/files/3.2-extract_links.patch26
-rw-r--r--dev-python/dugong/files/3.2-timeout.patch19
-rw-r--r--dev-python/dugong/files/3.3-test-timeout.patch128
4 files changed, 218 insertions, 0 deletions
diff --git a/dev-python/dugong/files/3.2-aborted_write.patch b/dev-python/dugong/files/3.2-aborted_write.patch
new file mode 100644
index 000000000000..bf25a3772e15
--- /dev/null
+++ b/dev-python/dugong/files/3.2-aborted_write.patch
@@ -0,0 +1,45 @@
+https://bitbucket.org/nikratio/python-dugong/issue/13/test_aborted_write-failures-in-latest
+diff --git a/test/test_dugong.py b/test/test_dugong.py
+--- a/test/test_dugong.py
++++ b/test/test_dugong.py
+@@ -540,7 +540,7 @@
+ conn.readall()
+
+ def test_aborted_write1(conn, monkeypatch):
+- BUFSIZE = 64*1024
++ BUFSIZE = 640*1024
+
+ # Monkeypatch request handler
+ def do_PUT(self):
+@@ -561,8 +561,9 @@
+
+ # Try to write data
+ with pytest.raises(ConnectionClosed):
+- for _ in range(50):
++ for _ in range(5000):
+ conn.write(b'f' * BUFSIZE)
++ time.sleep(0.1)
+
+ # Nevertheless, try to read response
+ resp = conn.read_response()
+@@ -570,7 +571,7 @@
+ assert resp.reason == 'Please stop!'
+
+ def test_aborted_write2(conn, monkeypatch):
+- BUFSIZE = 64*1024
++ BUFSIZE = 640*1024
+
+ # Monkeypatch request handler
+ def do_PUT(self):
+@@ -589,8 +590,9 @@
+
+ # Try to write data
+ with pytest.raises(ConnectionClosed):
+- for _ in range(50):
++ for _ in range(5000):
+ conn.write(b'f' * BUFSIZE)
++ time.sleep(0.1)
+
+ # Nevertheless, try to read response
+ assert_raises(ConnectionClosed, conn.read_response)
+
diff --git a/dev-python/dugong/files/3.2-extract_links.patch b/dev-python/dugong/files/3.2-extract_links.patch
new file mode 100644
index 000000000000..0e8d251bdd86
--- /dev/null
+++ b/dev-python/dugong/files/3.2-extract_links.patch
@@ -0,0 +1,26 @@
+# HG changeset patch
+# User Nikolaus Rath <Nikolaus@rath.org>
+# Date 1407732767 25200
+# Node ID 1cfd473db8736251291e106ce6cd488011626276
+# Parent cd7ad81f4eea24e530db152edd6d8831dc5bd7bc
+Make extract_links.py Python 3.3 compatible again.
+
+Fixes issue #15.
+
+diff --git a/examples/extract_links.py b/examples/extract_links.py
+--- a/examples/extract_links.py
++++ b/examples/extract_links.py
+@@ -30,7 +30,11 @@
+
+ class LinkExtractor(HTMLParser):
+ def __init__(self):
+- super().__init__(convert_charrefs=True)
++ if sys.version_info < (3,4):
++ # Python 3.3 doesn't know about convert_charrefs
++ super().__init__()
++ else:
++ super().__init__(convert_charrefs=True)
+ self.links = []
+
+ def handle_starttag(self, tag, attrs):
+
diff --git a/dev-python/dugong/files/3.2-timeout.patch b/dev-python/dugong/files/3.2-timeout.patch
new file mode 100644
index 000000000000..5ee43f7367c7
--- /dev/null
+++ b/dev-python/dugong/files/3.2-timeout.patch
@@ -0,0 +1,19 @@
+https://bitbucket.org/nikratio/python-dugong/issue/14/test_send_timeout-ssl-failure-in-latest
+diff --git a/test/test_dugong.py b/test/test_dugong.py
+--- a/test/test_dugong.py
++++ b/test/test_dugong.py
+@@ -726,11 +728,11 @@
+
+ # We don't know how much data can be buffered, so we
+ # claim to send a lot and do so in a loop.
+- len_ = 1024**3
++ len_ = 10 * 1024**3
+ conn.send_request('PUT', '/recv_something', body=BodyFollowing(len_))
+ with pytest.raises(dugong.ConnectionTimedOut):
+ while len_ > 0:
+- conn.write(b'x' * min(len_, 16*1024))
++ conn.write(b'x' * min(len_, 640*1024))
+
+
+ DUMMY_DATA = ','.join(str(x) for x in range(10000)).encode()
+
diff --git a/dev-python/dugong/files/3.3-test-timeout.patch b/dev-python/dugong/files/3.3-test-timeout.patch
new file mode 100644
index 000000000000..afd391207976
--- /dev/null
+++ b/dev-python/dugong/files/3.3-test-timeout.patch
@@ -0,0 +1,128 @@
+https://bitbucket.org/nikratio/python-dugong/commits/0e9d67700bc8
+diff --git a/test/test_dugong.py b/test/test_dugong.py
+--- a/test/test_dugong.py
++++ b/test/test_dugong.py
+@@ -99,6 +99,12 @@
+ request.addfinalizer(conn.disconnect)
+ return conn
+
++@pytest.fixture()
++def random_fh(request):
++ fh = open('/dev/urandom', 'rb')
++ request.addfinalizer(fh.close)
++ return fh
++
+ def check_http_connection():
+ '''Skip test if we can't connect to ssl test server'''
+
+@@ -170,12 +176,12 @@
+ conn.get_ssl_cipher()
+ conn.get_ssl_peercert()
+
+-def test_blocking_send(conn):
++def test_blocking_send(conn, random_fh):
+ # Send requests until we block because all TCP buffers are full
+
+- path = '/send_100_1200-byte_chunks'
++ path = '/send_102400_random_bytes'
+ for count in itertools.count():
+- crt = conn.co_send_request('GET', path, body=DUMMY_DATA[:8192])
++ crt = conn.co_send_request('GET', path, body=random_fh.read(8192))
+ flag = False
+ for io_req in crt:
+ if not io_req.poll(1):
+@@ -539,7 +545,7 @@
+ conn.read_response()
+ conn.readall()
+
+-def test_aborted_write1(conn, monkeypatch):
++def test_aborted_write1(conn, monkeypatch, random_fh):
+ BUFSIZE = 64*1024
+
+ # Monkeypatch request handler
+@@ -562,14 +568,14 @@
+ # Try to write data
+ with pytest.raises(ConnectionClosed):
+ for _ in range(50):
+- conn.write(b'f' * BUFSIZE)
++ conn.write(random_fh.read(BUFSIZE))
+
+ # Nevertheless, try to read response
+ resp = conn.read_response()
+ assert resp.status == 401
+ assert resp.reason == 'Please stop!'
+
+-def test_aborted_write2(conn, monkeypatch):
++def test_aborted_write2(conn, monkeypatch, random_fh):
+ BUFSIZE = 64*1024
+
+ # Monkeypatch request handler
+@@ -590,7 +596,7 @@
+ # Try to write data
+ with pytest.raises(ConnectionClosed):
+ for _ in range(50):
+- conn.write(b'f' * BUFSIZE)
++ conn.write(random_fh.read(BUFSIZE))
+
+ # Nevertheless, try to read response
+ assert_raises(ConnectionClosed, conn.read_response)
+@@ -716,12 +722,13 @@
+ assert conn.read(50) == b'x' * 25
+ assert_raises(dugong.ConnectionTimedOut, conn.read, 50)
+
+-def test_send_timeout(conn, monkeypatch):
++def test_send_timeout(conn, monkeypatch, random_fh):
+ conn.timeout = 1
+
+ def do_PUT(self):
+ # Read just a tiny bit
+ self.rfile.read(256)
++ time.sleep(2*conn.timeout)
+ monkeypatch.setattr(MockRequestHandler, 'do_PUT', do_PUT)
+
+ # We don't know how much data can be buffered, so we
+@@ -730,7 +737,7 @@
+ conn.send_request('PUT', '/recv_something', body=BodyFollowing(len_))
+ with pytest.raises(dugong.ConnectionTimedOut):
+ while len_ > 0:
+- conn.write(b'x' * min(len_, 16*1024))
++ conn.write(random_fh.read(min(len_, 16*1024)))
+
+
+ DUMMY_DATA = ','.join(str(x) for x in range(10000)).encode()
+@@ -743,6 +750,14 @@
+ def log_message(self, format, *args):
+ pass
+
++ def setup(self):
++ super().setup()
++ self.random_fh = open('/dev/urandom', 'rb')
++
++ def finish(self):
++ super().finish()
++ self.random_fh.close()
++
+ def handle_expect_100(self):
+ if self.handle_errors():
+ return
+@@ -782,14 +797,17 @@
+ self.wfile.close()
+ return
+
+- hit = re.match(r'^/send_([0-9]+)_bytes', self.path)
++ hit = re.match(r'^/send_([0-9]+)_(random_)?bytes', self.path)
+ if hit:
+ len_ = int(hit.group(1))
+ self.send_response(200)
+ self.send_header("Content-Type", 'application/octet-stream')
+ self.send_header("Content-Length", str(len_))
+ self.end_headers()
+- self.wfile.write(DUMMY_DATA[:len_])
++ if hit.group(2):
++ self.wfile.write(self.random_fh.read(len_))
++ else:
++ self.wfile.write(DUMMY_DATA[:len_])
+ return
+
+ hit = re.match(r'^/send_([0-9]+)_([0-9]+)-byte_chunks(?:_delay_([0-9]+)_ms)?',
+