summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-10-25 00:21:51 +0200
committerMichał Górny <mgorny@gentoo.org>2017-10-25 00:21:51 +0200
commit88f5d6f27da873d0c506921472c34324d95013f3 (patch)
tree81221558a04caeca6258119ca2b985d28fa6f6c2 /tests
parentb5b8d5091a7ea034863dcaafc36322ee8533cb89 (diff)
downloadgemato-88f5d6f27da873d0c506921472c34324d95013f3.tar.gz
test_recursiveloader: Add more tests for cross-device cases
Diffstat (limited to 'tests')
-rw-r--r--tests/test_recursiveloader.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/test_recursiveloader.py b/tests/test_recursiveloader.py
index 38a4a07..d8a318c 100644
--- a/tests/test_recursiveloader.py
+++ b/tests/test_recursiveloader.py
@@ -738,3 +738,60 @@ DATA sub/version 0 MD5 d41d8cd98f00b204e9800998ecf8427e
os.path.join(self.dir, 'Manifest'))
self.assertRaises(gemato.exceptions.ManifestCrossDevice,
m.assert_directory_verifies, '', strict=False)
+
+
+class CrossDeviceEmptyManifestTest(TempDirTestCase):
+ """
+ Test for a Manifest that crosses filesystem boundaries without
+ explicit entries.
+ """
+
+ FILES = {
+ 'Manifest': u'',
+ }
+
+ def setUp(self):
+ super(CrossDeviceEmptyManifestTest, self).setUp()
+ os.symlink('/proc', os.path.join(self.dir, 'sub'))
+
+ def tearDown(self):
+ os.unlink(os.path.join(self.dir, 'sub'))
+ super(CrossDeviceEmptyManifestTest, self).tearDown()
+
+ def test_assert_directory_verifies(self):
+ m = gemato.recursiveloader.ManifestRecursiveLoader(
+ os.path.join(self.dir, 'Manifest'))
+ self.assertRaises(gemato.exceptions.ManifestCrossDevice,
+ m.assert_directory_verifies, '')
+
+ def test_assert_directory_verifies_nonstrict(self):
+ m = gemato.recursiveloader.ManifestRecursiveLoader(
+ os.path.join(self.dir, 'Manifest'))
+ self.assertRaises(gemato.exceptions.ManifestCrossDevice,
+ m.assert_directory_verifies, '', strict=False)
+
+
+class CrossDeviceIgnoreManifestTest(TempDirTestCase):
+ """
+ Test for a Manifest that crosses filesystem boundaries without
+ explicit entries.
+ """
+
+ FILES = {
+ 'Manifest': u'''
+IGNORE sub
+''',
+ }
+
+ def setUp(self):
+ super(CrossDeviceIgnoreManifestTest, self).setUp()
+ os.symlink('/proc', os.path.join(self.dir, 'sub'))
+
+ def tearDown(self):
+ os.unlink(os.path.join(self.dir, 'sub'))
+ super(CrossDeviceIgnoreManifestTest, self).tearDown()
+
+ def test_assert_directory_verifies(self):
+ m = gemato.recursiveloader.ManifestRecursiveLoader(
+ os.path.join(self.dir, 'Manifest'))
+ m.assert_directory_verifies('')