aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/qemu_test/ports.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/qemu_test/ports.py')
-rw-r--r--tests/functional/qemu_test/ports.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/functional/qemu_test/ports.py b/tests/functional/qemu_test/ports.py
index cc39939..81174a6 100644
--- a/tests/functional/qemu_test/ports.py
+++ b/tests/functional/qemu_test/ports.py
@@ -10,12 +10,11 @@
import fcntl
import os
import socket
-import sys
-import tempfile
from .config import BUILD_DIR
from typing import List
+
class Ports():
PORTS_ADDR = '127.0.0.1'
@@ -24,8 +23,9 @@ class Ports():
PORTS_END = PORTS_START + PORTS_RANGE_SIZE
def __enter__(self):
- lock_file = os.path.join(BUILD_DIR, "tests", "functional", "port_lock")
- self.lock_fh = os.open(lock_file, os.O_CREAT)
+ lock_file = os.path.join(BUILD_DIR, "tests", "functional",
+ f".port_lock.{self.PORTS_START}")
+ self.lock_fh = os.open(lock_file, os.O_CREAT, mode=0o666)
fcntl.flock(self.lock_fh, fcntl.LOCK_EX)
return self