mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 16:54:32 +04:00
nginx-util: add tests, clean up and fix issues
Add tests for nginx-ssl-util and nginx-ssl-util-nopcre using (fake)chroot. Clean the code up making nginx-ssl-util a header file. Both changes are for better (future) code quality only. There are minor functional improvements: * fix compiler error of gcc7 by using std=c++17 * fix error if there is no lan/loopback interface * notice instead of error message if there is no default server * add ipv6-prefix-assignment.*.local-address.address for LAN * add CONFLICTS in Makefile for choosing the right version * add cast to release of unique_ptr to avoid warning * add version message to help message Signed-off-by: Peter Stadler <peter.stadler@student.uibk.ac.at>
This commit is contained in:
38
net/nginx-util/src/test-nginx-util.sh
Executable file
38
net/nginx-util/src/test-nginx-util.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
printf "Initializing tests ...\n"
|
||||
|
||||
fakechroot=""
|
||||
|
||||
[ -x /usr/bin/fakechroot ] && fakechroot="/usr/bin/fakechroot" \
|
||||
|| [ "$(id -u)" -eq 0 ] || { \
|
||||
printf "Error: Testing needs fakechroot or whoami=root for chroot."
|
||||
return 1
|
||||
}
|
||||
|
||||
TMPROOT=$(mktemp -d /tmp/test-nginx-util-XXXXXX)
|
||||
|
||||
ln -s /bin ${TMPROOT}/bin
|
||||
|
||||
mkdir -p ${TMPROOT}/usr/bin/
|
||||
|
||||
cp ./test-nginx-util-root.sh ${TMPROOT}/usr/bin/
|
||||
|
||||
|
||||
printf "\n\n******* Testing nginx-ssl-util-noubus *******\n"
|
||||
|
||||
cp ./nginx-ssl-util-noubus ${TMPROOT}/usr/bin/nginx-util
|
||||
|
||||
${fakechroot} /bin/chroot ${TMPROOT} /bin/sh -c /usr/bin/test-nginx-util-root.sh
|
||||
|
||||
echo $?
|
||||
|
||||
|
||||
printf "\n\n******* Testing nginx-ssl-util-nopcre-noubus *******\n"
|
||||
|
||||
cp ./nginx-ssl-util-nopcre-noubus ${TMPROOT}/usr/bin/nginx-util
|
||||
|
||||
${fakechroot} /bin/chroot ${TMPROOT} /bin/sh -c /usr/bin/test-nginx-util-root.sh
|
||||
|
||||
|
||||
rm -r ${TMPROOT}
|
||||
Reference in New Issue
Block a user