Commit Graph

64 Commits

Author SHA1 Message Date
Nicholas Nethercote
49664d6afc tests: fix formatting errors in FILEFORMAT.md.
Without the surrounding backticks, these tags get swallowed when the
markdown is rendered.

Closes #11777
2023-08-31 16:50:44 -07:00
Daniel Stenberg
3d089c41ea
tests: add support for nested %if conditions
Provides more flexiblity to test cases.

Also warn and bail out if there is an '%else' or %endif' without a
preceeding '%if'.

Ref: #11610
Closes #11728
2023-08-25 08:25:25 +02:00
Dan Fandrich
66883a89d6 tests: add delay command to the HTTP server
This adds a delay after client connect.
2023-08-22 15:32:16 -07:00
Daniel Stenberg
1c3fcbdaa9
tests: add 'large-time' as a testable feature
This allows test cases to require this feature to run and to be used in
%if conditions.

Large here means larger than 32 bits. Ie does not suffer from y2038.

Closes #11696
2023-08-19 23:37:02 +02:00
Viktor Szakats
db70846e2e
tests: ensure libcurl.def contains all exports
Add `test1279` to verify that `libcurl.def` lists all exported API
functions found in libcurl headers.

Also:

- extend test suite XML `stdout` tag with the `loadfile` attribute.

- fix `tests/extern-scan.pl` and `test1135` to include websocket API.

- use all headers (sorted) in `test1135` instead of a manual list.

- add options `--sort`, `--heading=` to `tests/extern-scan.pl`.

- add `libcurl.def` to the auto-labeler GHA task.

Follow-up to 2ebc74c36a

Closes #11570
2023-08-03 11:07:47 +00:00
Daniel Stenberg
7c8bae0d9c
nss: remove support for this TLS library
Closes #11459
2023-07-29 23:44:28 +02:00
Dan Fandrich
89ede3953b runtests: move the UNIX sockets into $PIDDIR
These were missed when the other server files were moved there.

Follow-up to 70d2fca2

Ref: #10818
2023-04-11 14:55:31 -07:00
Dan Fandrich
e7a021e135 tests: use %LOGDIR to refer to the log directory
This will allow it be set dynamically.

Ref: #10818
2023-03-30 09:53:57 -07:00
Dan Fandrich
dfeda77573 tests: document that the unittest keyword is special
Also, add other features that were missing.
2023-03-30 09:12:52 -07:00
Daniel Stenberg
2bc1d775f5
copyright: update all copyright lines and remove year ranges
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205
2023-01-03 09:19:21 +01:00
Daniel Stenberg
d9ee0e47c1
runtests: make 'mbedtls' a testable feature
Also add to FILEFORMAT.md
2022-12-27 22:41:19 +01:00
Daniel Stenberg
dc0725244a
runtests: support crlf="yes" for verify/proxy 2022-12-27 15:22:32 +01:00
Daniel Stenberg
2f34a7347f
runtests: do CRLF replacements per section only
The `crlf="yes"` attribute and "hyper mode" are now only applied on a
subset of dedicated sections: data, datacheck, stdout and protocol.

Updated test 2500 accordingly.

Also made test1 use crlf="yes" for <protocol>, mostly because it is
often used as a template test case. Going forward, using this attribute
we should be able to write test cases using linefeeds only and avoid
mixed line ending encodings.

Follow-up to ca15b7512e

Fixes #10009
Closes #10010
2022-12-01 15:04:23 +01:00
fractal-access
383fb29da1
test416: verify growing FTP file support
Added setting: RETRSIZE [size] in the <servercmd> section. When set this
will cause the test FTP server to return the size set (rather than the
actual size) in the acknowledgement from a RETR request.

Closes #9772
2022-11-26 17:06:28 +01:00
Ayesh Karunaratne
4484270afc
misc: typo and grammar fixes
- Replace `Github` with `GitHub`.
- Replace `windows` with `Windows`
- Replace `advice` with `advise` where a verb is used.
- A few fixes on removing repeated words.
- Replace `a HTTP` with `an HTTP`

