Commit graph

45 commits

Author SHA1 Message Date
Andrey Zelenkov
90c5d3f5c0 Tests: adjusted skipping tests. 2019-05-30 16:46:04 +03:00
Andrey Zelenkov
5d15d8449d Tests: read_timeout increased for incomplete requests.
Also fixed test without \"Host\" header.
2019-04-22 18:52:35 +03:00
Andrey Zelenkov
29b4e4431f Tests: speed up tests. 2019-04-09 20:59:35 +03:00
Andrey Zelenkov
549f0873c2 Tests: wait_for_record() introduced. 2019-04-09 16:14:42 +03:00
Andrey Zelenkov
8c7411415a Tests: style. 2019-04-09 16:14:42 +03:00
Andrey Zelenkov
af24e4dec4 Tests: simplified module checking. 2019-04-09 16:14:42 +03:00
Andrey Zelenkov
19eba1730a Tests: unit module refactoring. 2019-03-28 18:43:13 +03:00
Andrey Zelenkov
281899fcef Tests: style. 2019-03-26 23:38:30 +03:00
Andrey Zelenkov
ea844a4444 Tests: skip more alerts. 2019-03-01 18:58:16 +03:00
Valentin Bartenev
a5dd0f8aa9 Made QUERY_STRING mandatory.
According to CGI/1.1 RFC 3875:

   The server MUST set this variable; if the Script-URI does not include a
   query component, the QUERY_STRING MUST be defined as an empty string ("").

Python's PEP 333(3) allows omitting it in WSGI interface; PHP docs force no
requirements; PSGI and Rack specifications require it even if empty.

