From f7cc9e91773537ccd356ff4b3bbb11b1efa115d8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 16 Apr 2024 14:18:55 +0200 Subject: [PATCH] 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 tag to switch it off on demand. Use this new feature in test 433 and 436. Ref: #13284 Closes #13387 --- tests/FILEFORMAT.md | 5 ++++- tests/data/test433 | 2 +- tests/data/test436 | 2 +- tests/runner.pm | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/FILEFORMAT.md b/tests/FILEFORMAT.md index b594fc1130..d4dd85b5ef 100644 --- a/tests/FILEFORMAT.md +++ b/tests/FILEFORMAT.md @@ -531,7 +531,7 @@ command has been run. If the variable name has no assignment, no `=`, then that variable is just deleted. -### `` +### `` 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. diff --git a/tests/data/test433 b/tests/data/test433 index e86f3deaeb..f6505d0328 100644 --- a/tests/data/test433 +++ b/tests/data/test433 @@ -36,7 +36,7 @@ CURL_HOME= Verify XDG_CONFIG_HOME use to find .curlrc - + %HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test436 b/tests/data/test436 index d435b5110d..762ab3f91f 100644 --- a/tests/data/test436 +++ b/tests/data/test436 @@ -35,7 +35,7 @@ XDG_CONFIG_HOME= Find .curlrc in .config/curlrc via CURL_HOME - + %HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/runner.pm b/tests/runner.pm index 645905e5f6..d02d40b7b4 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -920,6 +920,9 @@ sub singletest_run { if(!$tool) { $CMDLINE=shell_quote($CURL); + if($cmdhash{'option'} !~ /no-q/) { + $CMDLINE .= " -q"; + } } if(use_valgrind() && !$disablevalgrind) {