mirror of
https://github.com/openwrt/packages.git
synced 2025-12-23 10:14: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:
@@ -2,6 +2,7 @@
|
||||
|
||||
PRINT_PASSED=2
|
||||
|
||||
printf "Initializing tests ...\n"
|
||||
|
||||
OPENSSL_PEM="$(mktemp)"
|
||||
OPENSSL_DER="$(mktemp)"
|
||||
@@ -18,14 +19,14 @@ openssl req -x509 -nodes -days 1 -keyout /dev/null 2>/dev/null \
|
||||
|
||||
|
||||
function test() {
|
||||
MSG="$1 >/dev/null \t (-> $2?) \t"
|
||||
eval "$1 >/dev/null "
|
||||
if [ $? -eq $2 ]
|
||||
then
|
||||
[ "$PRINT_PASSED" -gt 0 ] && printf "$MSG passed.\n"
|
||||
[ "${PRINT_PASSED}" -gt 0 ] \
|
||||
&& printf "%-72s%-1s\n" "$1" ">/dev/null (-> $2?) passed."
|
||||
else
|
||||
printf "$MSG failed!!!\n"
|
||||
[ "$PRINT_PASSED" -gt 1 ] && exit 1
|
||||
printf "%-72s%-1s\n" "$1" ">/dev/null (-> $2?) failed!!!"
|
||||
[ "${PRINT_PASSED}" -gt 1 ] && exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user