Closes #9802
2022-10-27 10:01:30 +02:00
Daniel Stenberg
f5e5384ec3
test644: verify --xattr (with redirect) 2022-10-22 23:56:38 +02:00
Dan Fandrich
98aa994868 docs: document more server names for test files 2022-09-28 13:24:26 -07:00
Daniel Stenberg
fd1ce3d4b0
docs: spellfixes
Pointed by the new CI job
2022-09-21 15:20:08 +02:00
Daniel Stenberg
fda897f5a1
docs: fix proselint complaints 2022-09-19 17:32:12 +02:00
Daniel Stenberg
2b7f7d04f7
reuse/dep5: adjusted to parse better
... adjusted a few files to contain copyright and license info.

Closes #9006
2022-06-14 14:07:02 +02:00
Balakrishnan Balasubramanian
dfa84a0450
socks: support unix sockets for socks proxy
Usage:
  curl -x "socks5h://localhost/run/tor/socks" "https://example.com"

Updated runtests.pl to run a socksd server listening on unix socket

Added tests test1467 test1468

Added documentation for proxy command line option and socks proxy
options

Closes #8668
2022-05-19 15:35:03 +02:00
Fabian Keil
fc3a0a872f
tests/server/sws.c: change the HTTP writedelay unit to milliseconds
This allows to use write delays for large responses without
resulting in the test taking an unreasonable amount of time.

In many cases delaying writes by a whole second or more isn't
necessary for the desired effect.

Closes #8827
2022-05-11 11:14:18 +02:00
Daniel Stenberg
25d7b5f39a
tests/FILEFORMAT.md: spellfix 2022-04-21 17:01:45 +02:00
Daniel Stenberg
71a0e053e9
runtests: add 'bearssl' as testable feature
Closes #8684
2022-04-07 08:36:27 +02:00
Daniel Stenberg
7e145dd270
hyper: no h2c support
Make tests require h2c feature present to run, and only set h2c if
nghttp2 is used in the build. Hyper does not support it.

Remove those tests from DISABLED

Fixes #8605
Closes #8613
2022-03-20 16:45:08 +01:00
Paul Howarth
4b01a57c95
runtests: make 'oldlibssh' be before 0.9.4
The 'oldlibssh' feature indicates that the error code returned by libssh
for a broken known_hosts file should be 67 rather than 60 (test1459).
This feature was added as part of #8444 with 'oldlibssh' mapping to
libssh versions prior to 0.9.6, and then refined as part of #8511 to map
to versions prior to 0.9.5.

