Opened 11 years ago
Closed 11 years ago
#529 closed defect (fixed)
systemtests for server errors with wget
Reported by: | Piero Campalani | Owned by: | Piero Campalani |
---|---|---|---|
Priority: | minor | Milestone: | Future |
Component: | systemtest | Version: | development |
Keywords: | wget http 500 | Cc: | Dimitar Misev, Peter Baumann, abeccati |
Complexity: | Easy |
Description
wget
, which is used to fetch the responses in the systemtests (see run_test()
in ./systemtest/util/common.sh
), does not seem capable of fetching the response content in case of 500 HTTP exit code. See http://stackoverflow.com/questions/6083102/http-500-error-in-wget.
This way, it won't be possible to test error conditions like it is done by WCS tests 21 and 22:
21-get_coverage_jp2_irregular_axis.kvp 22-get_coverage_tiff_irregular_axis.kvp
..since the response stored in output/
will be empty and will not match the oracle which instead contains the exception message.
curl
might be considered as alternative, although it must be added in the installation requirements of rasdaman
.
Change History (10)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
I think wget would get the error code though, in that case we could test if it's 500?
comment:4 by , 11 years ago
Ok let's make it like that. I suggest the oracle would have the expected code in it (500) and extension .oracle.code instead of just .oracle, what do you think?
comment:5 by , 11 years ago
Or why not using a .sh
companion which extracts the exit code and put it in the output/ test, instead of adding again an other suffix?
comment:6 by , 11 years ago
Not sure if it will be possible to get the code, because the custom check script is called only for verifying the result against the oracle, you can't use it to make the request itself.
comment:8 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I will prepend a .error
to the suffix of a query which is meant to raise an exception, so that it will be easy to recognize error-prone tests in queries/ as well, e.g.:
--- queries/21-get_coverage_jp2_irregular_axis.kvp +++ queries/21-get_coverage_jp2_irregular_axis.error.kvp
The test engine will test the exit code of wget
to be 8 in this case.
comment:9 by , 11 years ago
Status: | assigned → accepted |
---|
comment:10 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Fixed in changeset:441d48d (..and changeset:3d3a588).
Wiki updated: Adding Tests.
According to: http://savannah.gnu.org/bugs/?27303#comment4, it should be possible in the next release of
wget
.