1
0
mirror of https://github.com/graygnuorg/pound.git synced 2026-10-25 10:19:36 +03:00
Files
pound/tests/error.at
Sergey Poznyakoff a415385cb6 Improve tests
* src/config.c (assign_string_from_file): Bail out unless file is
a regular non-empty file.
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Likewise.
* tests/err501.at: New file.
* tests/warndep.at: New file.
* tests/errfile.at: Use ErrorFile instead of the deprecated ErrNNN
directive, which is tested elsewhere.
* tests/error.at: Likewise.
2024-04-05 00:22:40 +03:00

78 lines
1.3 KiB
Plaintext

# This file is part of pound testsuite. -*- autotest -*-
# Copyright (C) 2023-2024 Sergey Poznyakoff
#
# Pound is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Pound is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with pound. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([Error backend])
AT_KEYWORDS([error])
PT_CHECK([ListenHTTP
Service
Error 404
End
End
],
[GET /foo/bar
end
404
end
])
m4_pushdef([ERR404],
[<html>
<head><title>Custom Not Found Error</title></head>
<body>
<p>The requested resource is not found on that server.</p>
<p>This custom error page was supplied using the ErrorFile directive.</p>
</body>])
AT_DATA([404.html],[ERR404
])
PT_CHECK([ListenHTTP
ErrorFile 404 "404.html"
Service
Error 404
End
End
],
[GET /foo/bar
end
404
ERR404
end
])
PT_CHECK([ListenHTTP
Service
Error 404 "404.html"
End
End
],
[GET /foo/bar
end
404
ERR404
end
])
m4_popdef([ERR404])
AT_CLEANUP