summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxin B. John <maxin.john@enea.com>2014-04-24 18:00:22 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-04-25 17:19:19 +0100
commitf11e9e295d7f8a1e0219fb7a45a5a134a773aae2 (patch)
treec35c29b048cc3cba7fcc11a967f0b20edb74ee7b
parent8a9c165c506ff2c21d918424a34f18e5d316f2bb (diff)
downloadpoky-f11e9e295d7f8a1e0219fb7a45a5a134a773aae2.tar.gz
openssh: enable ptest support
Install openssh test-suite and run it as ptest. (From OE-Core rev: 4d0ecccae671bffb40c870a6e33d20be869b89bc) Signed-off-by: Maxin B. John <maxin.john@enea.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch61
-rwxr-xr-xmeta/recipes-connectivity/openssh/openssh/run-ptest7
-rw-r--r--meta/recipes-connectivity/openssh/openssh_6.5p1.bb12
3 files changed, 78 insertions, 2 deletions
diff --git a/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch b/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
new file mode 100644
index 0000000000..07af667869
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
@@ -0,0 +1,61 @@
1Adjust test cases to work with busybox.
2
3- Replace dd parameter "obs" with "bs".
4- Replace "head -<num>" with "head -n <num>".
5
6Signed-off-by: Maxin B. John <maxin.john@enea.com>
7Upstream-Status: Pending
8
9--- a/regress/cipher-speed.sh 2012-06-30 07:08:53.000000000 +0200
10+++ b/regress/cipher-speed.sh 2013-02-15 11:30:20.670022055 +0100
11@@ -26,7 +26,7 @@
12 echon "$c/$m:\t"
13 ( ${SSH} -o 'compression no' \
14 -F $OBJ/ssh_proxy -2 -m $m -c $c somehost \
15- exec sh -c \'"dd of=/dev/null obs=32k"\' \
16+ exec sh -c \'"dd of=/dev/null bs=32k"\' \
17 < ${DATA} ) 2>&1 | getbytes
18
19 if [ $? -ne 0 ]; then
20@@ -42,7 +42,7 @@
21 echon "$c:\t"
22 ( ${SSH} -o 'compression no' \
23 -F $OBJ/ssh_proxy -1 -c $c somehost \
24- exec sh -c \'"dd of=/dev/null obs=32k"\' \
25+ exec sh -c \'"dd of=/dev/null bs=32k"\' \
26 < ${DATA} ) 2>&1 | getbytes
27 if [ $? -ne 0 ]; then
28 fail "ssh -1 failed with cipher $c"
29--- a/regress/transfer.sh 2003-09-04 06:54:40.000000000 +0200
30+++ b/regress/transfer.sh 2013-02-15 11:25:34.666411185 +0100
31@@ -18,7 +18,7 @@
32 for s in 10 100 1k 32k 64k 128k 256k; do
33 trace "proto $p dd-size ${s}"
34 rm -f ${COPY}
35- dd if=$DATA obs=${s} 2> /dev/null | \
36+ dd if=$DATA bs=${s} 2> /dev/null | \
37 ${SSH} -q -$p -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
38 if [ $? -ne 0 ]; then
39 fail "ssh cat $DATA failed"
40--- a/regress/yes-head.sh 2005-11-28 06:41:03.000000000 +0100
41+++ b/regress/yes-head.sh 2013-02-15 11:55:11.413715068 +0100
42@@ -4,7 +4,7 @@
43 tid="yes pipe head"
44
45 for p in 1 2; do
46- 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)`
47+ 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)`
48 if [ $? -ne 0 ]; then
49 fail "yes|head test failed"
50 lines = 0;
51--- a/regress/key-options.sh 2008-07-04 09:08:58.000000000 +0200
52+++ b/regress/key-options.sh 2013-02-15 12:06:05.109486098 +0100
53@@ -54,7 +54,7 @@
54 fi
55
56 sed 's/.*/from="'"$f"'" &/' $origkeys >$authkeys
57- from=`head -1 $authkeys | cut -f1 -d ' '`
58+ from=`head -n 1 $authkeys | cut -f1 -d ' '`
59 verbose "key option proto $p $from"
60 r=`${SSH} -$p -q -F $OBJ/ssh_proxy somehost 'echo true'`
61 if [ "$r" = "true" ]; then
diff --git a/meta/recipes-connectivity/openssh/openssh/run-ptest b/meta/recipes-connectivity/openssh/openssh/run-ptest
new file mode 100755
index 0000000000..3e725cf282
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/run-ptest
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3export TEST_SHELL=sh
4
5cd regress
6make -k .OBJDIR=`pwd` .CURDIR=`pwd` tests \
7 | 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.5p1.bb b/meta/recipes-connectivity/openssh/openssh_6.5p1.bb
index d19cc5a6b2..3b10164a41 100644
--- a/meta/recipes-connectivity/openssh/openssh_6.5p1.bb
+++ b/meta/recipes-connectivity/openssh/openssh_6.5p1.bb
@@ -27,7 +27,9 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
27 file://sshd.socket \ 27 file://sshd.socket \
28 file://sshd@.service \ 28 file://sshd@.service \
29 file://sshdgenkeys.service \ 29 file://sshdgenkeys.service \
30 file://volatiles.99_sshd " 30 file://volatiles.99_sshd \
31 file://add-test-support-for-busybox.patch \
32 file://run-ptest"
31 33
32PAM_SRC_URI = "file://sshd" 34PAM_SRC_URI = "file://sshd"
33 35
@@ -48,7 +50,7 @@ SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
48PACKAGECONFIG ??= "tcp-wrappers" 50PACKAGECONFIG ??= "tcp-wrappers"
49PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers" 51PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,,tcp-wrappers"
50 52
51inherit autotools-brokensep 53inherit autotools-brokensep ptest
52 54
53# LFS support: 55# LFS support:
54CFLAGS += "-D__FILE_OFFSET_BITS=64" 56CFLAGS += "-D__FILE_OFFSET_BITS=64"
@@ -118,6 +120,11 @@ do_install_append () {
118 ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service 120 ${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
119} 121}
120 122
123do_install_ptest () {
124 sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libdir}/${PN}/sftp-server|" regress/test-exec.sh
125 cp -r regress ${D}${PTEST_PATH}
126}
127
121ALLOW_EMPTY_${PN} = "1" 128ALLOW_EMPTY_${PN} = "1"
122 129
123PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server" 130PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
@@ -132,6 +139,7 @@ FILES_${PN}-keygen = "${bindir}/ssh-keygen"
132 139
133RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen" 140RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
134RDEPENDS_${PN}-sshd += "${PN}-keygen ${@base_contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}" 141RDEPENDS_${PN}-sshd += "${PN}-keygen ${@base_contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
142RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
135 143
136CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config" 144CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
137CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config" 145CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"