summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/cases/package.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py
index 4ff9b08c96..ee6430a184 100644
--- a/meta/lib/oeqa/selftest/cases/package.py
+++ b/meta/lib/oeqa/selftest/cases/package.py
@@ -89,17 +89,26 @@ class VersionOrdering(OESelftestTestCase):
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 # Also test file sparseness is preserved
92 def test_preserve_hardlinks(self): 92 def test_preserve_sparse_hardlinks(self):
93 result = bitbake("selftest-hardlink -c package") 93 bitbake("selftest-hardlink -c package")
94 94
95 dest = get_bb_var('PKGDEST', 'selftest-hardlink') 95 dest = get_bb_var('PKGDEST', 'selftest-hardlink')
96 bindir = get_bb_var('bindir', 'selftest-hardlink') 96 bindir = get_bb_var('bindir', 'selftest-hardlink')
97 97
98 # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/ 98 def checkfiles():
99 # so expect 8 in total. 99 # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/
100 self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello").st_nlink, 8) 100 # so expect 8 in total.
101 self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello").st_nlink, 8)
101 102
102 # Test a sparse file remains sparse 103 # Test a sparse file remains sparse
103 sparsestat = os.stat(dest + "/selftest-hardlink" + bindir + "/sparsetest") 104 sparsestat = os.stat(dest + "/selftest-hardlink" + bindir + "/sparsetest")
104 self.assertEqual(sparsestat.st_blocks, 0) 105 self.assertEqual(sparsestat.st_blocks, 0)
105 self.assertEqual(sparsestat.st_size, 1048576) 106 self.assertEqual(sparsestat.st_size, 1048576)
107
108 checkfiles()
109
110 # Clean and reinstall so its now definitely from sstate, then retest.
111 bitbake("selftest-hardlink -c clean")
112 bitbake("selftest-hardlink -c package")
113
114 checkfiles()