tests: add -q as first option when invoking curl for tests

To reduce the risk that the user running the tests has a .curlrc present
that messes things up.

Support 'option="no-q"' for the <command> tag to switch it off on demand.
Use this new feature in test 433 and 436.

Ref: #13284
Closes #13387
This commit is contained in:
Daniel Stenberg 2024-04-16 14:18:55 +02:00
parent d28f74913c
commit f7cc9e9177
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
4 changed files with 9 additions and 3 deletions

View File

@ -531,7 +531,7 @@ command has been run.
If the variable name has no assignment, no `=`, then that variable is just
deleted.
### `<command [option="no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
### `<command [option="no-q/no-output/no-include/force-output/binary-trace"] [timeout="secs"][delay="secs"][type="perl/shell"]>`
Command line to run.
Note that the URL that gets passed to the server actually controls what data
@ -562,6 +562,9 @@ otherwise written to verify stdout.
Set `option="no-include"` to prevent the test script to slap on the
`--include` argument.
Set `option="no-q"` avoid using `-q` as the first argument in the curl command
line.
Set `option="binary-trace"` to use `--trace` instead of `--trace-ascii` for
tracing. Suitable for binary-oriented protocols such as MQTT.

View File

@ -36,7 +36,7 @@ CURL_HOME=
<name>
Verify XDG_CONFIG_HOME use to find .curlrc
</name>
<command>
<command option="no-q">
%HOSTIP:%HTTPPORT/%TESTNUMBER
</command>
</client>

View File

@ -35,7 +35,7 @@ XDG_CONFIG_HOME=
<name>
Find .curlrc in .config/curlrc via CURL_HOME
</name>
<command>
<command option="no-q">
%HOSTIP:%HTTPPORT/%TESTNUMBER
</command>
</client>

View File

@ -920,6 +920,9 @@ sub singletest_run {
if(!$tool) {
$CMDLINE=shell_quote($CURL);
if($cmdhash{'option'} !~ /no-q/) {
$CMDLINE .= " -q";
}
}
if(use_valgrind() && !$disablevalgrind) {