Add is_bsd() to neutron-lib
The is_bsd() testtool function is required for skipping some of the test cases in OSX/BSD environment. The is_bsd() check is useful when projects want to skip test cases related to IPv6 formatting as the implementation of netaddr differs in different platforms. Change-Id: I664e55883bbd714e31b49b278060e625fc5e6ea4 Related-Bug: #1484837
This commit is contained in:
parent
3a71621542
commit
e94547d458
@ -14,6 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
|
import platform
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from neutron_lib.utils import helpers
|
from neutron_lib.utils import helpers
|
||||||
@ -44,3 +45,14 @@ class WarningsFixture(fixtures.Fixture):
|
|||||||
for wtype in self.warning_types:
|
for wtype in self.warning_types:
|
||||||
warnings.filterwarnings(
|
warnings.filterwarnings(
|
||||||
"always", category=wtype, module='^neutron_lib\\.')
|
"always", category=wtype, module='^neutron_lib\\.')
|
||||||
|
|
||||||
|
|
||||||
|
def is_bsd():
|
||||||
|
"""Return True on BSD-based systems."""
|
||||||
|
|
||||||
|
system = platform.system()
|
||||||
|
if system == 'Darwin':
|
||||||
|
return True
|
||||||
|
if 'bsd' in system.lower():
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user