return request.param
+@pytest.fixture(params=[
+ True,
+ False
+])
+def single_buffer(request): # whether to send all data in a single buffer
+ return request.param
+
+
+@pytest.fixture(params=[
+ True,
+ False
+])
+def query_before(request): # whether to send an initial query
+ return request.param
+
+
@pytest.mark.optionalhook
def pytest_metadata(metadata): # filter potentially sensitive data from GitLab CI
keys_to_delete = []
import utils
-@pytest.fixture(params=[
- True,
- False
-])
-def single_buffer(request): # whether to send all data in a single buffer
- return request.param
-
-
-@pytest.fixture(params=[
- True,
- False
-])
-def query_before(request): # whether to send an initial query
- return request.param
-
-
@pytest.mark.parametrize('garbage_lengths', [
(1,),
(1024,),
send_invalid_repeatedly(kresd_sock, invalid_buff)
-def test_trailing_garbage(kresd_sock):
+@pytest.mark.parametrize('glength', [
+ 0,
+ 1,
+ 8,
+ 1024,
+ 4096,
+ 20000,
+])
+def test_prefix_trailing_garbage(kresd_sock, glength, query_before):
"""Send messages with trailing garbage (its length included in prefix)."""
+ if query_before:
+ utils.ping_alive(kresd_sock)
+
for _ in range(10):
wire, msgid = utils.prepare_wire()
- wire += utils.get_garbage(8)
+ wire += utils.get_garbage(glength)
buff = utils.prepare_buffer(wire)
kresd_sock.sendall(buff)