diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-17 20:49:31 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-07-17 20:58:28 +0200 |
commit | 17fe2cf406753f1f7de76dcea835f2b81090107a (patch) | |
tree | a7ca3374a8de659e5886a7219e0ba79eea7ce85e | |
parent | f3f5a8c60b3cd7a6c541f459c1658a60be3334e1 (diff) |
(test) Merge multiple data responses into a single stream
Changelog: Fix sending multiple data responses in a stream
-rw-r--r-- | network.test | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/network.test b/network.test index 9540bf6..efd508f 100644 --- a/network.test +++ b/network.test @@ -178,6 +178,62 @@ test ManyStreams: expect /test-message-received blob 100[2-4] $ref/ from p2 +test MultipleServiceRefs: + spawn as p1 + spawn as p2 + send "create-identity Device1" to p1 + send "create-identity Device2" to p2 + send "start-server" to p1 + send "start-server" to p2 + expect from p1: + /peer 1 addr ${p2.node.ip} 29665/ + /peer 1 id Device2/ + expect from p2: + /peer 1 addr ${p1.node.ip} 29665/ + /peer 1 id Device1/ + + let kbytes = 2 + + with p1: + send "store blob" + send "A" + send "" + expect /store-done (blake2#[0-9a-f]*)/ capture ref_a + + # Create blobs with (kbytes * 1000) bytes each + + send "store blob" + send "B" + for j in [1 .. kbytes * 10]: + # 100 bytes each line + send "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" + send "" + expect /store-done (blake2#[0-9a-f]*)/ capture ref_b + + send "store blob" + send "C" + for j in [1 .. kbytes * 10]: + # 100 bytes each line + send "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" + send "" + expect /store-done (blake2#[0-9a-f]*)/ capture ref_c + + send "store blob" + send "D" + for j in [1 .. kbytes * 10]: + # 100 bytes each line + send "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" + send "" + expect /store-done (blake2#[0-9a-f]*)/ capture ref_d + + send "test-message-send 1 $ref_a $ref_b $ref_c $ref_d" + expect /test-message-send done/ + expect /test-message-received blob [0-9]+ $ref_a/ from p2 + expect /test-message-received blob [0-9]+ $ref_b/ from p2 + expect /test-message-received blob [0-9]+ $ref_c/ from p2 + expect /test-message-received blob [0-9]+ $ref_d/ from p2 + + test Reconnection: spawn as p1 with p1: |