]> code.ossystems Code Review - openembedded-core.git/commitdiff
mdadm: add ptest
authorDmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Fri, 17 Apr 2015 13:52:24 +0000 (16:52 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 19 Apr 2015 12:34:05 +0000 (13:34 +0100)
Enable ptest for mdadm, by reusing internal testsuite.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-extended/mdadm/files/run-ptest [new file with mode: 0644]
meta/recipes-extended/mdadm/mdadm_3.3.2.bb

diff --git a/meta/recipes-extended/mdadm/files/run-ptest b/meta/recipes-extended/mdadm/files/run-ptest
new file mode 100644 (file)
index 0000000..5b27609
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+./test &>./test.log
+if [ $? -eq 0 ]
+then
+       echo "PASS: mdadm"
+       rm test.log
+else
+       echo "FAIL: mdadm"
+fi
index c6a5635207b469c56292d5629cb64e9f54526ac8..0742d73ffdd0325cd3688cabe1697166ccb73482 100644 (file)
@@ -12,6 +12,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
            file://mdadm-3.2.2_fix_for_x32.patch \
            file://gcc-4.9.patch \
            file://mdadm-3.3.2_x32_abi_time_t.patch \
+           file://run-ptest \
          "
 
 SRC_URI[md5sum] = "44698d351501cac6a89072dc877eb220"
@@ -45,3 +46,31 @@ do_install() {
 }
 
 FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules"
+
+inherit ptest
+
+do_compile_ptest() {
+       oe_runmake test
+}
+
+do_install_ptest() {
+       cp -a ${S}/tests ${D}${PTEST_PATH}/tests
+       cp ${S}/test ${D}${PTEST_PATH}
+       sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
+       ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
+       for prg in test_stripe swap_super raid6check
+       do
+               install -D -m 755 $prg ${D}${PTEST_PATH}/
+       done
+}
+RDEPENDS_${PN}-ptest += "bash"
+RRECOMMENDS_${PN}-ptest += " \
+    coreutils \
+    util-linux \
+    kernel-module-loop \
+    kernel-module-linear \
+    kernel-module-raid0 \
+    kernel-module-raid1 \
+    kernel-module-raid10 \
+    kernel-module-raid456 \
+"