@@ -11,22 +11,40 @@ ${PORT} 55353
1111
1212
1313*** Settings ***
14- Test Setup Start Proxy
1514Test Teardown Stop Proxy
1615
1716
1817*** Keywords ***
18+ Common Test Setup
19+ Set Test Variable &{expected_logs } loop destroyed=1 # last log line
20+ Set Test Variable @{error_logs } [F] # any fatal error
21+
1922Start Proxy
2023 [Arguments] @{args }
2124 @{default_args } = Create List -v -v -v -4 -p ${PORT }
2225 @{proces_args } = Combine Lists ${default_args } ${args }
2326 ${proxy } = Start Process ${BINARY_PATH } @{proces_args }
24- # ... stdout=${TEMPDIR}/https_dns_proxy_robot_test_stdout.txt
2527 ... stderr=STDOUT alias=proxy
2628 Set Test Variable ${proxy }
27- Set Test Variable &{ expected_logs } loop destroyed=1 # last log line
28- Set Test Variable @{ error_logs } [F] # any fatal error
29+ Set Test Variable ${ dig_timeout } 2
30+ Set Test Variable ${ dig_retry } 0
2931 Sleep 0.5
32+ Common Test Setup
33+
34+ Start Proxy With Valgrind
35+ [Arguments] @{args }
36+ @{default_args } = Create List --track-fds=yes --time-stamp=yes --log-file=valgrind-%p.log
37+ ... --gen-suppressions=all --tool=memcheck --leak-check=full --leak-resolution=high
38+ ... --show-leak-kinds=all --track-origins=yes --keep-stacktraces=alloc-and-free
39+ ... ${BINARY_PATH } -v -v -v -4 -p ${PORT }
40+ @{proces_args } = Combine Lists ${default_args } ${args }
41+ ${proxy } = Start Process valgrind @{proces_args }
42+ ... stderr=STDOUT alias=proxy
43+ Set Test Variable ${proxy }
44+ Set Test Variable ${dig_timeout } 4
45+ Set Test Variable ${dig_retry } 2
46+ Sleep 3 # wait for valgrind to fire up the proxy
47+ Common Test Setup
3048
3149Stop Proxy
3250 Send Signal To Process SIGINT ${proxy }
@@ -44,7 +62,7 @@ Stop Proxy
4462
4563Start Dig
4664 [Arguments] ${domain } =google.com
47- ${handle } = Start Process dig +timeout\=2 +retry\=0 @127.0.0.1 -p ${PORT } ${domain }
65+ ${handle } = Start Process dig +timeout\=${ dig_timeout } +retry\=${ dig_retry } @127.0.0.1 -p ${PORT } ${domain }
4866 ... stderr=STDOUT alias=dig
4967 [Return] ${handle }
5068
@@ -60,26 +78,31 @@ Run Dig
6078 ${handle } = Start Dig ${domain }
6179 Stop Dig ${handle }
6280
81+ Run Dig Parallel
82+ ${dig_handles } = Create List
83+ FOR ${domain } IN facebook.com microsoft.com youtube.com maps.google.com wikipedia.org amazon.com
84+ ${handle } = Start Dig ${domain }
85+ Append To List ${dig_handles } ${handle }
86+ END
87+ FOR ${handle } IN @{dig_handles }
88+ Stop Dig ${handle }
89+ END
6390
64- *** Test Cases ***
65- Simple smoke test
66- Run Dig
6791
92+ *** Test Cases ***
6893Handle Unbound Server Does Not Support HTTP/1.1
69- [Setup] NONE
7094 Start Proxy -x -r https://doh.mullvad.net/dns-query # resolver uses Unbound
7195 Run Keyword And Expect Error 9 != 0 # timeout exit code
7296 ... Run Dig
7397
7498Reuse HTTP/2 Connection
7599 [Documentation] After first successful request, further requests should not open new connections
76- Run Dig # opens first connection
77- ${dig_handles } = Create List
78- FOR ${domain } IN facebook.com microsoft.com youtube.com maps.google.com wikipedia.org amazon.com
79- ${handle } = Start Dig ${domain }
80- Append To List ${dig_handles } ${handle }
81- END
82- FOR ${handle } IN @{dig_handles }
83- Stop Dig ${handle }
84- END
100+ Start Proxy
101+ Run Dig # Simple smoke test and opens first connection
102+ Run Dig Parallel
85103 Set To Dictionary ${expected_logs } curl opened socket=1 # curl must not open more sockets then 1
104+
105+ Valgrind Resource Leak Check
106+ Start Proxy With Valgrind
107+ Run Dig Parallel
108+
0 commit comments