mirror of https://github.com/borgbackup/borg.git
test_unix_socket fix
This commit is contained in:
parent
912df41c4a
commit
1e5c62f1a1
|
@ -175,8 +175,9 @@ def test_unix_socket(archivers, request, monkeypatch):
|
|||
|
||||
cmd(archiver, f"--repo={repo_location}", "rcreate", RK_ENCRYPTION)
|
||||
try:
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sock.bind(tempfile.mktemp(suffix="unix-socket", prefix="input"))
|
||||
with tempfile.TemporaryDirectory(prefix="input") as temp_dir:
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
sock.bind(os.path.join(temp_dir, "unix-socket"))
|
||||
except PermissionError as err:
|
||||
if err.errno == errno.EPERM:
|
||||
pytest.skip("unix sockets disabled or not supported")
|
||||
|
|
Loading…
Reference in New Issue