[testinfra] Add port into curl's --resolve arg.
The curl manpage explains that port isn't optional: --resolve <[+]host:port:addr[,addr]...> Provide a custom address for a specific host and port pair. Us‐ ing this, you can make the curl requests(s) use a specified ad‐ dress and prevent the otherwise normally resolved address to be used. Consider it a sort of /etc/hosts alternative provided on the command line. The port number should be the number used for the specific protocol the host will be used for. It means you need several entries if you want to provide address for the same host but different ports. Change-Id: I40117768bbc149678a69905a8f6ecd3519301ce1
This commit is contained in:
parent
5b837c1799
commit
92d2bb7f6b
@ -25,7 +25,7 @@ def test_apache(host):
|
||||
|
||||
def _run_cmd(host, port, scheme='https', url='', curl_opt=''):
|
||||
hostname = host.backend.get_hostname()
|
||||
return f'curl {curl_opt} --resolve {hostname}:127.0.0.1 {scheme}://{hostname}:{port}{url}'
|
||||
return f'curl {curl_opt} --resolve {hostname}:{port}:127.0.0.1 {scheme}://{hostname}:{port}{url}'
|
||||
|
||||
def test_base_mirror(host):
|
||||
# base mirror
|
||||
|
Loading…
Reference in New Issue
Block a user