diff options
author | Changqing Li <changqing.li@windriver.com> | 2020-12-28 14:17:02 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-12-29 15:50:45 -0800 |
commit | d7aa7173405c3b36235af736cd31dbe110708787 (patch) | |
tree | 1cc743c45d2dbb618855610ef0409aa9a6d4c568 | |
parent | 9d50716cf4dc898dc491d624152634f02dec8acb (diff) | |
download | meta-openembedded-d7aa7173405c3b36235af736cd31dbe110708787.tar.gz |
libssh2: enhance ptest
support testcase ssh2.sh
Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 55 insertions, 4 deletions
diff --git a/meta-oe/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch b/meta-oe/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch new file mode 100644 index 000000000..5ff9bf846 --- /dev/null +++ b/meta-oe/recipes-support/libssh2/files/0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From f9e3e2ee7b18ba5bb8efe083171f3e701eb0a663 Mon Sep 17 00:00:00 2001 | ||
2 | From: Your Name <you@example.com> | ||
3 | Date: Mon, 28 Dec 2020 02:08:03 +0000 | ||
4 | Subject: [PATCH] Don't let host enviroment to decide if a test is build | ||
5 | |||
6 | test ssh2.sh need sshd, for cross compile, we need it on target, so | ||
7 | don't use SSHD on host to decide weither to build a test | ||
8 | |||
9 | Upstream-Status: Inappropriate[oe specific] | ||
10 | |||
11 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
12 | --- | ||
13 | tests/Makefile.am | 6 +----- | ||
14 | 1 file changed, 1 insertion(+), 5 deletions(-) | ||
15 | |||
16 | diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
17 | index dc0922f..6cbc35d 100644 | ||
18 | --- a/tests/Makefile.am | ||
19 | +++ b/tests/Makefile.am | ||
20 | @@ -1,16 +1,12 @@ | ||
21 | AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/src | ||
22 | LDADD = ../src/libssh2.la | ||
23 | |||
24 | -if SSHD | ||
25 | noinst_PROGRAMS = ssh2 | ||
26 | ssh2_SOURCES = ssh2.c | ||
27 | -endif | ||
28 | |||
29 | ctests = simple$(EXEEXT) | ||
30 | TESTS = $(ctests) mansyntax.sh | ||
31 | -if SSHD | ||
32 | TESTS += ssh2.sh | ||
33 | -endif | ||
34 | check_PROGRAMS = $(ctests) | ||
35 | |||
36 | TESTS_ENVIRONMENT = SSHD=$(SSHD) EXEEXT=$(EXEEXT) | ||
37 | @@ -38,4 +34,4 @@ if OPENSSL | ||
38 | # EXTRA_DIST += test_public_key_auth_succeeds_with_correct_encrypted_ed25519_key.c | ||
39 | # EXTRA_DIST += test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c | ||
40 | EXTRA_DIST += test_public_key_auth_succeeds_with_correct_rsa_openssh_key.c | ||
41 | -endif | ||
42 | \ No newline at end of file | ||
43 | +endif | ||
44 | -- | ||
45 | 2.20.1 | ||
46 | |||
diff --git a/meta-oe/recipes-support/libssh2/files/run-ptest b/meta-oe/recipes-support/libssh2/files/run-ptest index c213b32e5..5fd7ec65f 100644 --- a/meta-oe/recipes-support/libssh2/files/run-ptest +++ b/meta-oe/recipes-support/libssh2/files/run-ptest | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | ptestdir=$(dirname "$(readlink -f "$0")") | 3 | ptestdir=$(dirname "$(readlink -f "$0")") |
4 | cd tests | 4 | cd tests |
5 | for test in $(ls) | 5 | for test in simple ssh2.sh mansyntax.sh |
6 | do | 6 | do |
7 | ./../test-driver --test-name $test --log-file ../$test.log --trs-file ../$test.trs --color-tests no --enable-hard-errors yes --expect-failure no -- ./$test | 7 | ./../test-driver --test-name $test --log-file ../$test.log --trs-file ../$test.trs --color-tests no --enable-hard-errors yes --expect-failure no -- ./$test |
8 | done | 8 | done |
diff --git a/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb b/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb index 38f162693..4a5a05060 100644 --- a/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb +++ b/meta-oe/recipes-support/libssh2/libssh2_1.9.0.bb | |||
@@ -11,6 +11,9 @@ SRC_URI = "http://www.libssh2.org/download/${BP}.tar.gz \ | |||
11 | file://CVE-2019-17498.patch \ | 11 | file://CVE-2019-17498.patch \ |
12 | file://run-ptest \ | 12 | file://run-ptest \ |
13 | " | 13 | " |
14 | |||
15 | SRC_URI_append_ptest = " file://0001-Don-t-let-host-enviroment-to-decide-if-a-test-is-bui.patch" | ||
16 | |||
14 | SRC_URI[md5sum] = "1beefafe8963982adc84b408b2959927" | 17 | SRC_URI[md5sum] = "1beefafe8963982adc84b408b2959927" |
15 | SRC_URI[sha256sum] = "d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd" | 18 | SRC_URI[sha256sum] = "d5fb8bd563305fd1074dda90bd053fb2d29fc4bce048d182f96eaa466dfadafd" |
16 | 19 | ||
@@ -29,7 +32,7 @@ PACKAGECONFIG[gcrypt] = "--with-crypto=libgcrypt --with-libgcrypt-prefix=${STAGI | |||
29 | BBCLASSEXTEND = "native nativesdk" | 32 | BBCLASSEXTEND = "native nativesdk" |
30 | 33 | ||
31 | # required for ptest on documentation | 34 | # required for ptest on documentation |
32 | RDEPENDS_${PN}-ptest = "man-db" | 35 | RDEPENDS_${PN}-ptest = "man-db openssh" |
33 | RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-en-us" | 36 | RDEPENDS_${PN}-ptest_append_libc-glibc = " locale-base-en-us" |
34 | 37 | ||
35 | do_compile_ptest() { | 38 | do_compile_ptest() { |
@@ -39,9 +42,11 @@ do_compile_ptest() { | |||
39 | 42 | ||
40 | do_install_ptest() { | 43 | do_install_ptest() { |
41 | install -d ${D}${PTEST_PATH}/tests | 44 | install -d ${D}${PTEST_PATH}/tests |
42 | install -m 0755 ${B}/tests/.libs/simple ${D}${PTEST_PATH}/tests/ | ||
43 | install -m 0755 ${S}/tests/mansyntax.sh ${D}${PTEST_PATH}/tests/ | ||
44 | install -m 0755 ${S}/test-driver ${D}${PTEST_PATH}/ | 45 | install -m 0755 ${S}/test-driver ${D}${PTEST_PATH}/ |
46 | cp -rf ${B}/tests/.libs/* ${D}${PTEST_PATH}/tests/ | ||
47 | cp -rf ${S}/tests/mansyntax.sh ${D}${PTEST_PATH}/tests/ | ||
48 | cp -rf ${S}/tests/ssh2.sh ${D}${PTEST_PATH}/tests/ | ||
49 | cp -rf ${S}/tests/etc ${D}${PTEST_PATH}/tests/ | ||
45 | mkdir -p ${D}${PTEST_PATH}/docs | 50 | mkdir -p ${D}${PTEST_PATH}/docs |
46 | cp -r ${S}/docs/* ${D}${PTEST_PATH}/docs/ | 51 | cp -r ${S}/docs/* ${D}${PTEST_PATH}/docs/ |
47 | } | 52 | } |