diff options
author | Mike Gilbert <floppymaster@gmail.com> | 2017-03-11 13:51:16 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-03-11 13:51:16 -0500 |
commit | 35a27a437229a3723c8cd604819d7d90e8105010 (patch) | |
tree | c48f813996c2433f711c6cb67550e538c5e37065 | |
parent | ea8e70593987570b29608369abe9726de12d2ca6 (diff) | |
download | python-systemd-35a27a437229a3723c8cd604819d7d90e8105010.tar.gz |
test_daemon: xfail test_notify_with_socket if bind() fails (#42)
This bind() call may fail if TMPDIR is too long.
Bug: https://bugs.gentoo.org/610368
-rw-r--r-- | systemd/test/test_daemon.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/systemd/test/test_daemon.py b/systemd/test/test_daemon.py index e827e1d..7733552 100644 --- a/systemd/test/test_daemon.py +++ b/systemd/test/test_daemon.py @@ -238,7 +238,10 @@ def test_notify_bad_socket(): def test_notify_with_socket(tmpdir): path = tmpdir.join('socket').strpath sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) - sock.bind(path) + try: + sock.bind(path) + except socket.error as e: + pytest.xfail('failed to bind socket (%s)' % e) # SO_PASSCRED is not defined in python2.7 SO_PASSCRED = getattr(socket, 'SO_PASSCRED', 16) sock.setsockopt(socket.SOL_SOCKET, SO_PASSCRED, 1) |