diff options
author | Ondřej Nový <ondrej.novy@firma.seznam.cz> | 2017-04-20 16:57:15 +0200 |
---|---|---|
committer | Ondřej Nový <ondrej.novy@firma.seznam.cz> | 2017-05-16 10:32:55 +0200 |
commit | 0b3267b71d73e6ac98d39b0966d908114c62b722 (patch) | |
tree | 7a1feed5bb59d7d49f8de5f9a1ebfb50e7ab3f90 | |
parent | 01156e7f93a8091cfc07b2fbce27278d7e078f2f (diff) | |
download | swift-0b3267b71d73e6ac98d39b0966d908114c62b722.tar.gz |
Fix unit tests on i386 and other archs
Change-Id: I4f84b725e220e28919570fd7f296b63b34d0375d
-rw-r--r-- | test/unit/common/test_utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py index e2289801d..48525aded 100644 --- a/test/unit/common/test_utils.py +++ b/test/unit/common/test_utils.py @@ -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 @@ -3562,6 +3563,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): |