summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaitao Liu <haitao.liu@windriver.com>2026-06-01 17:01:45 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2026-06-10 19:03:33 +0000
commit781735b97ae5013cacabbecd38e6da6b510cf3fb (patch)
tree0a4885cf864613958b3f7ae5b75d0639ceaa6912
parent4b9ba41f3a6da7c704f7d89e5994126c26031da8 (diff)
downloadmeta-virtualization-wrynose.tar.gz
openvswitch: re-enable ptestwrynose
Ptest support was disabled in commit 816d4c6e0e7c due to breakage in source handling that prevented proper installation of test files. Fix the ptest installation by: - Copying test binaries from the build directory, preserving subdirectory structure (e.g., oss-fuzz/) for optional test components - Installing *.at test definitions and *.py test scripts from the source tree - Fixing PYTHONPATH in atlocal to use runtime paths instead of build paths - Symlinking schema files already provided by the main package to avoid file duplication Re-enable ptest now that installation works correctly. Test results on genericx86-64: PASS: checkpatch - catastrophic backtracking PASS: checkpatch - Unicode code PASS: appctl-bashcomp - complex completion check 4 PASS: appctl-bashcomp - complex completion check 2 PASS: checkpatch - check misuse APIs PASS: checkpatch - whitespace around cast PASS: checkpatch - comments PASS: checkpatch - check egrep / fgrep PASS: checkpatch - file contents checks - bare return PASS: checkpatch - subject PASS: appctl-bashcomp - negative test ... ... ... PASS: drop-stats - bridge sampling PASS: drop-stats - sampling action PASS: ovsdb-idl - Check Python IDL reconnects to leader - Python3 (leader only) PASS: monitor-cond-change with many sessions pending 2658 tests were successful. 89 tests were skipped. Signed-off-by: Haitao Liu <haitao.liu@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-networking/openvswitch/openvswitch_git.bb59
1 files changed, 56 insertions, 3 deletions
diff --git a/recipes-networking/openvswitch/openvswitch_git.bb b/recipes-networking/openvswitch/openvswitch_git.bb
index 694aad97..9662ddb2 100644
--- a/recipes-networking/openvswitch/openvswitch_git.bb
+++ b/recipes-networking/openvswitch/openvswitch_git.bb
@@ -20,7 +20,6 @@ FILESEXTRAPATHS:append := "${THISDIR}/${PN}-git:"
20 20
21SRCREV = "04b05b31ade4d903589a90a14861730562285be7" 21SRCREV = "04b05b31ade4d903589a90a14861730562285be7"
22SRC_URI += "git://github.com/openvswitch/ovs.git;protocol=https;branch=branch-3.7 \ 22SRC_URI += "git://github.com/openvswitch/ovs.git;protocol=https;branch=branch-3.7 \
23 file://openvswitch-add-ptest-71d553b995d0bd527d3ab1e9fbaf5a2ae34de2f3.patch \
24 file://run-ptest \ 23 file://run-ptest \
25 file://disable_m4_check.patch \ 24 file://disable_m4_check.patch \
26 file://systemd-update-tool-paths.patch \ 25 file://systemd-update-tool-paths.patch \
@@ -50,6 +49,60 @@ inherit ptest
50EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}" 49EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}"
51 50
52do_install_ptest() { 51do_install_ptest() {
53 echo "disabled: oe_runmake test-install"
54}
55 52
53 install -d ${D}${PTEST_PATH}/tests/
54
55 install -m 0644 ${B}/tests/atlocal ${B}/tests/atconfig ${D}${PTEST_PATH}/tests/
56
57 # Copy test binaries into the ptest directory, preserving subdirectory structure.
58 # Use -maxdepth 2 because subdirectories like oss-fuzz/ are not enabled by default;
59 # when enabled, their binaries (e.g., ./oss-fuzz/oss) need to be copied as well.
60 cd ${B}/tests && find . -maxdepth 2 -type f -executable | xargs -I {} cp --parents {} ${D}${PTEST_PATH}/tests/
61 cd ${S}/tests && find . -maxdepth 1 -name '*.at' | xargs -I {} cp --parents {} ${D}${PTEST_PATH}/tests/
62 cd ${S}/tests && find . -maxdepth 1 -type f -executable | xargs -I {} cp --parents {} ${D}${PTEST_PATH}/tests/
63
64 cd ${S}/tests && find . -maxdepth 1 -name '*.py' -exec install -m 0755 {} ${D}${PTEST_PATH}/tests/ \;
65
66 install -D -m 0644 ${S}/vswitchd/vswitch.ovsschema ${D}${PTEST_PATH}/vswitchd/vswitch.ovsschema
67
68 install -D -m 0755 ${S}/utilities/checkpatch.py ${D}${PTEST_PATH}/utilities/checkpatch.py
69 install -D -m 0644 ${S}/utilities/ovs-pcap.in ${D}${PTEST_PATH}/utilities/ovs-pcap.in
70 install -D -m 0644 ${S}/utilities/ovs-pki.in ${D}${PTEST_PATH}/utilities/ovs-pki.in
71
72 install -D -m 0644 ${S}/python/test_requirements.txt ${D}${PTEST_PATH}/python/test_requirements.txt
73 install -m 0644 ${S}/tests/idltest.ovsschema ${D}${PTEST_PATH}/tests/
74 install -m 0644 ${S}/tests/idltest2.ovsschema ${D}${PTEST_PATH}/tests/
75 install -m 0644 ${S}/AUTHORS.rst ${D}${PTEST_PATH}/
76 install -D -m 0644 ${S}/build-aux/check-structs ${D}${PTEST_PATH}/build-aux/check-structs
77
78 # Symlink vtep.ovsschema to the path expected by ptest; the actual file is
79 # already installed by the main openvswitch package.
80 install -d ${D}${PTEST_PATH}/vtep
81 ln -sf /usr/share/openvswitch/vtep.ovsschema ${D}${PTEST_PATH}/vtep/vtep.ovsschema
82
83 sed -i \
84 -e 's|PYTHON=.*|PYTHON="python3"|' \
85 -e 's|PYTHONPATH=.*|PYTHONPATH=/usr/share/openvswitch/python:${PTEST_PATH}/tests:$PYTHONPATH|' \
86 -e 's|EGREP=.*|EGREP='"'"'grep -E'"'"'|g' \
87 -e 's|CFLAGS=.*|CFLAGS='"'"' '"'"'|g' \
88 ${D}${PTEST_PATH}/tests/atlocal
89
90 sed -i \
91 -e "s|^at_testdir=.*|at_testdir='${PTEST_PATH}'|" \
92 -e "s|^abs_builddir=.*|abs_builddir='${PTEST_PATH}'|" \
93 -e "s|^at_srcdir=.*|at_srcdir='${PTEST_PATH}/tests'|" \
94 -e "s|^abs_srcdir=.*|abs_srcdir='${PTEST_PATH}/tests'|" \
95 -e "s|^at_top_srcdir=.*|at_top_srcdir='${PTEST_PATH}'|" \
96 -e "s|^abs_top_srcdir=.*|abs_top_srcdir='${PTEST_PATH}'|" \
97 -e "s|^at_top_build_prefix=.*|at_top_build_prefix='${PTEST_PATH}'|" \
98 -e "s|^abs_top_builddir=.*|abs_top_builddir='${PTEST_PATH}'|" \
99 ${D}${PTEST_PATH}/tests/atconfig
100
101 sed -i \
102 -e "s|ovs-appctl-bashcomp\.bash|/etc/bash_completion.d/ovs-appctl-bashcomp\.bash|g" \
103 -e "s|ovs-vsctl-bashcomp\.bash|/etc/bash_completion.d/ovs-vsctl-bashcomp\.bash|g" \
104 -e "s|^\(.*config\.log.*\)|#\1|g" \
105 ${D}${PTEST_PATH}/tests/testsuite
106}
107RDEPENDS:${PN}-ptest += " ${PN}-testcontroller"
108RDEPENDS:${PN}-ptest += "python3-packaging python3-setuptools"