Commit ee15798b authored by Jason Madden's avatar Jason Madden Committed by GitHub

Merge pull request #91 from zopefoundation/issue90

runzeo clears socket files no matter what type of string address is
parents a4af74b4 d820dcea
......@@ -5,7 +5,7 @@ matrix:
- os: linux
python: 2.7
- os: linux
python: pypy-5.4.1
python: pypy-5.6.0
- os: linux
python: 3.4
- os: linux
......
......@@ -8,6 +8,8 @@ Changelog
new-style on Python 3). This improves performance on PyPy. See
`issue 86 <<https://github.com/zopefoundation/ZEO/pull/86>`_.
- Fixed removing UNIX socket files under Python 2 with ZConfig 3.2.0.
See `issue 90 <https://github.com/zopefoundation/ZEO/issues/90>`_.
5.1.0 (2017-04-03)
------------------
......
......@@ -190,10 +190,10 @@ class ClientStorage(ZODB.ConflictResolution.ConflictResolvingStorage):
self.__name__ = name or str(addr) # Standard convention for storages
if isinstance(addr, str):
if isinstance(addr, six.string_types):
addr = [addr]
elif (isinstance(addr, tuple) and len(addr) == 2 and
isinstance(addr[0], str) and isinstance(addr[1], int)):
isinstance(addr[0], six.string_types) and isinstance(addr[1], int)):
addr = [addr]
logger.info(
......
......@@ -29,19 +29,17 @@ Options:
Unless -C is specified, -a and -f are required.
"""
from __future__ import print_function
from __future__ import print_function
# The code here is designed to be reused by other, similar servers.
# For the forseeable future, it must work under Python 2.1 as well as
# 2.2 and above.
import asyncore
import os
import sys
import signal
import socket
import logging
import six
import ZConfig.datatypes
from zdaemon.zdoptions import ZDOptions
......@@ -193,7 +191,7 @@ class ZEOServer(object):
return 1
def clear_socket(self):
if isinstance(self.options.address, type("")):
if isinstance(self.options.address, six.string_types):
try:
os.unlink(self.options.address)
except os.error:
......@@ -275,7 +273,7 @@ class ZEOServer(object):
def handle_sigusr2(self):
# log rotation signal - do the same as Zope 2.7/2.8...
if self.options.config_logger is None or os.name not in ("posix", "nt"):
log("received SIGUSR2, but it was not handled!",
log("received SIGUSR2, but it was not handled!",
level=logging.WARNING)
return
......
-----BEGIN CERTIFICATE-----
MIID/TCCAuWgAwIBAgIJAJWO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49mJ90C+GaHn75HKqKhSb1oHNq1oPUqmEreC0AGE/fGAMSd2SZ5Y83VW9eZ
JhzzQtAXBsQqrJO9GQyJGOnnSrsRAIM800nRLrS/ozupwM4EVb7UeQcaDF2vsVEI
jQS/oQKBgHj26xn7AunX5GS8EYe4GPj4VZehmlnEKONGrPrr25aWkaY4kDJgMLUb
AxwIQHbCMm5TMqIxi5l39/O9dxuuGCkOs37j7C3f3VVFuQW1KKyHem9OClgFDZj3
tEEk1N3NevrH06NlmAHweHMuJXL8mBvM375zH9tSw5mgG0OMRbnG
-----END RSA PRIVATE KEY-----
......@@ -53,7 +53,7 @@ class ZEOConfig(object):
else:
self.logpath = 'server.log'
if not isinstance(addr, str):
if not isinstance(addr, six.string_types):
addr = '%s:%s' % addr
self.log = log
......
-----BEGIN CERTIFICATE-----
MIID/TCCAuWgAwIBAgIJAKpYWt7G+3R4MA0GCSqGSIb3DQEBBQUAMFwxCzAJBgNV
BAYTAlVTMQswCQYDVQQIEwJWQTENMAsGA1UEChMEWk9EQjERMA8GA1UEAxMIem9k
Yi5vcmcxHjAcBgkqhkiG9w0BCQEWD3NlcnZlckB6b2RiLm9yZzAeFw0xNjA2MjMx
NTA5MTZaFw0xNzA2MjMxNTA5MTZaMFwxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJW
QTENMAsGA1UEChMEWk9EQjERMA8GA1UEAxMIem9kYi5vcmcxHjAcBgkqhkiG9w0B
CQEWD3NlcnZlckB6b2RiLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBANqyMazB39wFKFh2nIspOw+e/7LPLQZpsd6BnYOxPbdlhb23Q930WqgW5qCA
aJjLqkmvQvZhElXdO2lOxGLR2/Cu71UgmYXkZbMKqPNtoYCPRPCCKm5EczAFXTy4
SUD40wAlndP7J8TjpIaKZjgdfy4GWnGQQAbXUR1eFZszQtU7pUvyjgXsY+BEgq4h
F4iIBarcf8k/6PTldTRLxEbRiTNZ4cdIEtTJL/LzSu5o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OfTsuGm+Mokucbbw9jaWVT6Co3kWrHySInhZ
sfTwHKz5ojGBcQD4l06xaVM9utNi6r8wvJijFl5xIsMzc5szEkWs9vkCgYEA9285
bGSAAwzUFHVk1pyLKozM2gOtF5rrAUQlWtNVU6K2tw+MKEGara0f+HFZrJZC9Rh2
HBm2U9PPt/kJ73HErQG+E6n0jfol8TQ3ZKz3tlSxImh0CiaKLnh4ahf7o8zU16nT
XDfu3+Rf11EhORXYfZLmdubfCOD4ZaB2/405N3ECgYEA7b4k0gkoLYi1JJiFwD+4
vhBmUAgVCV/ZeoqiOOZRCnITz3GDdVw6uDXm02o2R8wM5Fu6jZo0UmLNyvGEzyFC
H37PbM6Am7LfYZuqW6w1LClQLfVfmJfGROZvib65QqWTlvj+fbsdyniuhIJ5Z1Tf
BH+kyiEvxyHjdDLRJ9vfsKECgYA8P9MFt7sMAxWpHaS+NUQVyk8fTwHY25oZptRJ
t2fxg49mJ90C+GaHn75HKqKhSb1oHNq1oPUqmEreC0AGE/fGAMSd2SZ5Y83VW9eZ
JhzzQtAXBsQqrJO9GQyJGOnnSrsRAIM800nRLrS/ozupwM4EVb7UeQcaDF2vsVEI
jQS/oQKBgHj26xn7AunX5GS8EYe4GPj4VZehmlnEKONGrPrr25aWkaY4kDJgMLUb
AxwIQHbCMm5TMqIxi5l39/O9dxuuGCkOs37j7C3f3VVFuQW1KKyHem9OClgFDZj3
tEEk1N3NevrH06NlmAHweHMuJXL8mBvM375zH9tSw5mgG0OMRbnG
-----END RSA PRIVATE KEY-----
#
# Fix AttributeError: 'ZEOServer' object has no attribute 'server' in
# ZEOServer.main
#
import unittest
import mock
import os
from ZEO._compat import PY3
from ZEO.runzeo import ZEOServer
......@@ -55,9 +55,6 @@ class TestZEOServer(ZEOServer):
self.called.append("close_server")
ZEOServer.close_server(self)
def clear_socket(self):
self.called.append("clear_socket")
def remove_pidfile(self):
self.called.append("remove_pidfile")
......@@ -65,6 +62,10 @@ class TestZEOServer(ZEOServer):
class AttributeErrorTests(unittest.TestCase):
def testFailCreateServer(self):
#
# Fix AttributeError: 'ZEOServer' object has no attribute
# 'server' in ZEOServer.main
#
# Demonstrate the AttributeError
zeo = TestZEOServer(fail_create_server=True)
self.assertRaises(RuntimeError, zeo.main)
......@@ -137,9 +138,42 @@ class CloseServerTests(unittest.TestCase):
self.assertEqual(hasattr(zeo, "server"), True)
self.assertEqual(zeo.server, None)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(AttributeErrorTests))
suite.addTest(unittest.makeSuite(CloseServerTests))
return suite
@mock.patch('os.unlink')
class TestZEOServerSocket(unittest.TestCase):
def _unlinked(self, unlink, options):
server = ZEOServer(options)
server.clear_socket()
unlink.assert_called_once()
def _not_unlinked(self, unlink, options):
server = ZEOServer(options)
server.clear_socket()
unlink.assert_not_called()
def test_clear_with_native_str(self, unlink):
class Options(object):
address = "a str that does not exist"
self._unlinked(unlink, Options)
def test_clear_with_unicode_str(self, unlink):
class Options(object):
address = u"a str that does not exist"
self._unlinked(unlink, Options)
def test_clear_with_bytes(self, unlink):
class Options(object):
address = b'a byte str that does not exist'
if PY3:
# bytes are not a string type under Py3
assertion = self._not_unlinked
else:
assertion = self._unlinked
assertion(unlink, Options)
def test_clear_with_tuple(self, unlink):
class Options(object):
address = ('abc', 1)
self._not_unlinked(unlink, Options)
......@@ -369,6 +369,12 @@ def client_ssl(cafile=server_key,
context.check_hostname = False
return context
# Here's a command to create a cert/key pair:
# openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem \
# -days 999999 -nodes -batch
# See
# https://discuss.pivotal.io/hc/en-us/articles/202653388-How-to-renew-an-expired-Apache-Web-Server-self-signed-certificate-using-the-OpenSSL-tool
# for instructions on updating the server.pem (the certificate) if
# needed. server.pem.csr is the request.
# This should do it:
# openssl x509 -req -days 999999 -in src/ZEO/tests/server.pem.csr -signkey src/ZEO/tests/server_key.pem -out src/ZEO/tests/server.pem
# If you need to create a new key first:
# openssl genrsa -out server_key.pem 2048
# These two files should then be copied to client_key.pem and client.pem.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment