From 0b181b006262ef34a81662783d7a1865e6d848f4 Mon Sep 17 00:00:00 2001 From: Thomas Deutschmann Date: Sat, 19 May 2018 19:44:38 +0200 Subject: app-admin/rsyslog: Fix mmkubernetes test Package-Manager: Portage-2.3.38, Repoman-2.3.9 --- .../8-stable/rsyslog-8.35.0-fix-issue2726.patch | 41 ++++++++++++++++++++++ app-admin/rsyslog/rsyslog-8.35.0.ebuild | 5 ++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 app-admin/rsyslog/files/8-stable/rsyslog-8.35.0-fix-issue2726.patch diff --git a/app-admin/rsyslog/files/8-stable/rsyslog-8.35.0-fix-issue2726.patch b/app-admin/rsyslog/files/8-stable/rsyslog-8.35.0-fix-issue2726.patch new file mode 100644 index 000000000000..eaec239c3839 --- /dev/null +++ b/app-admin/rsyslog/files/8-stable/rsyslog-8.35.0-fix-issue2726.patch @@ -0,0 +1,41 @@ +From c1791ee90fdd8adf219ae3d2b849f5f041284b7c Mon Sep 17 00:00:00 2001 +From: Rich Megginson +Date: Thu, 17 May 2018 18:38:25 -0600 +Subject: [PATCH] mmkubernetes test python must encode response + +https://github.com/rsyslog/rsyslog/issues/2721 +Was not working on python3 - must use `encode()` to convert the +string to a `bytes` object. +Also run the server with python -u to make sure we get the log +output from the kubernetes test server. +--- + tests/mmkubernetes-basic.sh | 2 +- + tests/mmkubernetes_test_server.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/mmkubernetes-basic.sh b/tests/mmkubernetes-basic.sh +index 0bbfd08ca..d320c343f 100755 +--- a/tests/mmkubernetes-basic.sh ++++ b/tests/mmkubernetes-basic.sh +@@ -4,7 +4,7 @@ + . $srcdir/diag.sh init + + testsrv=mmk8s-test-server +-python ./mmkubernetes_test_server.py 18443 rsyslog${testsrv}.pid rsyslogd${testsrv}.started > mmk8s_srv.log 2>&1 & ++python -u ./mmkubernetes_test_server.py 18443 rsyslog${testsrv}.pid rsyslogd${testsrv}.started > mmk8s_srv.log 2>&1 & + BGPROCESS=$! + . $srcdir/diag.sh wait-startup $testsrv + echo background mmkubernetes_test_server.py process id is $BGPROCESS +diff --git a/tests/mmkubernetes_test_server.py b/tests/mmkubernetes_test_server.py +index 0de215603..24f4e1b0e 100644 +--- a/tests/mmkubernetes_test_server.py ++++ b/tests/mmkubernetes_test_server.py +@@ -104,7 +104,7 @@ def do_GET(self): + self.log_error(resp) + self.send_response(status) + self.end_headers() +- self.wfile.write(json.dumps(json.loads(resp), separators=(',',':'))) ++ self.wfile.write(json.dumps(json.loads(resp), separators=(',',':')).encode()) + + port = int(sys.argv[1]) + diff --git a/app-admin/rsyslog/rsyslog-8.35.0.ebuild b/app-admin/rsyslog/rsyslog-8.35.0.ebuild index b225c3969c67..6c81d3b33a1e 100644 --- a/app-admin/rsyslog/rsyslog-8.35.0.ebuild +++ b/app-admin/rsyslog/rsyslog-8.35.0.ebuild @@ -48,7 +48,10 @@ else doc? ( https://www.rsyslog.com/files/download/${PN}/${MY_URL_PREFIX}${PN}-doc-${MY_PV}.tar.gz -> ${MY_FILENAME_DOCS} ) " - PATCHES=( "${FILESDIR}"/${BRANCH}/${PN}-8.35.0-fix-issue2719.patch ) + PATCHES=( + "${FILESDIR}"/${BRANCH}/${PN}-8.35.0-fix-issue2719.patch + "${FILESDIR}"/${BRANCH}/${PN}-8.35.0-fix-issue2726.patch + ) fi LICENSE="GPL-3 LGPL-3 Apache-2.0" -- cgit v1.2.3-65-gdbad