* [PATCH v2] curl: add ptest
@ 2017-02-10 14:01 Maxin B. John
2017-02-21 0:41 ` Burton, Ross
0 siblings, 1 reply; 4+ messages in thread
From: Maxin B. John @ 2017-02-10 14:01 UTC (permalink / raw)
To: openembedded-core; +Cc: Cristian Iorga
Add ptest support to curl
Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
---
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
diff --git a/meta/recipes-support/curl/curl/0001-runtests.pl-remove-warning.patch b/meta/recipes-support/curl/curl/0001-runtests.pl-remove-warning.patch
new file mode 100644
index 0000000..283aa20
--- /dev/null
+++ b/meta/recipes-support/curl/curl/0001-runtests.pl-remove-warning.patch
@@ -0,0 +1,31 @@
+From c1d3bf13567909395715e441bc329793a5d2566b Mon Sep 17 00:00:00 2001
+From: "Maxin B. John" <maxin.john@intel.com>
+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 <maxin.john@intel.com>
+---
+ 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
+
diff --git a/meta/recipes-support/curl/curl/run-ptest b/meta/recipes-support/curl/curl/run-ptest
new file mode 100644
index 0000000..d22e6f7
--- /dev/null
+++ b/meta/recipes-support/curl/curl/run-ptest
@@ -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
diff --git a/meta/recipes-support/curl/curl_7.52.1.bb b/meta/recipes-support/curl/curl_7.52.1.bb
index 2882bc0..b7c08f1 100644
--- a/meta/recipes-support/curl/curl_7.52.1.bb
+++ b/meta/recipes-support/curl/curl_7.52.1.bb
@@ -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"
--
2.4.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] curl: add ptest
2017-02-10 14:01 [PATCH v2] curl: add ptest Maxin B. John
@ 2017-02-21 0:41 ` Burton, Ross
2017-02-21 12:19 ` Maxin B. John
0 siblings, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2017-02-21 0:41 UTC (permalink / raw)
To: Maxin B. John; +Cc: Cristian Iorga, OE-core
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
On 10 February 2017 at 14:01, Maxin B. John <maxin.john@intel.com> wrote:
> +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
[-- Attachment #2: Type: text/html, Size: 740 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] curl: add ptest
2017-02-21 0:41 ` Burton, Ross
@ 2017-02-21 12:19 ` Maxin B. John
0 siblings, 0 replies; 4+ messages in thread
From: Maxin B. John @ 2017-02-21 12:19 UTC (permalink / raw)
To: Burton, Ross; +Cc: Cristian Iorga, OE-core
Hi Ross,
>On Tue, Feb 21, 2017 at 12:41:10AM +0000, Burton, Ross wrote:
>>On 10 February 2017 at 14:01, Maxin B. John <maxin.john@intel.com> wrote:
>>
>> +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.
> Ross
Warm Regards,
Maxin
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] curl : Add ptest
@ 2022-07-05 2:48 Yogesh Tyagi
0 siblings, 0 replies; 4+ messages in thread
From: Yogesh Tyagi @ 2022-07-05 2:48 UTC (permalink / raw)
To: openembedded-core
- curl-ptest is taking around 200 seconds to execute so
added curl-ptest to PTESTS_SLOW
- This patch is rework on an existing patch provided
by Maxin B. John (maxin.john@intel.com)
https://www.openembedded.org/pipermail/openembedded-core/2017-July/139176.html
- Below is the run log of curl-ptest
START: ptest-runner
2022-07-03T15:52
BEGIN: /usr/lib/curl/ptest
********* System characteristics ********
* curl 7.83.1 (x86_64-poky-linux-gnu)
* libcurl/7.83.1 OpenSSL/3.0.3 zlib/1.2.12 libidn2/2.3.2
* Features: alt-svc AsynchDNS Debug HSTS HTTPS-proxy IDN Largefile libz NTLM SSL TLS-SRP UnixSockets
* Disabled: headers-api
* Host: qemux86-64
* System: Linux qemux86-64 5.15.44-yocto-standard #1 SMP PREEMPT Tue May 31 20:28:59 UTC 2022 x86_64 GNU/Linux
* OS: linux
* Servers: HTTP-unix
* Env:
* Seed: 238593
*****************************************
PASS: test 0001 (1 out of 1466, remaining: 25:07, took 1.029s, duration: 00:01)
PASS: test 0002 (2 out of 1466, remaining: 13:21, took 0.065s, duration: 00:01)
...
...
PASS: test 3019 (1460 out of 1466, remaining: 00:00, took 0.012s, duration: 03:16)
PASS: test 3020 (1461 out of 1466, remaining: 00:00, took 0.011s, duration: 03:16)
test 3025...The tool set in the test case for this: 'lib3025' does not exist
TESTDONE: 1280 tests were considered during 197 seconds.
TESTDONE: 783 tests out of PASS: 783 report: 100%
DURATION: 202
END: /usr/lib/curl/ptest
2022-07-03T15:56
STOP: ptest-runner
TOTAL: 1 FAIL: 0
- disable the curl tests that are expected to fail
[YOCTO #6707]
Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com>
---
.../distro/include/ptest-packagelists.inc | 1 +
meta/recipes-support/curl/curl/disable-tests | 28 +++++++++++++++++++
meta/recipes-support/curl/curl/run-ptest | 6 ++++
meta/recipes-support/curl/curl_7.83.1.bb | 24 ++++++++++++++--
4 files changed, 57 insertions(+), 2 deletions(-)
create mode 100644 meta/recipes-support/curl/curl/disable-tests
create mode 100644 meta/recipes-support/curl/curl/run-ptest
diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index a1ead90649..6c4339e3e1 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -81,6 +81,7 @@ PTESTS_SLOW = "\
babeltrace2-ptest \
busybox-ptest \
coreutils-ptest \
+ curl-ptest \
dbus-ptest \
e2fsprogs-ptest \
findutils-ptest \
diff --git a/meta/recipes-support/curl/curl/disable-tests b/meta/recipes-support/curl/curl/disable-tests
new file mode 100644
index 0000000000..92056bd8ca
--- /dev/null
+++ b/meta/recipes-support/curl/curl/disable-tests
@@ -0,0 +1,28 @@
+# These CRL test (alt-avc) are failing
+356
+412
+413
+# These CRL tests are scanning docs
+971
+1119
+1132
+1135
+# These CRL tests are scnning headers
+1167
+# These CRL tests are scanning man pages
+1139
+1140
+1173
+1177
+# This CRL test is looking for m4 files
+1165
+# This CRL test is looking for src files
+1185
+# These CRL tests need --libcurl option to be enabled
+1400
+1401
+1402
+1403
+1404
+1405
+1465
diff --git a/meta/recipes-support/curl/curl/run-ptest b/meta/recipes-support/curl/curl/run-ptest
new file mode 100644
index 0000000000..614e822922
--- /dev/null
+++ b/meta/recipes-support/curl/curl/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+cd tests
+./runtests.pl -a -n -s | sed \
+ -e 's|\([^ ]* *\) \([^ ]* *\)...OK|PASS: \1 \2|' \
+ -e 's|\([^ ]* *\) \([^ ]* *\)...FAILED|FAIL: \1 \2|' \
+ -e 's/Warning: test[0-9]\+ not present in tests\/data\/Makefile.inc//'
diff --git a/meta/recipes-support/curl/curl_7.83.1.bb b/meta/recipes-support/curl/curl_7.83.1.bb
index 1d9de29a65..39c2533513 100644
--- a/meta/recipes-support/curl/curl_7.83.1.bb
+++ b/meta/recipes-support/curl/curl_7.83.1.bb
@@ -9,13 +9,17 @@ SECTION = "console/network"
LICENSE = "MIT-open-group"
LIC_FILES_CHKSUM = "file://COPYING;md5=190c514872597083303371684954f238"
-SRC_URI = "https://curl.se/download/${BP}.tar.xz"
+SRC_URI = "https://curl.se/download/${BP}.tar.xz \
+ file://run-ptest \
+ file://disable-tests \
+ "
+
SRC_URI[sha256sum] = "2cb9c2356e7263a1272fd1435ef7cdebf2cd21400ec287b068396deb705c22c4"
# Curl has used many names over the years...
CVE_PRODUCT = "haxx:curl haxx:libcurl curl:curl curl:libcurl libcurl:libcurl daniel_stenberg:curl"
-inherit autotools pkgconfig binconfig multilib_header
+inherit autotools pkgconfig binconfig multilib_header ptest
# Entropy source for random PACKAGECONFIG option
RANDOM ?= "/dev/urandom"
@@ -80,6 +84,22 @@ do_install:append:class-target() {
${D}${bindir}/curl-config
}
+do_compile_ptest() {
+ oe_runmake test
+ oe_runmake -C ${B}/tests/server
+}
+
+do_install_ptest() {
+ cat ${WORKDIR}/disable-tests >> ${S}/tests/data/DISABLED
+ 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
+ cp -rf ${D}${bindir}/curl-config ${D}${PTEST_PATH}
+}
+
+RDEPENDS:${PN}-ptest += "bash perl-modules"
+
PACKAGES =+ "lib${BPN}"
FILES:lib${BPN} = "${libdir}/lib*.so.*"
--
2.36.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-05 2:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-10 14:01 [PATCH v2] curl: add ptest Maxin B. John
2017-02-21 0:41 ` Burton, Ross
2017-02-21 12:19 ` Maxin B. John
-- strict thread matches above, loose matches on Subject: below --
2022-07-05 2:48 [PATCH v2] curl : Add ptest Yogesh Tyagi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox