From 9e15effb3b1012f5b3152ed03b9d16b6f19ffe24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Nov=C3=BD?= Date: Thu, 20 Apr 2017 16:57:15 +0200 Subject: [PATCH] Fix unit tests on i386 and other archs Change-Id: I4f84b725e220e28919570fd7f296b63b34d0375d --- test/unit/common/test_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/unit/common/test_utils.py b/test/unit/common/test_utils.py index c412b95e4d..b0a1efb115 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 @@ -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):