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:
parent
c70e6eee79
commit
d49bfca815
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
import collections
|
import collections
|
||||||
import errno
|
import errno
|
||||||
|
import fcntl
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
@ -30,25 +31,6 @@ from oslo_concurrency.fixture import lockutils as fixtures
|
|||||||
from oslo_concurrency import lockutils
|
from oslo_concurrency import lockutils
|
||||||
from oslo_config import fixture as config
|
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):
|
def lock_files(handles_dir, out_queue):
|
||||||
with lockutils.lock('external', 'test-', external=True):
|
with lockutils.lock('external', 'test-', external=True):
|
||||||
@ -65,9 +47,9 @@ def lock_files(handles_dir, out_queue):
|
|||||||
count = 0
|
count = 0
|
||||||
for handle in handles:
|
for handle in handles:
|
||||||
try:
|
try:
|
||||||
lock_file(handle)
|
fcntl.flock(handle, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
||||||
count += 1
|
count += 1
|
||||||
unlock_file(handle)
|
fcntl.flock(handle, fcntl.LOCK_UN)
|
||||||
except OSError:
|
except OSError:
|
||||||
os._exit(2)
|
os._exit(2)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user