Remove support for running unit tests in Windows

Support for Windows OS was already removed[1].

[1] 3df106fa34080ab32e9a1ee334c93e0df29b68e7

Change-Id: I8fef84147c2d409f3875a7bbad69a5bc0456fb2f
This commit is contained in:
Takashi Kajinami 2025-01-18 14:53:34 +09:00
parent c70e6eee79
commit d49bfca815

View File

@ -14,6 +14,7 @@
import collections
import errno
import fcntl
import multiprocessing
import os
import signal
@ -30,25 +31,6 @@ from oslo_concurrency.fixture import lockutils as fixtures
from oslo_concurrency import lockutils
from oslo_config import fixture as config
if sys.platform == 'win32':
import msvcrt
else:
import fcntl
def lock_file(handle):
if sys.platform == 'win32':
msvcrt.locking(handle.fileno(), msvcrt.LK_NBLCK, 1)
else:
fcntl.flock(handle, fcntl.LOCK_EX | fcntl.LOCK_NB)
def unlock_file(handle):
if sys.platform == 'win32':
msvcrt.locking(handle.fileno(), msvcrt.LK_UNLCK, 1)
else:
fcntl.flock(handle, fcntl.LOCK_UN)
def lock_files(handles_dir, out_queue):
with lockutils.lock('external', 'test-', external=True):
@ -65,9 +47,9 @@ def lock_files(handles_dir, out_queue):
count = 0
for handle in handles:
try:
lock_file(handle)
fcntl.flock(handle, fcntl.LOCK_EX | fcntl.LOCK_NB)
count += 1
unlock_file(handle)
fcntl.flock(handle, fcntl.LOCK_UN)
except OSError:
os._exit(2)
finally: