summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-12-23 18:49:26 +0100
committerKhem Raj <raj.khem@gmail.com>2025-12-24 13:18:25 -0800
commit03328f6c73a5f3be2283625dd2b21fa16c30d014 (patch)
tree573a0c8a9d5d572fa223470f4e716c481e7aacb1
parent7981f52062d444aed1759c674bd3ec024a4f232c (diff)
downloadmeta-openembedded-03328f6c73a5f3be2283625dd2b21fa16c30d014.tar.gz
tinyproxy: add ptest support
It takes <10s to execute. Sample output: root@qemux86-64:~# ptest-runner START: ptest-runner 2025-12-23T17:45 BEGIN: /usr/lib/tinyproxy/ptest starting web server... done (listening on 127.0.0.3:32123) starting tinyproxy... done (listening on 127.0.0.2:12321) waiting for 1 seconds.. done checking direct connection to web server... ok testing connection through tinyproxy... ok requesting statspage via stathost url... ok signaling tinyproxy to reload config...ok checking direct connection to web server... ok testing connection through tinyproxy... ok requesting statspage via stathost url... ok checking bogus request... ok, got expected error code 400 testing connection to filtered domain... ok, got expected error code 403 requesting connect method to denied port... ok, got expected error code 403 testing unavailable backend... ok, got expected error code 502 0 errors killing tinyproxy... ok killing webserver... ok done PASS: run_tests.sh DURATION: 1 END: /usr/lib/tinyproxy/ptest 2025-12-23T17:45 STOP: ptest-runner TOTAL: 1 FAIL: 0 Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/conf/include/ptest-packagelists-meta-networking.inc1
-rw-r--r--meta-networking/recipes-support/tinyproxy/tinyproxy/run-ptest10
-rw-r--r--meta-networking/recipes-support/tinyproxy/tinyproxy_1.11.2.bb26
3 files changed, 36 insertions, 1 deletions
diff --git a/meta-networking/conf/include/ptest-packagelists-meta-networking.inc b/meta-networking/conf/include/ptest-packagelists-meta-networking.inc
index 9bbae5ac91..ec0592f9a9 100644
--- a/meta-networking/conf/include/ptest-packagelists-meta-networking.inc
+++ b/meta-networking/conf/include/ptest-packagelists-meta-networking.inc
@@ -23,6 +23,7 @@ PTESTS_FAST_META_NETWORKING = "\
23 python3-scapy \ 23 python3-scapy \
24 squid \ 24 squid \
25 tcpdump \ 25 tcpdump \
26 tinyproxy \
26 unbound \ 27 unbound \
27 wolfssl \ 28 wolfssl \
28" 29"
diff --git a/meta-networking/recipes-support/tinyproxy/tinyproxy/run-ptest b/meta-networking/recipes-support/tinyproxy/tinyproxy/run-ptest
new file mode 100644
index 0000000000..267a975c24
--- /dev/null
+++ b/meta-networking/recipes-support/tinyproxy/tinyproxy/run-ptest
@@ -0,0 +1,10 @@
1#!/bin/sh
2RET=0
3cd tests/scripts
4if ./run_tests.sh; then
5 echo PASS: run_tests.sh
6else
7 echo FAIL: run_tests.sh
8 RET=1
9fi
10exit $RET
diff --git a/meta-networking/recipes-support/tinyproxy/tinyproxy_1.11.2.bb b/meta-networking/recipes-support/tinyproxy/tinyproxy_1.11.2.bb
index e386d39cdc..222cc8d7c6 100644
--- a/meta-networking/recipes-support/tinyproxy/tinyproxy_1.11.2.bb
+++ b/meta-networking/recipes-support/tinyproxy/tinyproxy_1.11.2.bb
@@ -7,6 +7,7 @@ SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.gz
7 file://disable-documentation.patch \ 7 file://disable-documentation.patch \
8 file://tinyproxy.service \ 8 file://tinyproxy.service \
9 file://tinyproxy.conf \ 9 file://tinyproxy.conf \
10 file://run-ptest \
10 file://CVE-2025-63938.patch \ 11 file://CVE-2025-63938.patch \
11 " 12 "
12 13
@@ -22,7 +23,7 @@ EXTRA_OECONF += " \
22 --enable-xtinyproxy \ 23 --enable-xtinyproxy \
23 " 24 "
24 25
25inherit autotools systemd useradd 26inherit autotools systemd useradd ptest
26 27
27#User specific 28#User specific
28USERADD_PACKAGES = "${PN}" 29USERADD_PACKAGES = "${PN}"
@@ -40,3 +41,26 @@ do_install:append() {
40 fi 41 fi
41 install -m 0644 ${UNPACKDIR}/tinyproxy.conf ${D}${sysconfdir}/tinyproxy.conf 42 install -m 0644 ${UNPACKDIR}/tinyproxy.conf ${D}${sysconfdir}/tinyproxy.conf
42} 43}
44
45do_install_ptest() {
46 install -d ${D}${PTEST_PATH}/tests/scripts
47 install -d ${D}${PTEST_PATH}/data/templates
48 install ${S}/tests/scripts/*.sh ${D}${PTEST_PATH}/tests/scripts
49 install ${S}/tests/scripts/*.pl ${D}${PTEST_PATH}/tests/scripts
50 install -m 0644 ${S}/data/templates/*.html ${D}${PTEST_PATH}/data/templates/
51 # test the installed binary, not the one that was just compiled in the src folder
52 sed -i 's,TINYPROXY_BIN=.*,TINYPROXY_BIN=tinyproxy,' ${D}${PTEST_PATH}/tests/scripts/run_tests.sh
53}
54
55RDEPENDS:${PN}-ptest += "\
56 perl \
57 perl-module-cwd \
58 perl-module-encode-encoding \
59 perl-module-file-spec \
60 perl-module-getopt-long \
61 perl-module-io-socket \
62 perl-module-io-socket-inet \
63 perl-module-pod-text \
64 perl-module-posix \
65 procps \
66"