When nginx proxies requests over FastCGI, it always provides QUERY_STRING.
and some PHP apps have been observed to fail if it is missing (see issue
#201 on GitHub).

A drawback of this change (besides a small overhead) is that there will be
no easy way to tell a missing query string from an empty one (i.e. requests
with or without the "?" character); yet, it's negligible compared to the
possible benefits of wider application compatibility.

This closes #226 issue on GitHub.
2019-02-28 20:20:41 +03:00
Andrey Zelenkov
4de2c8b567 Tests: added "Host" and "Connetion" headers where necessary.
Also minor header organizing.
2019-02-27 19:15:02 +03:00
Andrey Zelenkov
955050aea3 Tests: skip sendmsg()/recvmsg() alerts for all tests.
Currently, these alerts may appear in the log when any application exits.
2019-02-20 20:28:29 +03:00
Andrey Zelenkov
5964413066 Tests: added delay to wait for error logging. 2018-12-25 17:22:32 +03:00
Andrey Zelenkov
f9a3328a25 Tests: more QUERY_STRING tests. 2018-12-24 20:35:18 +03:00
Andrey Zelenkov
eff760bd2b Tests: added command line arguments parsing in tests.
Added the following command line arguments:

  -d, --detailed: Show detailed output for tests

    Usage examples:

    ./test/run.py --detailed
    python3 test/test_access_log.py --detailed
    python3 test/test_access_log.py -d TestUnitAccessLog.test_access_log_ipv6


  -l, --log: Save unit.log after the test execution

    Usage examples:

    ./test/run.py -l
    python3 test/test_access_log.py -l
    python3 test/test_access_log.py --log TestUnitAccessLog.test_access_log_ipv6
2018-11-15 21:26:15 +03:00
Igor Sysoev
b5d4fc939e Disabled chunked transfer encoding for 204 responses. 2018-09-28 17:32:02 +03:00
Valentin Bartenev
510c2e15c5 Python: adjusted input.read(size) argument value interpretation.
Previously, passing 0 resulted in reading the whole body and all negative
values raised an exception.

Now the behaviour is in consistentance with io.RawIOBase.read() interface,
and passing 0 returns empty (byte) string, while -1 results in reading the
whole body.
2018-09-20 16:04:49 +03:00
Andrey Zelenkov
511a0fa760 Tests: used relative path for configuration. 2018-09-06 20:18:33 +03:00
Max Romanov
86740ab34b Introducing app joint to accurate app release.
For accurate app descriptor release, it is required to count the number of
use counts.  Use count increased when:
- app linked to configuration app queue;
- socket conf stores pointer to app;
- request for start app process posted to router service thread;

Application port has pointer to app, but it does not increase use count
to avoid use count loop.

Timer needs a pointer to nxt_timer_t which is stored in engine timers tree.
nxt_timer_t now resides in nxt_app_joint_t and does not lock the application.

Start process port RPC handlers is also linked to nxt_app_joint_t.

App joint (nxt_app_joint_t) is a 'weak pointer':
- single threaded;
- use countable;
- store pointer to nxt_app_t (which can be NULL);

nxt_app_t has pointer to nxt_app_joint_t and update its pointer to app.
2018-08-10 19:27:13 +03:00
Andrey Zelenkov
eee6102a28 Tests: more reconfigure tests. 2018-08-08 15:30:05 +03:00
Andrey Zelenkov
857bddeea6 Tests: added keep-alive with reconfiguration test. 2018-05-30 19:29:40 +03:00
Andrey Zelenkov
7d224bfc9e Tests: added tests for SERVER_SOFTWARE variable. 2018-05-21 16:41:33 +03:00
Andrey Zelenkov
d9f8479375 Tests: response handling improved. 2018-04-26 17:37:24 +03:00
Andrey Zelenkov
a44d358f29 Tests: added test for callable write() in Python. 2018-04-26 17:37:24 +03:00
Andrey Zelenkov
f6c3ef7ed3 Tests: added Python test with not iterable object. 2018-04-05 17:55:06 +03:00
Andrey Zelenkov
a01a98ce36 Tests: more Python tests. 2018-04-02 17:03:41 +03:00
Andrey Zelenkov
efb71121b9 Tests: added Python test with iterator context. 2018-04-02 17:03:41 +03:00
Andrey Zelenkov
2028f3a04b Tests: use "%Z" directive while parsing Date header. 2018-04-02 15:50:05 +03:00
Andrey Zelenkov
c7e67446a3 Tests: Ruby module. 2018-03-21 18:26:40 +03:00
Valentin Bartenev
bebc5845f8 Capitalization in the "Server" field. 2018-03-13 20:32:47 +03:00
Andrey Zelenkov
09f2009df5 Tests: reworked python tests with application. 2018-02-20 20:34:41 +03:00
Andrey Zelenkov
ee39da0e00 Tests: removed unused code in unit.py. 2018-02-14 17:14:16 +03:00
Valentin Bartenev
9646772a00 HTTP: the Date response header. 2018-02-12 16:58:40 +03:00
Andrey Zelenkov
0379f927b3 Tests: simplified test for query string. 2018-02-05 15:39:16 +03:00
Andrey Zelenkov
3faa154223 Tests: adjusted check_version()'s. 2018-02-05 15:39:11 +03:00
Max Romanov
9cd4fdbdb7 Introducing extended app process management.
- Pre-fork 'processes.spare' application processes;
- fork more processes to keep 'processes.spare' idle processes;
- fork on-demand up to 'processes.max' count;
- scale down idle application processes above 'processes.spare' after
  'processes.idle_timeout';
- number of concurrently started application processes also limited by
  'processes.spare' (or 1, if spare is 0).
2018-01-29 16:17:36 +03:00
Andrey Zelenkov
afa0fd9a71 Tests: reworked TestUnitHTTP. 2018-01-30 16:17:01 +03:00
Andrey Zelenkov
9f48f2b3e7 Tests: added methods to manage unit configuration. 2018-01-30 16:16:52 +03:00
Andrey Zelenkov
f115cb7032 Tests: small fixes. 2018-01-30 16:16:42 +03:00
Andrey Zelenkov
17e1a19063 Tests: added test for QUERY_STRING variable. 2018-01-24 15:45:39 +03:00
Andrey Zelenkov
955ba9d7dd Tests: added test with "Transfer-Encoding" header in 204 response. 2018-01-24 15:43:36 +03:00
Andrey Zelenkov
331514fcf7 Tests: using "expectedFailure" decorator instead of assertTry(). 2018-01-24 15:43:04 +03:00
Andrey Zelenkov
a949c2f088 Tests: using LF line ending for test files. 2018-01-17 15:52:01 +03:00
Andrey Zelenkov
819b43fc2d Tests: use "data" parameter in Request() to send body. 2018-01-15 19:59:47 +03:00
Andrey Zelenkov
b217a1e058 Tests: simple python application. 2018-01-15 16:06:26 +03:00