summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb1
-rw-r--r--meta/lib/oeqa/selftest/cases/package.py6
2 files changed, 7 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
index 8a0e6336aa..ec330fa9ff 100644
--- a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
+++ b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
@@ -16,4 +16,5 @@ do_install () {
16 ln ${D}${bindir}/hello ${D}${bindir}/hello2 16 ln ${D}${bindir}/hello ${D}${bindir}/hello2
17 ln ${D}${bindir}/hello ${D}${bindir}/hello3 17 ln ${D}${bindir}/hello ${D}${bindir}/hello3
18 ln ${D}${bindir}/hello ${D}${bindir}/hello4 18 ln ${D}${bindir}/hello ${D}${bindir}/hello4
19 dd if=/dev/zero of=${D}${bindir}/sparsetest bs=1 count=0 seek=1M
19} 20}
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)