From: "Björn Stenberg" <bjst@enea.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 6/8] openssh: Add ptest
Date: Tue, 19 Feb 2013 14:14:02 +0100 [thread overview]
Message-ID: <1361279644-17675-7-git-send-email-bjst@enea.com> (raw)
In-Reply-To: <1361279644-17675-1-git-send-email-bjst@enea.com>
Signed-off-by: Björn Stenberg <bjst@enea.com>
---
.../add-test-support-for-busybox.patch | 61 ++++++++++++++++++++
.../openssh/openssh-6.1p1/run-ptest | 7 ++
meta/recipes-connectivity/openssh/openssh_6.1p1.bb | 11 +++-
3 files changed, 78 insertions(+), 1 deletions(-)
create mode 100644 meta/recipes-connectivity/openssh/openssh-6.1p1/add-test-support-for-busybox.patch
create mode 100755 meta/recipes-connectivity/openssh/openssh-6.1p1/run-ptest
diff --git a/meta/recipes-connectivity/openssh/openssh-6.1p1/add-test-support-for-busybox.patch b/meta/recipes-connectivity/openssh/openssh-6.1p1/add-test-support-for-busybox.patch
new file mode 100644
index 0000000..5913597
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh-6.1p1/add-test-support-for-busybox.patch
@@ -0,0 +1,61 @@
+Adjust test cases to work with busybox.
+
+- Replace dd parameter "obs" with "bs".
+- Replace "head -<num>" with "head -n <num>".
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-status: Pending
+
+--- a/regress/cipher-speed.sh 2012-06-30 07:08:53.000000000 +0200
++++ b/regress/cipher-speed.sh 2013-02-15 11:30:20.670022055 +0100
+@@ -26,7 +26,7 @@
+ echon "$c/$m:\t"
+ ( ${SSH} -o 'compression no' \
+ -F $OBJ/ssh_proxy -2 -m $m -c $c somehost \
+- exec sh -c \'"dd of=/dev/null obs=32k"\' \
++ exec sh -c \'"dd of=/dev/null bs=32k"\' \
+ < ${DATA} ) 2>&1 | getbytes
+
+ if [ $? -ne 0 ]; then
+@@ -42,7 +42,7 @@
+ echon "$c:\t"
+ ( ${SSH} -o 'compression no' \
+ -F $OBJ/ssh_proxy -1 -c $c somehost \
+- exec sh -c \'"dd of=/dev/null obs=32k"\' \
++ exec sh -c \'"dd of=/dev/null bs=32k"\' \
+ < ${DATA} ) 2>&1 | getbytes
+ if [ $? -ne 0 ]; then
+ fail "ssh -1 failed with cipher $c"
+--- a/regress/transfer.sh 2003-09-04 06:54:40.000000000 +0200
++++ b/regress/transfer.sh 2013-02-15 11:25:34.666411185 +0100
+@@ -18,7 +18,7 @@
+ for s in 10 100 1k 32k 64k 128k 256k; do
+ trace "proto $p dd-size ${s}"
+ rm -f ${COPY}
+- dd if=$DATA obs=${s} 2> /dev/null | \
++ dd if=$DATA bs=${s} 2> /dev/null | \
+ ${SSH} -q -$p -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
+ if [ $? -ne 0 ]; then
+ fail "ssh cat $DATA failed"
+--- a/regress/yes-head.sh 2005-11-28 06:41:03.000000000 +0100
++++ b/regress/yes-head.sh 2013-02-15 11:55:11.413715068 +0100
+@@ -4,7 +4,7 @@
+ tid="yes pipe head"
+
+ for p in 1 2; do
+- lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | _POSIX2_VERSION=199209 head -2000"' | (sleep 3 ; wc -l)`
++ lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | _POSIX2_VERSION=199209 head -n 2000"' | (sleep 3 ; wc -l)`
+ if [ $? -ne 0 ]; then
+ fail "yes|head test failed"
+ lines = 0;
+--- a/regress/key-options.sh 2008-07-04 09:08:58.000000000 +0200
++++ b/regress/key-options.sh 2013-02-15 12:06:05.109486098 +0100
+@@ -54,7 +54,7 @@
+ fi
+
+ sed 's/.*/from="'"$f"'" &/' $origkeys >$authkeys
+- from=`head -1 $authkeys | cut -f1 -d ' '`
++ from=`head -n 1 $authkeys | cut -f1 -d ' '`
+ verbose "key option proto $p $from"
+ r=`${SSH} -$p -q -F $OBJ/ssh_proxy somehost 'echo true'`
+ if [ "$r" = "true" ]; then
diff --git a/meta/recipes-connectivity/openssh/openssh-6.1p1/run-ptest b/meta/recipes-connectivity/openssh/openssh-6.1p1/run-ptest
new file mode 100755
index 0000000..3e725cf
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh-6.1p1/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+export TEST_SHELL=sh
+
+cd regress
+make -k .OBJDIR=`pwd` .CURDIR=`pwd` tests \
+ | sed -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g'
diff --git a/meta/recipes-connectivity/openssh/openssh_6.1p1.bb b/meta/recipes-connectivity/openssh/openssh_6.1p1.bb
index 32c3b2c..b2a70b7 100644
--- a/meta/recipes-connectivity/openssh/openssh_6.1p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_6.1p1.bb
@@ -25,13 +25,15 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
file://ssh_config \
file://init \
file://openssh-CVE-2011-4327.patch \
+ file://add-test-support-for-busybox.patch \
+ file://run-ptest \
${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
PAM_SRC_URI = "file://sshd"
SRC_URI[md5sum] = "3345cbf4efe90ffb06a78670ab2d05d5"
SRC_URI[sha256sum] = "d1c157f6c0852e90c191cc7c9018a583b51e3db4035489cb262639d337a1c411"
-inherit useradd update-rc.d update-alternatives
+inherit useradd update-rc.d update-alternatives ptest
USERADD_PACKAGES = "${PN}-sshd"
USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
@@ -81,6 +83,12 @@ do_install_append () {
install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
+
+ if [ "${PN}" = "${BPN}" -a ${PTEST_ENABLED} = "1" ]; then
+ ptest_do_install
+ sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libdir}/${PN}/sftp-server|" regress/test-exec.sh
+ cp -r regress ${D}{$PTEST_PATH}
+ fi
}
ALLOW_EMPTY_${PN} = "1"
@@ -98,6 +106,7 @@ FILES_${PN}-keygen = "${bindir}/ssh-keygen"
RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
DEPENDS_${PN}-sshd += "update-rc.d"
RDEPENDS_${PN}-sshd += "update-rc.d ${PN}-keygen"
+RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
--
1.7.5.4
next prev parent reply other threads:[~2013-02-19 13:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-19 13:13 [PATCH 0/8] Ptest additions Björn Stenberg
2013-02-19 13:13 ` [PATCH 1/8] busybox: Add ptest Björn Stenberg
2013-02-19 14:04 ` Bernhard Reutner-Fischer
2013-02-20 14:52 ` [PATCH 1/8 v2] " Björn Stenberg
2013-02-19 13:13 ` [PATCH 2/8] zlib: " Björn Stenberg
2013-02-22 14:02 ` Richard Purdie
2013-02-22 15:56 ` Björn Stenberg
2013-02-22 17:39 ` Richard Purdie
2013-02-19 13:13 ` [PATCH 3/8] udev: " Björn Stenberg
2013-02-21 6:55 ` Saul Wold
2013-02-19 13:14 ` [PATCH 4/8] acl: " Björn Stenberg
2013-02-22 13:59 ` Richard Purdie
2013-02-19 13:14 ` [PATCH 5/8] bzip2: " Björn Stenberg
2013-02-19 13:14 ` Björn Stenberg [this message]
2013-02-19 13:14 ` [PATCH 7/8] openssl: " Björn Stenberg
2013-02-22 14:05 ` Richard Purdie
2013-02-19 13:14 ` [PATCH 8/8] ptest: Add missed .debug path Björn Stenberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1361279644-17675-7-git-send-email-bjst@enea.com \
--to=bjst@enea.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.