1
0
mirror of https://github.com/graygnuorg/pound.git synced 2026-10-23 22:28:53 +03:00
Files
pound/tests/nb.at
Sergey Poznyakoff d0cc07a157 Rewrite configuration parser
Instead of direct-descent, use LALR(1) parser, assisted by
a table-driven context-dependent token recognizer.

* configure.ac: Detect bison and flex.
* src/.gitignore: Add generated files.
* src/Makefile.am: Add generated files.
* src/cctype.h: Enclose in #ifdef protection.
* src/mem.h: Likewise.
* src/cfg-gram.y: New file.
* src/cfg-lex.l: New file.
* src/cfgdef.c: New file.
* src/cfgdef.h: New file.
* src/cfgparser.c: Remove.
* src/cfgparser.h: Remove.
* src/config.c: Rewrite.
* src/extern.h (FEATURE_DEPRECATED): New feature.
* src/list.h (DLIST_CONCAT): New macro.
* src/pndlua.c: Rewrite configuration support.
* src/pound.c: Likewise.
* src/pound.h: Likewise.
* src/poundctl.c: Likewise.
* src/pound-mode.el: Minor change.
* tests/bemix.at: Update expected output.
* tests/checkurl.at: Likewise.
* tests/config.at: Likewise.
* tests/lstset.at: Likewise.
* tests/set.at: Likewise.
* tests/lua-service.at: Remove the out-of-place flag.
2026-06-02 10:19:02 +03:00

104 lines
1.7 KiB
Plaintext

# This file is part of pound testsuite. -*- autotest -*-
# Copyright (C) 2023-2026 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([Named backends])
AT_KEYWORDS([backend nb usebackend UseBackend])
PT_CHECK(
[ListenHTTP
Service
Host "example.org"
UseBackend "test"
End
Service
Host "example.com"
UseBackend "test"
End
End
Backend "test"
Address
Port
End
],
[GET /echo/foo
Host: example.org
end
200
x-backend-number: 0
end
GET /echo/foo
Host: example.com
end
200
x-backend-number: 0
end
])
PT_CHECK(
[# Test alternative form of referencing the named backend
ListenHTTP
Service
Host "example.org"
Backend
Use "test"
End
End
Service
Host "example.com"
Backend
Use "test"
End
End
End
Backend "test"
Address
Port
End
],
[GET /echo/foo
Host: example.org
end
200
x-backend-number: 0
end
GET /echo/foo
Host: example.com
end
200
x-backend-number: 0
end
])
PT_CONF([# Only a limited subset of directives can be used in backend references.
Service
Backend
Port 8080
Use "test"
End
End
Backend "test"
End],
[1],
[],
[pound: pound.cfg:4.17-25: statement cannot be used in backend reference
])
AT_CLEANUP