https://github.com/sozu-proxy/proxy-test-suite
https://github.com/sozu-proxy/proxy-test-suite
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sozu-proxy/proxy-test-suite
- Owner: sozu-proxy
- Created: 2018-02-19T14:18:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-20T16:26:53.000Z (over 8 years ago)
- Last Synced: 2025-01-17T18:57:28.943Z (over 1 year ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Proxy test suite
this tool is meant to provide an easy way to test and reproduce proxy bugs.
Every test case must implement the following trait:
```rust
pub trait Check {
fn generate_request(&self) -> Vec;
fn check_request(&self, req: &httparse::Request) -> Result<(), String>;
fn generate_response(&self) -> Vec;
fn check_response(&self, res: &httparse::Response) -> Result<(), String>;
}
```
The trait will allow us to make non standard compliant request and responses.
The tool will:
- set up a HTTP server (right now, hardcoded to address `127.0.0.1:1026`)
- set up a HTTP client
- the client will send the request to the proxy (right now, hardcoded to address `127.0.0.1:8080`)
- the server will parse it with httparse (we're explicitely not using sozu's parser to find behaviour differences)
- the server will verify that the received request matches the one we want (it's expected that the proxy adds or remove some headers)
- the server sends the response
- the client will parse the response with httparse
- the client will verify that the received response matche the one we want
## Planned ideas
- find a nice way to generically write test cases
- execute all of the test cases, or a specific one if we want
- add some random behaviour, that could be fixed with a seed:
- insert spaces in the headers
- reorder the headers
- split the writes to the sockets to test partial parsing or chunking
- split the body in various chunks