Fix unit tests on i386 and other archs

Change-Id: I4f84b725e220e28919570fd7f296b63b34d0375d
This commit is contained in:
Ondřej Nový 2017-04-20 16:57:15 +02:00 committed by Ondřej Nový
parent bc92423150
commit 9e15effb3b

View File

@ -53,6 +53,7 @@ from functools import partial
from tempfile import TemporaryFile, NamedTemporaryFile, mkdtemp
from netifaces import AF_INET6
from mock import MagicMock, patch
from nose import SkipTest
from six.moves.configparser import NoSectionError, NoOptionError
from uuid import uuid4
@ -3591,6 +3592,12 @@ cluster_dfw1 = http://dfw1.host/v1/
def _fake_syscall(*args):
called['syscall'] = args
# Test if current architecture supports changing of priority
try:
utils.NR_ioprio_set()
except OSError as e:
raise SkipTest(e)
with patch('swift.common.utils._libc_setpriority',
_fake_setpriority), \
patch('swift.common.utils._posix_syscall', _fake_syscall):