diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2021-01-22 14:10:19 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-27 10:17:45 +0000 |
commit | 065a23550eb845c378a65be5a7fd5f840fe4e448 (patch) | |
tree | 874a54fcd71fd74c8c8722f3dacb2c24f4a87a40 | |
parent | 45c02843d181b5f1872ad30f4d847c395233a676 (diff) | |
download | poky-065a23550eb845c378a65be5a7fd5f840fe4e448.tar.gz |
libpam: add ptest support
Add ptest support.
(From OE-Core rev: 016efb82e90a56707995d2a6addd34e6b28b6b99)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-extended/pam/libpam/run-ptest | 31 | ||||
-rw-r--r-- | meta/recipes-extended/pam/libpam_1.5.1.bb | 17 |
2 files changed, 47 insertions, 1 deletions
diff --git a/meta/recipes-extended/pam/libpam/run-ptest b/meta/recipes-extended/pam/libpam/run-ptest new file mode 100644 index 0000000000..69e729ce2a --- /dev/null +++ b/meta/recipes-extended/pam/libpam/run-ptest | |||
@@ -0,0 +1,31 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | cd tests | ||
4 | |||
5 | failed=0 | ||
6 | all=0 | ||
7 | |||
8 | for f in tst-*; do | ||
9 | "./$f" > /dev/null 2>&1 | ||
10 | case "$?" in | ||
11 | 0) | ||
12 | echo "PASS: $f" | ||
13 | all=$((all + 1)) | ||
14 | ;; | ||
15 | 77) | ||
16 | echo "SKIP: $f" | ||
17 | ;; | ||
18 | *) | ||
19 | echo "FAIL: $f" | ||
20 | failed=$((failed + 1)) | ||
21 | all=$((all + 1)) | ||
22 | ;; | ||
23 | esac | ||
24 | done | ||
25 | |||
26 | if [ "$failed" -eq 0 ] ; then | ||
27 | echo "All $all tests passed" | ||
28 | else | ||
29 | echo "$failed of $all tests failed" | ||
30 | fi | ||
31 | |||
diff --git a/meta/recipes-extended/pam/libpam_1.5.1.bb b/meta/recipes-extended/pam/libpam_1.5.1.bb index d6612bb936..f225487688 100644 --- a/meta/recipes-extended/pam/libpam_1.5.1.bb +++ b/meta/recipes-extended/pam/libpam_1.5.1.bb | |||
@@ -23,6 +23,7 @@ SRC_URI = "https://github.com/linux-pam/linux-pam/releases/download/v${PV}/Linux | |||
23 | file://libpam-xtests.patch \ | 23 | file://libpam-xtests.patch \ |
24 | file://0001-modules-pam_namespace-Makefile.am-correctly-install-.patch \ | 24 | file://0001-modules-pam_namespace-Makefile.am-correctly-install-.patch \ |
25 | file://0001-Makefile.am-support-usrmage.patch \ | 25 | file://0001-Makefile.am-support-usrmage.patch \ |
26 | file://run-ptest \ | ||
26 | " | 27 | " |
27 | 28 | ||
28 | SRC_URI[sha256sum] = "201d40730b1135b1b3cdea09f2c28ac634d73181ccd0172ceddee3649c5792fc" | 29 | SRC_URI[sha256sum] = "201d40730b1135b1b3cdea09f2c28ac634d73181ccd0172ceddee3649c5792fc" |
@@ -40,7 +41,7 @@ CFLAGS_append = " -fPIC " | |||
40 | 41 | ||
41 | S = "${WORKDIR}/Linux-PAM-${PV}" | 42 | S = "${WORKDIR}/Linux-PAM-${PV}" |
42 | 43 | ||
43 | inherit autotools gettext pkgconfig systemd | 44 | inherit autotools gettext pkgconfig systemd ptest |
44 | 45 | ||
45 | PACKAGECONFIG ??= "" | 46 | PACKAGECONFIG ??= "" |
46 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," | 47 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit," |
@@ -112,6 +113,13 @@ python populate_packages_prepend () { | |||
112 | do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') | 113 | do_split_packages(d, pam_filterdir, r'^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='') |
113 | } | 114 | } |
114 | 115 | ||
116 | do_compile_ptest() { | ||
117 | cd tests | ||
118 | sed -i -e 's/$(MAKE) $(AM_MAKEFLAGS) check-TESTS//' Makefile | ||
119 | oe_runmake check-am | ||
120 | cd - | ||
121 | } | ||
122 | |||
115 | do_install() { | 123 | do_install() { |
116 | autotools_do_install | 124 | autotools_do_install |
117 | 125 | ||
@@ -131,6 +139,13 @@ do_install() { | |||
131 | fi | 139 | fi |
132 | } | 140 | } |
133 | 141 | ||
142 | do_install_ptest() { | ||
143 | if [ ${PTEST_ENABLED} = "1" ]; then | ||
144 | mkdir -p ${D}${PTEST_PATH}/tests | ||
145 | install -m 0755 ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests | ||
146 | fi | ||
147 | } | ||
148 | |||
134 | inherit features_check | 149 | inherit features_check |
135 | REQUIRED_DISTRO_FEATURES = "pam" | 150 | REQUIRED_DISTRO_FEATURES = "pam" |
136 | 151 | ||