summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/package.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-12 22:29:18 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 09:44:33 +0100
commit20c8be711f3ffbc9f7916c9e101db19bb0281efb (patch)
tree8b31c6483edefd9b935a2660cf73ba2e3e0be888 /meta/lib/oeqa/selftest/cases/package.py
parent5f8a1525138817ff71cfb3eee12d28a76bfa1af1 (diff)
downloadpoky-20c8be711f3ffbc9f7916c9e101db19bb0281efb.tar.gz
selftest/package: Add test to ensure sparse files are preserved
Add a new element to the hardlink test to check we also preseve file sparseness during the packing process. This should ensure we don't regress this issue again. (From OE-Core rev: 0a4e6974b49bf68c4a4098d339b5d655e202a3fd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/package.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/package.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py
index f288fcafdb..4ff9b08c96 100644
--- a/meta/lib/oeqa/selftest/cases/package.py
+++ b/meta/lib/oeqa/selftest/cases/package.py
@@ -88,6 +88,7 @@ class VersionOrdering(OESelftestTestCase):
88 88
89class PackageTests(OESelftestTestCase): 89class PackageTests(OESelftestTestCase):
90 # Verify that a recipe which sets up hardlink files has those preserved into split packages 90 # Verify that a recipe which sets up hardlink files has those preserved into split packages
91 # Also test file sparseness is preserved
91 def test_preserve_hardlinks(self): 92 def test_preserve_hardlinks(self):
92 result = bitbake("selftest-hardlink -c package") 93 result = bitbake("selftest-hardlink -c package")
93 94
@@ -97,3 +98,8 @@ class PackageTests(OESelftestTestCase):
97 # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/ 98 # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/
98 # so expect 8 in total. 99 # so expect 8 in total.
99 self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello").st_nlink, 8) 100 self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello").st_nlink, 8)
101
102 # Test a sparse file remains sparse
103 sparsestat = os.stat(dest + "/selftest-hardlink" + bindir + "/sparsetest")
104 self.assertEqual(sparsestat.st_blocks, 0)
105 self.assertEqual(sparsestat.st_size, 1048576)