summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-30 23:33:27 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-31 22:42:03 +0100
commit751fc7802f57a836a0be5fc6a8d5fdf8b1769c39 (patch)
tree55986800d69f121f76cac879c3782837e059d26c /meta/lib
parent28eeada955762f38ccbd1d26c53768364dbd1a5e (diff)
downloadopenembedded-core-contrib-751fc7802f57a836a0be5fc6a8d5fdf8b1769c39.tar.gz
openembedded-core-contrib-751fc7802f57a836a0be5fc6a8d5fdf8b1769c39.tar.bz2
openembedded-core-contrib-751fc7802f57a836a0be5fc6a8d5fdf8b1769c39.zip
oeqa/selftest: Add package hardlink test
We keep breaking the preservation of hardlinks during the packaging process. Add a selftest which tests this to try and prevent this breaking again. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/package.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py
index ef6eabef66..1e171b5ebe 100644
--- a/meta/lib/oeqa/selftest/cases/package.py
+++ b/meta/lib/oeqa/selftest/cases/package.py
@@ -1,6 +1,7 @@
from oeqa.selftest.case import OESelftestTestCase
from oeqa.core.decorator.oeid import OETestID
-from oeqa.utils.commands import bitbake, get_bb_vars
+from oeqa.utils.commands import bitbake, get_bb_vars, get_bb_var
+import stat
import subprocess, os
import oe.path
@@ -84,3 +85,15 @@ class VersionOrdering(OESelftestTestCase):
status = subprocess.call(command, env=env)
self.assertIn(status, (99, 100, 101))
self.assertEqual(status - 100, sort, "%s %s (%d) failed" % (ver1, ver2, sort))
+
+class PackageTests(OESelftestTestCase):
+ # Verify that a recipe which sets up hardlink files has those preserved into split packages
+ def test_preserve_hardlinks(self):
+ result = bitbake("selftest-hardlink")
+
+ dest = get_bb_var('PKGDEST', 'selftest-hardlink')
+ bindir = get_bb_var('bindir', 'selftest-hardlink')
+
+ # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/
+ # so expect 8 in total.
+ self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello").st_nlink, 8)