Skip to content

Commit

Permalink
reworked JS challenge tests. The main motivation - old tests checked …
Browse files Browse the repository at this point in the history
…Js challenge inside vhost, but did not explain the work process.

`JSChallengeVhost` and `JSChallengeDefVhostInherit` removed because it is duplicate for `VhostCookies` and `CookiesInherit` from `sessions.test_cookies`

New tests:
- a bad first request (`POST` method or invalid `Accept` header);
- second request  is not equal first;
- the number of invalid requests is greater than `max_misses`;
- block after Tempesta restart;
- block after connection restart;
- resp_code;
  • Loading branch information
RomanBelozerov committed Dec 5, 2023
1 parent ac49763 commit 80e5c94
Show file tree
Hide file tree
Showing 2 changed files with 313 additions and 696 deletions.
4 changes: 4 additions & 0 deletions framework/deproxy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ def make_requests(self, requests: list or str, pipelined=False) -> None:
for request in requests:
self.__check_request(request)

requests = [
request if isinstance(request, str) else request.msg for request in requests
]

if pipelined:
self._add_to_request_buffers("".join(requests))
self.valid_req_num += len(requests)
Expand Down
Loading

0 comments on commit 80e5c94

Please sign in to comment.