From b37b4010a5f3569e8379360662a925ba04a886bf Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 22 Feb 2018 16:13:10 +0100 Subject: tests: Assert for /proc being a mountpoint for cross-fs tests Skip cross-fs tests if /proc is not a mountpoint. This handles cases when /proc exists but is not mounted which is quite normal e.g. on Gentoo/FreeBSD. --- tests/test_verify.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/test_verify.py') diff --git a/tests/test_verify.py b/tests/test_verify.py index a255068..d244c0b 100644 --- a/tests/test_verify.py +++ b/tests/test_verify.py @@ -278,6 +278,9 @@ class EmptyFileVerificationTest(unittest.TestCase): (False, [('__exists__', False, True)])) def testCrossFilesystem(self): + if not os.path.ismount('/proc'): + raise unittest.SkipTest('/proc is not a mountpoint') + try: st = os.stat('/proc') except OSError: @@ -352,6 +355,9 @@ class EmptyFileVerificationTest(unittest.TestCase): }) def test_update_cross_filesystem(self): + if not os.path.ismount('/proc'): + raise unittest.SkipTest('/proc is not a mountpoint') + try: st = os.stat('/proc') except OSError: -- cgit v1.2.3