tests: add a Centos 6 work-around
authorArtem Bityutskiy <artem.bityutskiy@intel.com>
Fri, 20 Sep 2013 10:30:59 +0000 (13:30 +0300)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Fri, 20 Sep 2013 10:34:16 +0000 (13:34 +0300)
Centos 6 is very old, and it has old unittest library, and the newer one which
we need is called 'unittest2' there. This patch adds the corresponding
work-around to make our tests pass in Centos 6.

Change-Id: Ibf9d9185f23a79aeb2f0ecf67f8f22e1840f1a82
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
tests/test_api_base.py
tests/test_fiemap.py

index a1c1f0262ff44cf527a45683ed20054fbd3c0abd..34a745a4882011b55956f38adeff5c4dbc814b85 100644 (file)
@@ -14,10 +14,15 @@ import sys
 import tempfile
 import filecmp
 import hashlib
-import unittest
 import itertools
 import random
 
+# This is a work-around for Centos 6
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
+
 import tests.helpers
 from bmaptools import BmapCreate, BmapCopy, Fiemap, TransRead
 
index 0c031d271cbfa743690a36f59adae38d41e976d3..e9c0a150e0429141fd4674bf3d475bbe33a28d1b 100644 (file)
@@ -11,9 +11,15 @@ files and makes sure FIEMAP returns correct information about the holes.
 
 
 import random
-import unittest
 import itertools
 
+# This is a work-around for Centos 6
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
+
+
 import tests.helpers
 from bmaptools import Fiemap