Before this patch servers were loading the original data source file
(from `tests/data/test*`) if they failed to open the preprocessed data
file.
It was causing issues in many (most?) tests, because original data files
are not preprocessed, thus may be incomplete and/or come with wrong
newline characters. It's also causing difficult to diagnose issues when
a test accidentally references another test's data, which by chance
makes the test pass initially, until either that or the executed test
data gets an update, and breaking it, as seen in #19329.
Historically, the fallback existed first, then the preprocessed copy.
The fallback is no longer used by tests (except by stray accidents).
Fix it by dropping the fallback logic and relying on the preprocessed
data file saved there by the runtests framework.
Also fix two remaining test data cross-references:
- test1565: reference own server input data instead of test1's.
- test3014: reference own server input data instead of test1439's.
Ref: #19398
Follow-up to
aaf9522a2c28e5142c7f5640da4e24b65b47dc53 #19329
Closes #19429
wakeup from another thread
</name>
<command>
-http://%HOSTIP:%HTTPPORT/1
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER
</command>
</client>
Check if %{num_headers} returns correct number of headers
</name>
<command>
-http://%HOSTIP:%HTTPPORT/1439 --write-out '%{num_headers}'
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER --write-out '%{num_headers}'
</command>
</client>
4
</stdout>
<protocol crlf="headers">
-GET /1439 HTTP/1.1
+GET /%TESTNUMBER HTTP/1.1
Host: %HOSTIP:%HTTPPORT
User-Agent: curl/%VERSION
Accept: */*
/* first try the alternative, preprocessed, file */
snprintf(filename, sizeof(filename), "%s/test%ld", logdir2, testno);
stream = fopen(filename, "rb");
- if(stream)
- return stream;
-
- /* then try the source version */
- snprintf(filename, sizeof(filename), "%s/data/test%ld", srcpath, testno);
- stream = fopen(filename, "rb");
return stream;
}