diff options
author | Jackie Huang <jackie.huang@windriver.com> | 2015-01-16 14:14:05 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2015-03-11 19:29:34 -0400 |
commit | 5eec0615e548f58ecdfadfc45af5805eeb58f69c (patch) | |
tree | 9c0b36a449d4224ddef22f9007b457c88a62449a | |
parent | ebdd38e7f71b16bee538dc1fa8b61da3fdaf4a90 (diff) | |
download | meta-openembedded-5eec0615e548f58ecdfadfc45af5805eeb58f69c.tar.gz |
net-snmp: add ptest package
Issue: TA79430
- Change to use append for PACKAGES so that:
* ptest package is added from ptest bbcalss
* the PN is back, allow empty and add rdepends on net-snmp-client
in case the user try to add net-snmp to the image
- Add a patch to fix the output format for ptest
- Add run-ptest
- Add rdepends on perl for ptest
(LOCAL REV: NOT UPSTREAM) -- Sent to meta-networking on 20150114
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
3 files changed, 72 insertions, 2 deletions
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch new file mode 100644 index 000000000..9fb19b3e0 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 4bb4024b395f19d36ab3569e2773ea80d8cc5261 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Wed, 14 Jan 2015 15:10:06 +0800 | ||
4 | Subject: [PATCH] testing: add the output format for ptest | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE specific] | ||
7 | |||
8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
9 | --- | ||
10 | testing/RUNTESTS | 4 ++++ | ||
11 | 1 files changed, 4 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/testing/RUNTESTS b/testing/RUNTESTS | ||
14 | index e11c969..fb90f76 100755 | ||
15 | --- a/testing/RUNTESTS | ||
16 | +++ b/testing/RUNTESTS | ||
17 | @@ -25,13 +25,17 @@ failed_count=0 | ||
18 | rm -f failed_tests | ||
19 | for i in "${srcdir}"/testing/fulltests/default/T*$1*; do | ||
20 | echo "RUNNING $i" | ||
21 | + test_name=`basename $i` | ||
22 | ${srcdir}/testing/fulltests/support/simple_run $i | ||
23 | if [ $? = 0 ]; then | ||
24 | + echo "PASS: $test_name" | ||
25 | success_count=`expr $success_count + 1` | ||
26 | else | ||
27 | + echo "FAIL: $test_name" | ||
28 | failed_count=`expr $failed_count + 1` | ||
29 | echo "$i" >> failed_tests | ||
30 | fi | ||
31 | + echo | ||
32 | done | ||
33 | |||
34 | if [ -f failed_tests ]; then | ||
35 | -- | ||
36 | 1.7.1 | ||
37 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest b/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest new file mode 100755 index 000000000..2334217bc --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest | |||
@@ -0,0 +1,4 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | cd testing | ||
4 | ./RUNTESTS | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.1.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.1.bb index 1389c3f05..1baf101d9 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.1.bb +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.1.bb | |||
@@ -17,6 +17,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \ | |||
17 | file://ifmib.patch \ | 17 | file://ifmib.patch \ |
18 | file://net-snmp-add-knob-whether-nlist.h-are-checked.patch \ | 18 | file://net-snmp-add-knob-whether-nlist.h-are-checked.patch \ |
19 | file://fix-libtool-finish.patch \ | 19 | file://fix-libtool-finish.patch \ |
20 | file://net-snmp-testing-add-the-output-format-for-ptest.patch \ | ||
21 | file://run-ptest \ | ||
20 | " | 22 | " |
21 | 23 | ||
22 | SRC_URI[md5sum] = "a2c83518648b0f2a5d378625e45c0e18" | 24 | SRC_URI[md5sum] = "a2c83518648b0f2a5d378625e45c0e18" |
@@ -71,6 +73,24 @@ do_install_append() { | |||
71 | install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system | 73 | install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system |
72 | } | 74 | } |
73 | 75 | ||
76 | do_install_ptest() { | ||
77 | install -d ${D}${PTEST_PATH} | ||
78 | for i in ${S}/dist ${S}/include ${B}/include ${S}/mibs ${S}/configure \ | ||
79 | ${B}/net-snmp-config ${S}/testing; do | ||
80 | if [ -e "$i" ]; then | ||
81 | cp -a "$i" ${D}${PTEST_PATH} | ||
82 | fi | ||
83 | done | ||
84 | echo `autoconf -V|awk '/autoconf/{print $NF}'` > ${D}${PTEST_PATH}/dist/autoconf-version | ||
85 | |||
86 | rmdlist="${D}${PTEST_PATH}/dist/net-snmp-solaris-build" | ||
87 | for i in $rmdlist; do | ||
88 | if [ -d "$i" ]; then | ||
89 | rm -rf "$i" | ||
90 | fi | ||
91 | done | ||
92 | } | ||
93 | |||
74 | SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess" | 94 | SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess" |
75 | 95 | ||
76 | net_snmp_sysroot_preprocess () { | 96 | net_snmp_sysroot_preprocess () { |
@@ -80,9 +100,9 @@ net_snmp_sysroot_preprocess () { | |||
80 | fi | 100 | fi |
81 | } | 101 | } |
82 | 102 | ||
83 | PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-static ${PN}-libs \ | 103 | PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd ${PN}-server-snmptrapd" |
84 | ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd ${PN}-server-snmptrapd" | ||
85 | 104 | ||
105 | ALLOW_EMPTY_${PN} = "1" | ||
86 | ALLOW_EMPTY_${PN}-server = "1" | 106 | ALLOW_EMPTY_${PN}-server = "1" |
87 | 107 | ||
88 | FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}" | 108 | FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}" |
@@ -98,6 +118,7 @@ FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ | |||
98 | ${systemd_unitdir}/system/snmptrapd.service \ | 118 | ${systemd_unitdir}/system/snmptrapd.service \ |
99 | " | 119 | " |
100 | 120 | ||
121 | FILES_${PN} = "" | ||
101 | FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/" | 122 | FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/" |
102 | FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" | 123 | FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" |
103 | FILES_${PN}-dev += "${bindir}/mib2c ${bindir}/mib2c-update" | 124 | FILES_${PN}-dev += "${bindir}/mib2c ${bindir}/mib2c-update" |
@@ -117,10 +138,18 @@ SYSTEMD_PACKAGES = "${PN}-server-snmpd \ | |||
117 | SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service" | 138 | SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service" |
118 | SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service" | 139 | SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service" |
119 | 140 | ||
141 | RDEPENDS_${PN} += "net-snmp-client" | ||
120 | RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs" | 142 | RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs" |
121 | RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd" | 143 | RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd" |
122 | RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" | 144 | RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" |
123 | RDEPENDS_${PN}-client += "net-snmp-mibs" | 145 | RDEPENDS_${PN}-client += "net-snmp-mibs" |
146 | RDEPENDS_${PN}-ptest += "perl \ | ||
147 | perl-module-test \ | ||
148 | perl-module-file-basename \ | ||
149 | perl-module-getopt-long \ | ||
150 | perl-module-file-temp \ | ||
151 | perl-module-data-dumper \ | ||
152 | " | ||
124 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | 153 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" |
125 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | 154 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" |
126 | 155 | ||