summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb13
-rw-r--r--meta/lib/oeqa/selftest/cases/package.py26
2 files changed, 39 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 be346b8a0e..052bf0c92a 100644
--- a/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
+++ b/meta-selftest/recipes-test/selftest-hardlink/selftest-hardlink.bb
@@ -10,6 +10,9 @@ S = "${WORKDIR}"
10 10
11do_compile () { 11do_compile () {
12 ${CC} hello.c -o hello1 ${CFLAGS} ${LDFLAGS} 12 ${CC} hello.c -o hello1 ${CFLAGS} ${LDFLAGS}
13
14 ${CC} hello.c -c -o hello.o ${CFLAGS}
15 ${AR} rcs libhello.a hello.o
13} 16}
14 17
15do_install () { 18do_install () {
@@ -22,9 +25,19 @@ do_install () {
22 ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello3 25 ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello3
23 ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello4 26 ln ${D}${bindir}/hello1 ${D}${libexecdir}/hello4
24 27
28 # We need so many hardlink copies to look for specific race conditions
29 install -d ${D}${libdir}
30 install -m 0644 libhello.a ${D}${libdir}
31 for num in `seq 1 100` ; do
32 ln ${D}${libdir}/libhello.a ${D}${libdir}/libhello-${num}.a
33 done
34
25 dd if=/dev/zero of=${D}${bindir}/sparsetest bs=1 count=0 seek=1M 35 dd if=/dev/zero of=${D}${bindir}/sparsetest bs=1 count=0 seek=1M
26} 36}
27 37
28RDEPENDS:${PN}-gdb += "gdb" 38RDEPENDS:${PN}-gdb += "gdb"
29PACKAGES =+ "${PN}-gdb" 39PACKAGES =+ "${PN}-gdb"
30FILES:${PN}-gdb = "${bindir}/gdb.sh" 40FILES:${PN}-gdb = "${bindir}/gdb.sh"
41
42PACKAGE_STRIP_STATIC = "1"
43PACKAGE_DEBUG_STATIC_SPLIT = "1"
diff --git a/meta/lib/oeqa/selftest/cases/package.py b/meta/lib/oeqa/selftest/cases/package.py
index 1aa6c03f8a..38ed7173fe 100644
--- a/meta/lib/oeqa/selftest/cases/package.py
+++ b/meta/lib/oeqa/selftest/cases/package.py
@@ -103,11 +103,37 @@ class PackageTests(OESelftestTestCase):
103 103
104 dest = get_bb_var('PKGDEST', 'selftest-hardlink') 104 dest = get_bb_var('PKGDEST', 'selftest-hardlink')
105 bindir = get_bb_var('bindir', 'selftest-hardlink') 105 bindir = get_bb_var('bindir', 'selftest-hardlink')
106 libdir = get_bb_var('libdir', 'selftest-hardlink')
107 libexecdir = get_bb_var('libexecdir', 'selftest-hardlink')
106 108
107 def checkfiles(): 109 def checkfiles():
108 # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/ 110 # Recipe creates 4 hardlinked files, there is a copy in package/ and a copy in packages-split/
109 # so expect 8 in total. 111 # so expect 8 in total.
110 self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello1").st_nlink, 8) 112 self.assertEqual(os.stat(dest + "/selftest-hardlink" + bindir + "/hello1").st_nlink, 8)
113 self.assertEqual(os.stat(dest + "/selftest-hardlink" + libexecdir + "/hello3").st_nlink, 8)
114
115 # Check dbg version
116 # 2 items, a copy in both package/packages-split so 4
117 self.assertEqual(os.stat(dest + "/selftest-hardlink-dbg" + bindir + "/.debug/hello1").st_nlink, 4)
118 self.assertEqual(os.stat(dest + "/selftest-hardlink-dbg" + libexecdir + "/.debug/hello1").st_nlink, 4)
119
120 # Even though the libexecdir name is 'hello3' or 'hello4', that isn't the debug target name
121 self.assertEqual(os.path.exists(dest + "/selftest-hardlink-dbg" + libexecdir + "/.debug/hello3"), False)
122 self.assertEqual(os.path.exists(dest + "/selftest-hardlink-dbg" + libexecdir + "/.debug/hello4"), False)
123
124 # Check the staticdev libraries
125 # 101 items, a copy in both package/packages-split so 202
126 self.assertEqual(os.stat(dest + "/selftest-hardlink-staticdev" + libdir + "/libhello.a").st_nlink, 202)
127 self.assertEqual(os.stat(dest + "/selftest-hardlink-staticdev" + libdir + "/libhello-25.a").st_nlink, 202)
128 self.assertEqual(os.stat(dest + "/selftest-hardlink-staticdev" + libdir + "/libhello-50.a").st_nlink, 202)
129 self.assertEqual(os.stat(dest + "/selftest-hardlink-staticdev" + libdir + "/libhello-75.a").st_nlink, 202)
130
131 # Check static dbg
132 # 101 items, a copy in both package/packages-split so 202
133 self.assertEqual(os.stat(dest + "/selftest-hardlink-dbg" + libdir + "/.debug-static/libhello.a").st_nlink, 202)
134 self.assertEqual(os.stat(dest + "/selftest-hardlink-dbg" + libdir + "/.debug-static/libhello-25.a").st_nlink, 202)
135 self.assertEqual(os.stat(dest + "/selftest-hardlink-dbg" + libdir + "/.debug-static/libhello-50.a").st_nlink, 202)
136 self.assertEqual(os.stat(dest + "/selftest-hardlink-dbg" + libdir + "/.debug-static/libhello-75.a").st_nlink, 202)
111 137
112 # Test a sparse file remains sparse 138 # Test a sparse file remains sparse
113 sparsestat = os.stat(dest + "/selftest-hardlink" + bindir + "/sparsetest") 139 sparsestat = os.stat(dest + "/selftest-hardlink" + bindir + "/sparsetest")