curl: add ptest
PATCH v2 1/1 curl: add ptest
Add ptest support to curl
---
Changes in v2:
Make dependency on openssh optional
.../curl/0001-runtests.pl-remove-warning.patch | 31 ++++++++++++++++++++++ meta/recipes-support/curl/curl/run-ptest | 8 ++++++ meta/recipes-support/curl/curl_7.52.1.bb | 23 +++++++++++++++- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/curl/curl/0001-runtests.pl-remove-warning.patch create mode 100644 meta/recipes-support/curl/curl/run-ptest
meta/recipes-support/curl/curl/0001-runtests.pl-remove-warning.patch new file +31 -0
@@ -0,0 +1,31 @@ +From c1d3bf13567909395715e441bc329793a5d2566b Mon Sep 17 00:00:00 2001 +From: "Maxin B. John" <[email protected]> +Date: Mon, 12 Dec 2016 12:49:46 +0200 +Subject: [PATCH] runtests.pl: remove warning + +Remove the warning which floods the console while executing tests. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Maxin B. John <[email protected]> +--- + tests/runtests.pl | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/tests/runtests.pl b/tests/runtests.pl +index b8497f9..3cc6415 100755 +--- a/tests/runtests.pl ++++ b/tests/runtests.pl +@@ -2879,9 +2879,6 @@ sub singletest { + # timestamp test preparation start + $timeprepini{$testnum} = Time::HiRes::time() if($timestats); + +- if($disttests !~ /test$testnum\W/ ) { +- logmsg "Warning: test$testnum not present in tests/data/Makefile.inc\n"; +- } + if($disabled{$testnum}) { + logmsg "Warning: test$testnum is explicitly disabled\n"; + } +-- +2.4.0 +
meta/recipes-support/curl/curl/run-ptest new file +8 -0
@@ -0,0 +1,8 @@ +#!/bin/sh +useradd curl-test +chown -R curl-test:curl-test . +cd tests +su curl-test -c "./runtests.pl -a -n -s | sed \ + -e 's|\([^ ]* *\) \([^ ]* *\)...OK|PASS: \1 \2|' \ + -e 's|\([^ ]* *\) \([^ ]* *\)...FAILED|FAIL: \1 \2|'" +userdel curl-test
meta/recipes-support/curl/curl_7.52.1.bb +22 -1
@@ -7,6 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;beginline=8;md5=3a34942f4ae3fbf1a303160714e66 SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \ file://0001-replace-krb5-config-with-pkg-config.patch \ + file://0001-runtests.pl-remove-warning.patch \ + file://run-ptest \ " # curl likes to set -g0 in CFLAGS, so we stop it
@@ -18,7 +20,7 @@ SRC_URI[md5sum] = "dd014df06ff1d12e173de86873f9f77a" SRC_URI[sha256sum] = "d16185a767cb2c1ba3d5b9096ec54e5ec198b213f45864a38b3bda4bbf87389b" CVE_PRODUCT = "libcurl" -inherit autotools pkgconfig binconfig multilib_header +inherit autotools pkgconfig binconfig multilib_header ptest PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)} gnutls proxy zlib" PACKAGECONFIG_class-native = "ipv6 proxy ssl zlib"
@@ -62,11 +64,30 @@ do_install_append_class-target() { sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/curl-config } +do_compile_ptest() { + oe_runmake test + oe_runmake -C ${B}/tests/data/ show + oe_runmake -C ${B}/tests/server +} + +do_install_ptest() { + cp -rf ${B}/tests ${D}${PTEST_PATH} + cp -rf ${S}/tests ${D}${PTEST_PATH} + install -d ${D}${PTEST_PATH}/src + ln -sf ${bindir}/curl ${D}${PTEST_PATH}/src/curl +} + PACKAGES =+ "lib${BPN}" FILES_lib${BPN} = "${libdir}/lib*.so.*" RRECOMMENDS_lib${BPN} += "ca-certificates" +RDEPENDS_${PN}-ptest += "make bash sudo perl perl-module-cwd perl-module-ipc-open2 \ + ${@bb.utils.contains("IMAGE_FEATURES", "ssh-server-openssh", "openssh ", "",d)}\ + perl-module-digest-md5 perl-module-file-basename perl-module-posix diffutils \ + perl-module-errno python python-netserver python-argparse python-pprint \ + " + FILES_${PN} += "${datadir}/zsh" BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.4.0
Quoted 3 lines · Maxin B. John
+RDEPENDS_${PN}-ptest += "make bash sudo perl perl-module-cwd perl-module-ipc-open2 \
The ptest needing sudo is moderately scary and also suggests that it can't be ran in an automated test harness. What does this need sudo for?
Ross
Hi Ross,
Quoted 7 lines · Ross
Quoted 3 lines · Maxin B. John
+RDEPENDS_${PN}-ptest += "make bash sudo perl perl-module-cwd perl-module-ipc-open2 \
The ptest needing sudo is moderately scary and also suggests that it can't be ran in an automated test harness. What does this need sudo for?
That was a lousy mistake from my side (needs "su" to run some ssh tests as normal user). Will update and send the new version without "sudo" dependency.
Quoted 1 line
Ross
Warm Regards,
Maxin