add a test for the config dumping

This commit is contained in:
Omar Polo 2024-04-04 13:07:09 +00:00
parent f53f5e5fe1
commit 42235e3fc2
2 changed files with 31 additions and 0 deletions

View File

@ -20,6 +20,9 @@ fi
run_test test_punycode
run_test test_iri
# Run configuration dumping test.
run_test test_dump_config
if [ "${SKIP_RUNTIME_TESTS:-0}" -eq 1 ]; then
echo
echo "======================"

View File

@ -8,6 +8,34 @@ test_iri() {
./iri_test
}
test_dump_config() {
dont_check_server_alive=yes
gen_config '' ''
exp="$(mktemp)"
got="$(mktemp)"
cat <<EOF >$exp
prefork 3
server "localhost" {
cert "$PWD/localhost.pem"
key "$PWD/localhost.key"
}
EOF
$gmid -nn -c reg.conf > $got 2>/dev/null
ret=0
if ! cmp -s "$exp" "$got"; then
echo "config differs!" >&2
diff -u "$exp" "$got" >&2
ret=1
fi
rm "$exp" "$got"
return $ret
}
test_gemexp() {
dont_check_server_alive=yes