Commit 87885aaa authored by alex's avatar alex
Browse files

Merge branch 'streams' into 'master'

HTTP/2 streams

Closes #26 and #8

See merge request bortzmeyer/homer!11
parents 40322ce6 c527f2f4
......@@ -59,6 +59,10 @@ Possible options, besides `--dot`:
* --key KEYINBASE64: authentifies a DoT resolver with its public
key. Example: `homer.py --key "62lKu9HsDVbyiPenApnc4sfmSYTHOVfFgL3pyB+cBL4=" --dot 145.100.185.15 IN NS`
* --check: Run a set of tests (see below)
* --multistreams: (DoH) Uses HTTP/2 streams (requires the --file option)
* --file INPUT_FILE: provide an input file with a list of domain name to query
(read the first line only, use --repeat N to read up to N lines of the file)
* --repeat N: repeat a test N times or read up to N lines of a file
### Check
......@@ -124,6 +128,50 @@ When repeating tests, you can add a delay between tests, with `--delay
N` or `-d N`, where N is the (possibly fractional) number of seconds
to wait.
### Mulitstreams
When using Homer with DoH, the option `--multistreams` can be used
to specify that you want to take advantage of the HTTP/2 streams
when sending several requests.
This option requires an input file provided with the `--file` option.
By default only the first line of the file is read. You need to
specify a number of line with `--repeat` to read more lines from
the file.
For example :
```
% ./homer.py --multistreams --file input_file --repeat 5 https://doh.powerdns.org
```
In order to focus on the time per request, you can suppress the
output by using the option `--no-display-results`.
This option only works with `--multistreams`.
Two modes are available. By default each response is read,
checked and displayed as soon as it is received.
You can use `--sync` to delay this processing after the last transfer.
In that case the DNS responses are displayed in the same order as they
were sent.
An option `--time` allows to display the time taken by each transfer.
This is based on [libcurl time values](https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#TIMES)
[CURLINFO_TOTAL_TIME](https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#CURLINFOTOTALTIME)
and [CURLINFO_PRETRANSFER_TIME](https://curl.haxx.se/libcurl/c/curl_easy_getinfo.html#CURLINFOPRETRANSFERTIME)
```
% ./homer.py --multistreams --file input_file --repeat 5 --no-display-results --time https://doh.powerdns.org
0 36.165 ms 44.773 ms 8.608 ms
1 0.142 ms 8.580 ms 8.438 ms
3 0.095 ms 9.223 ms 9.128 ms
2 0.103 ms 10.282 ms 10.179 ms
4 0.104 ms 10.068 ms 9.964 ms
Total elapsed time: 0.07 seconds (9.26 ms/request)
OK
```
### Monitoring with Nagios, Icinga, or similar software
If the program is named `check_doh` or ` check_dot` (either from
......
This diff is collapsed.
www.afnic.fr
framagit.org
tools.ietf.org
docs.python.org
curl.haxx.se
......@@ -6,6 +6,7 @@ config:
- "doh: test specific to DoH"
- "monitoring: test using monitoring"
- "exception: test raising an exception"
- "streams: test multistreams with DoH"
- "check: test related to the compliance option --check"
- "forceIPv4: test using the option -4"
- "forceIPv6: test using the option -6"
......@@ -965,3 +966,119 @@ tests:
retcode: 0
stderr: ''
partstdout: 'HEAD'
- exe : './homer.py'
name: '[doh] Multistreams with DoT (error)'
markers:
- 'doh'
- 'streams'
- 'exception'
args:
- '--multistreams'
- '--dot'
- 'dot.bortzmeyer.fr'
- 'framagit.org'
retcode: 1
partstderr: 'Multi-streams makes no sense for DoT'
stdout: ''
- exe : './homer.py'
name: '[doh] Multistreams without input file (error)'
markers:
- 'doh'
- 'streams'
- 'exception'
args:
- '--multistreams'
- 'dot.bortzmeyer.fr'
- 'framagit.org'
retcode: 1
partstderr: 'Multi-streams requires an input file'
stdout: ''
- exe : './homer.py'
name: '[doh] Multistreams too many arguments (error)'
markers:
- 'doh'
- 'streams'
- 'exception'
args:
- '--multistreams'
- '--file'
- 'input_file'
- 'dot.bortzmeyer.fr'
- 'framagit.org'
retcode: 1
partstderr: 'Wrong number of arguments'
stdout: ''
- exe : './homer.py'
name: '[doh] Multistreams invalid URL'
markers:
- 'doh'
- 'streams'
- 'exception'
args:
- '--multistreams'
- '--file'
- 'input_file'
- 'dot.bortzmeyer.fr'
retcode: 1
partstderr: 'DoH requires a valid'
stdout: ''
- exe : './homer.py'
name: '[doh] Multistreams with 1 request'
markers:
- 'doh'
- 'streams'
args:
- '--multistreams'
- '--file'
- 'input_file'
- 'https://doh.bortzmeyer.fr'
retcode: 0
stderr: ''
partstdout: 'NOERR'
# This test might fail
# this is due to the fact that it will check that libcurl
# uses HTTP/2 streams or sometimes the connection is
# available very quickly making unnecessary to use
# different streams
- exe : './homer.py'
name: '[doh] Multistreams with 3 requests (can fail)'
markers:
- 'doh'
- 'streams'
- 'xfail'
args:
- '-v'
- '--multistreams'
- '--file'
- 'input_file'
- '--repeat'
- '3'
- 'https://doh.powerdns.org'
retcode: 0
partstderr: 'Multiplexed connection found'
partstdout: 'Return code 200'
# same as previous test
- exe : './homer.py'
name: '[doh] Multistreams with 5 requests'
markers:
- 'doh'
- 'streams'
- 'xfail'
args:
- '-v'
- '--multistreams'
- '--file'
- 'input_file'
- '--repeat'
- '5'
- 'https://doh.bortzmeyer.fr'
retcode: 0
partstderr: 'Multiplexed connection found'
partstdout: 'Return code 200'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment