summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-05-01 20:21:55 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-05-02 21:57:20 +0200
commit213fe4786c22d88fe567f351402d09087605606e (patch)
treea34c4e2cbcd40bdaa279254488b809e8cb163941
parent4317031296d3c13925c9309db98a96a2a660372a (diff)
(test) Network: reuse stream numbers after closing
-rw-r--r--network.test32
1 files changed, 32 insertions, 0 deletions
diff --git a/network.test b/network.test
index 3df7376..93f9743 100644
--- a/network.test
+++ b/network.test
@@ -135,8 +135,10 @@ test LargeData:
for i in [0..10]:
with p1:
+ # Create blob with (i * 1000) bytes
send "store blob"
for j in [1 .. i * 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
@@ -144,3 +146,33 @@ test LargeData:
send "test-message-send 1 $ref"
expect /test-message-send done/
expect /test-message-received blob ${i*1000} $ref/ from p2
+
+
+test ManyStreams:
+ 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/
+
+ for i in [0..100]:
+ with p1:
+ # Create blob with 1000 bytes + decimal i
+ send "store blob"
+ for j in [1 .. 10]:
+ # 100 bytes each line
+ send "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+ send "$i"
+ send ""
+ expect /store-done (blake2#[0-9a-f]*)/ capture ref
+
+ send "test-message-send 1 $ref"
+ expect /test-message-send done/
+ expect /test-message-received blob 100[2-4] $ref/ from p2