mirror of https://github.com/omar-polo/gmid.git
add a test for the config dumping
This commit is contained in:
parent
f53f5e5fe1
commit
42235e3fc2
|
@ -20,6 +20,9 @@ fi
|
||||||
run_test test_punycode
|
run_test test_punycode
|
||||||
run_test test_iri
|
run_test test_iri
|
||||||
|
|
||||||
|
# Run configuration dumping test.
|
||||||
|
run_test test_dump_config
|
||||||
|
|
||||||
if [ "${SKIP_RUNTIME_TESTS:-0}" -eq 1 ]; then
|
if [ "${SKIP_RUNTIME_TESTS:-0}" -eq 1 ]; then
|
||||||
echo
|
echo
|
||||||
echo "======================"
|
echo "======================"
|
||||||
|
|
|
@ -8,6 +8,34 @@ test_iri() {
|
||||||
./iri_test
|
./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() {
|
test_gemexp() {
|
||||||
dont_check_server_alive=yes
|
dont_check_server_alive=yes
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue