diff options
author | Jiaying Song <jiaying.song.cn@windriver.com> | 2024-11-20 13:29:33 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-11-19 22:26:45 -0800 |
commit | bea74f838b42926cfbf60278914c4a211cc907a9 (patch) | |
tree | f8b8123b84838ffb18c736d047cea27d8340cdb9 /meta-networking/recipes-support/openvpn | |
parent | afd72775425ce9e413e47a3960b5a469381ae0e4 (diff) | |
download | meta-openembedded-bea74f838b42926cfbf60278914c4a211cc907a9.tar.gz |
openvpn: add ptest support
All test cases PASS.
Add openvpn to PTESTS_SLOW because test duration longer than 30s Below is parts of the run log:
[==========] xkey provider tests: Running 3 test(s).
[ RUN ] xkey_provider_test_fetch
[ OK ] xkey_provider_test_fetch
[ RUN ] xkey_provider_test_mgmt_sign_cb
[ OK ] xkey_provider_test_mgmt_sign_cb
[ RUN ] xkey_provider_test_generic_sign_cb
[ OK ] xkey_provider_test_generic_sign_cb
[==========] xkey provider tests: 3 test(s) run.
[ PASSED ] 3 test(s).
PASS: provider_testdriver
The files t_client.sh.in and t_cltsrv.sh were not added because they
require specific environment configuration files. It is recommended that
users configure these based on their environment before testing.
Since the recipe enables iproute2, the condition for t_net.sh based on
HAVE_SITNL is not met, so t_net.sh will not be included in the build.
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/openvpn')
-rw-r--r-- | meta-networking/recipes-support/openvpn/openvpn/run-ptest | 5 | ||||
-rw-r--r-- | meta-networking/recipes-support/openvpn/openvpn_2.6.12.bb | 48 |
2 files changed, 51 insertions, 2 deletions
diff --git a/meta-networking/recipes-support/openvpn/openvpn/run-ptest b/meta-networking/recipes-support/openvpn/openvpn/run-ptest new file mode 100644 index 0000000000..5b187d9086 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn/run-ptest | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | for x in `find ./ -name Makefile`; | ||
3 | do | ||
4 | make -C `dirname ${x}` -k runtest-TESTS | ||
5 | done | ||
diff --git a/meta-networking/recipes-support/openvpn/openvpn_2.6.12.bb b/meta-networking/recipes-support/openvpn/openvpn_2.6.12.bb index d81b8ce449..958eecb63a 100644 --- a/meta-networking/recipes-support/openvpn/openvpn_2.6.12.bb +++ b/meta-networking/recipes-support/openvpn/openvpn_2.6.12.bb | |||
@@ -3,13 +3,14 @@ HOMEPAGE = "https://openvpn.net/" | |||
3 | SECTION = "net" | 3 | SECTION = "net" |
4 | LICENSE = "GPL-2.0-only" | 4 | LICENSE = "GPL-2.0-only" |
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=89196bacc47ed37a5b242a535661a049" | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=89196bacc47ed37a5b242a535661a049" |
6 | DEPENDS = "lzo lz4 openssl iproute2 libcap-ng ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | 6 | DEPENDS = "lzo lz4 openssl iproute2 libcap-ng ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} ${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)} " |
7 | 7 | ||
8 | inherit autotools systemd update-rc.d pkgconfig | 8 | inherit autotools systemd update-rc.d pkgconfig ptest |
9 | 9 | ||
10 | SRC_URI = "http://swupdate.openvpn.org/community/releases/${BP}.tar.gz \ | 10 | SRC_URI = "http://swupdate.openvpn.org/community/releases/${BP}.tar.gz \ |
11 | file://0001-configure.ac-eliminate-build-path-from-openvpn-versi.patch \ | 11 | file://0001-configure.ac-eliminate-build-path-from-openvpn-versi.patch \ |
12 | file://openvpn \ | 12 | file://openvpn \ |
13 | file://run-ptest \ | ||
13 | " | 14 | " |
14 | 15 | ||
15 | UPSTREAM_CHECK_URI = "https://openvpn.net/community-downloads" | 16 | UPSTREAM_CHECK_URI = "https://openvpn.net/community-downloads" |
@@ -42,6 +43,8 @@ PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \ | |||
42 | PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd" | 43 | PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd" |
43 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" | 44 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" |
44 | 45 | ||
46 | RDEPENDS:${PN}-ptest:append = " make bash" | ||
47 | |||
45 | do_install:append() { | 48 | do_install:append() { |
46 | install -d ${D}/${sysconfdir}/init.d | 49 | install -d ${D}/${sysconfdir}/init.d |
47 | install -m 755 ${UNPACKDIR}/openvpn ${D}/${sysconfdir}/init.d | 50 | install -m 755 ${UNPACKDIR}/openvpn ${D}/${sysconfdir}/init.d |
@@ -63,6 +66,47 @@ do_install:append() { | |||
63 | install -d -m 710 ${D}/${localstatedir}/lib/openvpn | 66 | install -d -m 710 ${D}/${localstatedir}/lib/openvpn |
64 | } | 67 | } |
65 | 68 | ||
69 | do_compile_ptest () { | ||
70 | for x in `find ${B}/tests/unit_tests -name Makefile -exec grep -l buildtest-TESTS {} \;`; do | ||
71 | dir=`dirname ${x}` | ||
72 | case $dir in | ||
73 | *example*) | ||
74 | echo "Skipping directory: $dir" | ||
75 | ;; | ||
76 | *) | ||
77 | oe_runmake -C ${dir} buildtest-TESTS | ||
78 | ;; | ||
79 | esac | ||
80 | done | ||
81 | } | ||
82 | |||
83 | do_install_ptest() { | ||
84 | for x in $(find ${B}/tests/unit_tests -name Makefile -exec grep -l buildtest-TESTS {} \;); do | ||
85 | dir=$(dirname ${x}) | ||
86 | |||
87 | if [[ "$dir" == *example* ]]; then | ||
88 | continue | ||
89 | fi | ||
90 | |||
91 | target_dir="${D}/${PTEST_PATH}/unit_tests/$(basename ${dir})" | ||
92 | mkdir -p ${target_dir} | ||
93 | cp -f ${dir}/Makefile ${target_dir}/ | ||
94 | sed -i "s/^Makefile:/MM:/g" ${target_dir}/Makefile | ||
95 | sed -i 's/^#TESTS = $(am__EXEEXT_4)/TESTS = $(am__EXEEXT_4)/' ${target_dir}/Makefile | ||
96 | |||
97 | for testfile in $(find ${dir} -name "*testdriver"); do | ||
98 | cp -rf ${testfile} ${target_dir}/ | ||
99 | done | ||
100 | done | ||
101 | sed -i 's|find ./|find ${PTEST_PATH}|g' ${D}${PTEST_PATH}/run-ptest | ||
102 | sed -i 's|${top_builddir}/src/openvpn|${sbindir}|g' ${S}/tests/t_lpback.sh | ||
103 | cp -f ${S}/tests/t_lpback.sh ${D}/${PTEST_PATH} | ||
104 | cp -f ${B}/tests/Makefile ${D}/${PTEST_PATH} | ||
105 | sed -i "s/^Makefile:/MM:/g" ${D}/${PTEST_PATH}/Makefile | ||
106 | sed -i "s/^test_scripts = t_client.sh t_lpback.sh t_cltsrv.sh/test_scripts = t_lpback.sh/g" ${D}/${PTEST_PATH}/Makefile | ||
107 | |||
108 | } | ||
109 | |||
66 | PACKAGES =+ " ${PN}-sample " | 110 | PACKAGES =+ " ${PN}-sample " |
67 | 111 | ||
68 | RRECOMMENDS:${PN} = "kernel-module-tun" | 112 | RRECOMMENDS:${PN} = "kernel-module-tun" |