In Red Hat Enterprise Linux 8.5 there is a patched version of libssh
version 0.9.4 (https://git.centos.org/rpms/libssh/blob/c8/f/SOURCES) in
which test1459 fails because it returns the "new" value rather than the
"old" one. It's plausible that one of the patches is responsible for
this rather than the underlying code but I don't think so.

This change therefore drops the 'oldlibssh' version check to map to
libssh versions older than 0.9.4, which fixes builds on RHEL-8.

Closes #8548
2022-03-07 08:59:03 +01:00
Daniel Stenberg
7c140f6b2d
runtests: set 'oldlibssh' for libssh versions before 0.9.6
... and make test 1459 check for the different return code then.

Closes #8444
2022-02-14 08:26:44 +01:00
Fabian Keil
736847611a
runtests.pl: support the nonewline attribute for the data part
Added to FILEFORMAT

Closes #8239
2022-01-10 15:54:54 +01:00
Daniel Stenberg
cfb4f8b626
runtests: make 'wolfssl' a testable feature
Closes #8252
2022-01-09 18:08:14 +01:00
Daniel Stenberg
1fefa1a856
runtests: make 'rustls' a testable feature 2022-01-09 16:06:19 +01:00
Fabian Keil
8742729827
tests/FILEFORMAT.md: fix typo 2022-01-07 10:01:44 +01:00
Daniel Stenberg
d2f712ddd0
runtests: add verify/socks check
If used, this data is compared with the data in log/socksd-request.log
which the socksd server logs.

Added to FILEFORMAT.md
2022-01-03 22:32:05 +01:00
Daniel Stenberg
f4cafa4f0d
runtests: make the SSH library a testable feature
libssh2, libssh and wolfssh
2021-11-14 16:13:44 +01:00
Mats Lindestam
d1e7d9197b
libssh2: add SHA256 fingerprint support
Added support for SHA256 fingerprint in command line curl and in
libcurl.

Closes #7646
2021-09-26 23:20:53 +02:00
Daniel Stenberg
265b14d6b3
metalink: remove
Warning: this will make existing curl command lines that use metalink to
stop working.

Reasons for removal:

1. We've found several security problems and issues involving the
   metalink support in curl. The issues are not detailed here. When
   working on those, it become apparent to the team that several of the
   problems are due to the system design, metalink library API and what
   the metalink RFC says. They are very hard to fix on the curl side
   only.

2. The metalink usage with curl was only very briefly documented and was
   not following the "normal" curl usage pattern in several ways, making
   it surprising and non-intuitive which could lead to further security
   issues.

3. The metalink library was last updated 6 years ago and wasn't so
   active the years before that either. An unmaintained library means
   there's a security problem waiting to happen. This is probably reason
   enough.

4. Metalink requires an XML parsing library, which is complex code (even
   the smaller alternatives) and to this day often gets security
   updates.

5. Metalink is not a widely used curl feature. In the 2020 curl user
   survey, only 1.4% of the responders said that they'd are using it. In
   2021 that number was 1.2%. Searching the web also show very few
   traces of it being used, even with other tools.

6. The torrent format and associated technology clearly won for
   downloading large files from multiple sources in parallel.

Cloes #7176
2021-06-07 08:14:25 +02:00
Daniel Stenberg
b193fd3bbd
runtests: enable 'hyper mode' only for HTTP tests
The 'hyper mode' makes line-ending checks work in the test suite for
when hyper is used. Now it also requires that HTTP or HTTPS are
mentioned as keywords to be enabled so that it doesn't wrongly adjusts
tests for other protocols.

This makes test 271 (TFTP) work again in hyper enabled builds.

Closes #7185
2021-06-03 23:08:47 +02:00
Daniel Stenberg
23e9b96a64
FILEFORMAT: mention sectransp as a feature
Been supported since at least 40259ca65

Closes #7001
2021-05-04 14:45:01 +02:00
Stephan Szabo
1269c80af1 file: Support unicode urls on windows
Closes https://github.com/curl/curl/pull/6501
2021-02-09 02:45:51 -05:00
Fabian Keil
203dc00718
runtests.pl: add %TESTNUMBER variable to make copying tests more convenient 2021-02-09 08:16:40 +01:00
Emil Engler
725ec470e2
language: s/behaviour/behavior/g
We currently use both spellings the british "behaviour" and the american
"behavior". However "behavior" is more used in the project so I think
it's worth dropping the british name.

Closes #6395
2021-01-02 23:35:59 +01:00
Daniel Stenberg
48b85c46f1
runtests: add support for gophers, gopher over TLS 2020-12-15 12:58:19 +01:00
Daniel Stenberg
34bb59a868
runtests: add 'wakeup' as a feature 2020-12-11 17:42:17 +01:00
Daniel Stenberg
e12825c642
runtests: add support for %if [feature] conditions
... to make tests run differently or expect different results depending
on what features that are present or not in curl.

Bonus: initial minor 'Hyper' awareness but nothing is using that yet

Closes #6304
2020-12-11 13:16:02 +01:00
Daniel Stenberg
082422b189 runtests: make 'c-ares' a "feature" to depend on
... also added to the docs.
2020-11-26 17:24:24 +01:00
Daniel Stenberg
2cfc4ed983
hsts: add read/write callbacks
- read/write callback options
- man pages for the 4 new setopts
- test 1915 verifies the callbacks

Closes #5896
2020-11-03 16:08:48 +01:00
Daniel Stenberg
b8e4d1cb0a
runtests: add %repeat[]% for test files
... and use this new keywords in all the test files larger than 50K to reduce
their sizes and make them a lot easier to read and understand.

Closes #6040
2020-10-04 17:16:53 +02:00
Daniel Stenberg
e6b21d422e
runtests: provide curl's version string as %VERSION for tests
... so that we can check HTTP requests for User-Agent: curl/%VERSION

Update 600+ test cases accordingly.

Closes #6037
2020-10-02 22:54:23 +02:00
Daniel Stenberg
2dd53e82f1
runtests: allow generating a binary sequence from hex 2020-10-02 09:35:38 +02:00
Daniel Stenberg
4a4c724599
ftp: make a 552 response return CURLE_REMOTE_DISK_FULL
Added test 348 to verify. Added a 'STOR' command to the test FTP
server to enable test 348. Documented the command in FILEFORMAT.md

Reported-by: Duncan Wilcox
Fixes #6016
Closes #6017
2020-09-26 13:37:15 +02:00
Daniel Stenberg
304aeace1b
tests/FILEFORMAT: document type=shell for <command> 2020-09-15 15:42:56 +02:00