From 9102d59d7a4871cc3d6cbfd847cbb6bb382cc2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 26 Jun 2024 22:40:20 +0200 Subject: (test) Subscribe flag in chatroom state --- chatroom.test | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/chatroom.test b/chatroom.test index ffb7b4d..9be5665 100644 --- a/chatroom.test +++ b/chatroom.test @@ -10,8 +10,8 @@ test ChatroomSetup: send "chatroom-list-local" - expect /chatroom-list-item ([a-z0-9#]+) first/ capture first - expect /chatroom-list-item [a-z0-9#]+ second/ + expect /chatroom-list-item ([a-z0-9#]+) first sub true/ capture first + expect /chatroom-list-item [a-z0-9#]+ second sub true/ local: expect /chatroom-list-(.*)/ capture done guard (done == "done") @@ -34,17 +34,38 @@ test ChatroomSetup: for p in [ p2, p3 ]: with p: - expect /chatroom-watched-added [a-z0-9#]+ first/ - expect /chatroom-watched-added [a-z0-9#]+ second/ + expect /chatroom-watched-added [a-z0-9#]+ first sub false/ + expect /chatroom-watched-added [a-z0-9#]+ second sub false/ + + # Subscribe and unsubscribe + + with p1: + send "chatroom-unsubscribe $first" + expect /chatroom-watched-updated [a-z0-9#]+ first sub false .*/ + + send "chatroom-subscribe $first" + expect /chatroom-watched-updated [a-z0-9#]+ first sub true .*/ with p2: send "chatroom-list-local" - expect /chatroom-list-item [a-z0-9#]+ first/ - expect /chatroom-list-item [a-z0-9#]+ second/ + expect /chatroom-list-item ([a-z0-9#]+) first sub false/ capture p2_first + expect /chatroom-list-item ([a-z0-9#]+) second sub false/ capture p2_second local: expect /chatroom-list-(.*)/ capture done guard (done == "done") + send "chatroom-subscribe $p2_first" + send "chatroom-subscribe $p2_second" + + expect /chatroom-watched-updated [a-z0-9#]+ first sub true .*/ + expect /chatroom-watched-updated [a-z0-9#]+ second sub true .*/ + + send "chatroom-unsubscribe $p2_first" + send "chatroom-unsubscribe $p2_second" + + expect /chatroom-watched-updated [a-z0-9#]+ first sub false .*/ + expect /chatroom-watched-updated [a-z0-9#]+ second sub false .*/ + # Create and sync additional chatrooms send "chatroom-create third" to p1 @@ -56,9 +77,9 @@ test ChatroomSetup: for p in [ p1, p2, p3 ]: with p: - expect /chatroom-watched-added [a-z0-9#]+ third/ - expect /chatroom-watched-added [a-z0-9#]+ fourth/ - expect /chatroom-watched-added [a-z0-9#]+ fifth/ + expect /chatroom-watched-added [a-z0-9#]+ third sub [a-z]+/ + expect /chatroom-watched-added [a-z0-9#]+ fourth sub [a-z]+/ + expect /chatroom-watched-added [a-z0-9#]+ fifth sub [a-z]+/ # Update chatroom name @@ -90,7 +111,7 @@ test ChatroomMessages: for p in [ p1 ]: with p: - expect /chatroom-watched-added $room room/ + expect /chatroom-watched-added [a-z0-9#]+ room sub [a-z]+/ send "chatroom-message-send $room message1" to p1 expect /chatroom-message-new $room from Owner1 text message1/ from p1 -- cgit v1.2.3 From 2d01927baf53599ae12b1f4ef3d973d5b7917d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 29 Jun 2024 22:17:52 +0200 Subject: (test) Storage watching tests with multiple heads and readers --- storage.test | 228 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 228 insertions(+) diff --git a/storage.test b/storage.test index 9bf468e..0369807 100644 --- a/storage.test +++ b/storage.test @@ -153,6 +153,234 @@ test Storage: test StorageWatcher: + spawn as p1 + spawn as p2 on p1.node + + send to p1: + "store rec" + "text:n 1" + "" + expect from p1: + /store-done (blake2#[0-9a-f]*)/ capture r1 + + send to p1: + "store rec" + "text:n 2" + "" + expect from p1: + /store-done (blake2#[0-9a-f]*)/ capture r2 + + send to p1: + "store rec" + "text:n 3" + "" + expect from p1: + /store-done (blake2#[0-9a-f]*)/ capture r3 + + send to p1: + "store rec" + "text:n 4" + "" + expect from p1: + /store-done (blake2#[0-9a-f]*)/ capture r4 + + let tid1 = "00000000-0000-0000-0000-000000000001" + let tid2 = "00000000-0000-0000-0000-000000000002" + + # Watch head from multiple processes + + send "head-create $tid1 $r1" to p1 + expect /head-create-done $tid1 ([0-9a-f-]+)/ from p1 capture hid1 + + send "head-watch $tid1 $hid1" to p1 + send "head-watch $tid1 $hid1" to p2 + + expect /head-watch-done $tid1 $hid1 ([0-9]+)/ from p1 capture w1_1 + expect /head-watch-done $tid1 $hid1 ([0-9]+)/ from p2 capture w2_1 + + local: + expect /head-watch-cb $w1_1 (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r1) + + local: + expect /head-watch-cb $w2_1 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r1) + + send "head-replace $tid1 $hid1 $r2 $r1" to p1 + expect /head-replace-fail $tid1 $hid1 $r2 $r1 $r1/ from p1 + + send "head-replace $tid1 $hid1 $r1 $r2" to p1 + expect /head-replace-done $tid1 $hid1 $r1 $r2/ from p1 + + local: + expect /head-watch-cb $w1_1 (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r2) + + local: + expect /head-watch-cb $w2_1 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r2) + + # Watch distinct heads and head types + + send "head-create $tid1 $r1" to p1 + expect /head-create-done $tid1 ([0-9a-f-]+)/ from p1 capture hid1_2 + + send "head-create $tid2 $r2" to p1 + expect /head-create-done $tid2 ([0-9a-f-]+)/ from p1 capture hid2 + + send "head-watch $tid1 $hid1_2" to p1 + send "head-watch $tid1 $hid1_2" to p2 + send "head-watch $tid2 $hid2" to p1 + send "head-watch $tid2 $hid2" to p2 + + expect /head-watch-done $tid1 $hid1_2 ([0-9]+)/ from p1 capture w1_1_2 + expect /head-watch-done $tid1 $hid1_2 ([0-9]+)/ from p2 capture w2_1_2 + expect /head-watch-done $tid2 $hid2 ([0-9]+)/ from p1 capture w1_2 + expect /head-watch-done $tid2 $hid2 ([0-9]+)/ from p2 capture w2_2 + + local: + expect /head-watch-cb $w1_1_2 (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r1) + + local: + expect /head-watch-cb $w2_1_2 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r1) + + local: + expect /head-watch-cb $w1_2 (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r2) + + local: + expect /head-watch-cb $w2_2 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r2) + + send "head-replace $tid1 $hid1_2 $r1 $r2" to p1 + expect /head-replace-done $tid1 $hid1_2 $r1 $r2/ from p1 + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p1 capture w, new + guard (w == w1_1_2) + guard (new == r2) + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p2 capture w, new + guard (w == w2_1_2) + guard (new == r2) + + send "head-replace $tid2 $hid2 $r2 $r3" to p1 + expect /head-replace-done $tid2 $hid2 $r2 $r3/ from p1 + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p1 capture w, new + guard (w == w1_2) + guard (new == r3) + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p2 capture w, new + guard (w == w2_2) + guard (new == r3) + + # Unwatch head + + send "head-unwatch $w1_1_2" to p1 + expect /head-unwatch-done $w1_1_2/ from p1 + + send "head-unwatch $w1_2" to p1 + expect /head-unwatch-done $w1_2/ from p1 + + send "head-replace $tid2 $hid2 $r3 $r4" to p1 + expect /head-replace-done $tid2 $hid2 $r3 $r4/ from p1 + + send "head-replace $tid1 $hid1_2 $r2 $r1" to p1 + expect /head-replace-done $tid1 $hid1_2 $r2 $r1/ from p1 + + send "head-replace $tid1 $hid1 $r2 $r3" to p1 + expect /head-replace-done $tid1 $hid1 $r2 $r3/ from p1 + + local: + expect /head-watch-cb $w2_2 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r4) + + local: + expect /head-watch-cb $w2_1_2 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r1) + + local: + expect /head-watch-cb $w2_1 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r3) + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p1 capture w, new + guard (w == w1_1) + guard (new == r3) + + # Multiple watchers on the same head + + send "head-watch $tid1 $hid1" to p1 + expect /head-watch-done $tid1 $hid1 ([0-9]+)/ from p1 capture w1_1b + + local: + expect /head-watch-cb $w1_1b (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r3) + + send "head-watch $tid1 $hid1" to p1 + expect /head-watch-done $tid1 $hid1 ([0-9]+)/ from p1 capture w1_1c + + local: + expect /head-watch-cb $w1_1c (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r3) + + send "head-replace $tid1 $hid1 $r3 $r4" to p1 + expect /head-replace-done $tid1 $hid1 $r3 $r4/ from p1 + + local: + expect /head-watch-cb $w1_1 (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r4) + + local: + expect /head-watch-cb $w1_1b (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r4) + + local: + expect /head-watch-cb $w1_1c (blake2#[0-9a-f]+)/ from p1 capture new + guard (new == r4) + + local: + expect /head-watch-cb $w2_1 (blake2#[0-9a-f]+)/ from p2 capture new + guard (new == r4) + + for w in [ w1_1, w1_1c ]: + send "head-unwatch $w" to p1 + expect /head-unwatch-done $w/ from p1 + + send "head-replace $tid1 $hid1 $r4 $r1" to p1 + expect /head-replace-done $tid1 $hid1 $r4 $r1/ from p1 + + send "head-replace $tid1 $hid1 $r1 $r2" to p1 + expect /head-replace-done $tid1 $hid1 $r1 $r2/ from p1 + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p2 capture w, new + guard (w == w2_1) + guard (new == r1) + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p2 capture w, new + guard (w == w2_1) + guard (new == r2) + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p1 capture w, new + guard (w == w1_1b) + guard (new == r1) + + local: + expect /head-watch-cb ([0-9]+) (blake2#[0-9a-f]+)/ from p1 capture w, new + guard (w == w1_1b) + guard (new == r2) + + +test SharedStateWatcher: spawn as p1 spawn as p2 send "create-identity Device1 Owner" to p1 -- cgit v1.2.3 From 888ca65103987bdd745ed11099031fbbec68a485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sun, 30 Jun 2024 23:18:56 +0200 Subject: (test) Chatroom subscriptions --- chatroom.test | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 129 insertions(+), 10 deletions(-) diff --git a/chatroom.test b/chatroom.test index 9be5665..c4cdc6d 100644 --- a/chatroom.test +++ b/chatroom.test @@ -98,25 +98,144 @@ test ChatroomSetup: test ChatroomMessages: spawn as p1 + spawn as p2 send "create-identity Device1 Owner1" to p1 + send "create-identity Device2 Owner2" to p2 - for p in [ p1 ]: + for p in [ p1, p2 ]: with p: send "chatroom-watch-local" send "start-server" - send "chatroom-create room" to p1 - expect /chatroom-create-done ([a-z0-9#]+) room.*/ from p1 capture room + send "chatroom-create first_room" to p1 + expect /chatroom-create-done ([a-z0-9#]+) first_room.*/ from p1 capture room1_p1 - for p in [ p1 ]: - with p: - expect /chatroom-watched-added [a-z0-9#]+ room sub [a-z]+/ + expect /chatroom-watched-added [a-z0-9#]+ first_room sub true/ from p1 + expect /chatroom-watched-added ([a-z0-9#]+) first_room sub false/ from p2 capture room1_p2 - send "chatroom-message-send $room message1" to p1 - expect /chatroom-message-new $room from Owner1 text message1/ from p1 + send "chatroom-message-send $room1_p1 message1" to p1 + expect /chatroom-message-new $room1_p1 room first_room from Owner1 text message1/ from p1 - send "chatroom-message-send $room message2" to p1 + send "chatroom-message-send $room1_p1 message2" to p1 local: - expect /chatroom-message-new $room from Owner1 text (.*)/ from p1 capture msg + expect /chatroom-message-new $room1_p1 room first_room from Owner1 text (.*)/ from p1 capture msg guard (msg == "message2") + + # Subscribe to chatroom + + send "chatroom-subscribe $room1_p2" to p2 + expect /chatroom-watched-updated [a-z0-9#]+ first_room sub true .*/ from p2 + with p2: + expect /chatroom-message-new $room1_p2 room first_room from Owner1 text (.*)/ capture msg + guard (msg == "message1") + with p2: + expect /chatroom-message-new $room1_p2 room first_room from Owner1 text (.*)/ capture msg + guard (msg == "message2") + + send "chatroom-message-send $room1_p2 message3" to p2 + for p in [ p1, p2 ]: + with p: + expect /chatroom-message-new [a-z0-9#]+ room first_room from Owner2 text message3/ + + send "chatroom-message-send $room1_p1 message4" to p1 + for p in [ p1, p2 ]: + with p: + expect /chatroom-message-new [a-z0-9#]+ room first_room from Owner1 text message4/ + + # Multiple rooms + + send "chatroom-create second_room" to p1 + expect /chatroom-create-done ([a-z0-9#]+) second_room.*/ from p1 capture room2_p1 + + send "chatroom-create third_room" to p2 + expect /chatroom-create-done ([a-z0-9#]+) third_room.*/ from p2 capture room3_p2 + + expect /chatroom-watched-added $room2_p1 second_room sub true/ from p1 + expect /chatroom-watched-added $room3_p2 third_room sub true/ from p2 + expect /chatroom-watched-added ([a-z0-9#]+) second_room sub false/ from p2 capture room2_p2 + expect /chatroom-watched-added ([a-z0-9#]+) third_room sub false/ from p1 capture room3_p1 + + spawn as p3 + send "create-identity Device3 Owner3" to p3 + send "chatroom-watch-local" to p3 + send "start-server" to p3 + expect /chatroom-watched-added ([a-z0-9#]+) first_room sub false/ from p3 capture room1_p3 + expect /chatroom-watched-added ([a-z0-9#]+) second_room sub false/ from p3 capture room2_p3 + expect /chatroom-watched-added ([a-z0-9#]+) third_room sub false/ from p3 capture room3_p3 + + with p3: + for room in [ room1_p3, room2_p3, room3_p3 ]: + send "chatroom-subscribe $room" + expect /chatroom-watched-updated $room [a-z_]+ sub true .*/ + for i in [1..4]: + expect /chatroom-message-new $room1_p3 room first_room from Owner. text (.*)/ capture message + guard (message == "message$i") + + with p2: + send "chatroom-message-send $room2_p2 msg_r2_1" + send "chatroom-message-send $room2_p2 msg_r2_2" + send "chatroom-message-send $room2_p2 msg_r2_3" + expect /chatroom-message-new $room2_p2 room second_room from Owner2 text msg_r2_1/ + expect /chatroom-message-new $room2_p2 room second_room from Owner2 text msg_r2_2/ + expect /chatroom-message-new $room2_p2 room second_room from Owner2 text msg_r2_3/ + + send "chatroom-message-send $room3_p2 msg_r3_1" + send "chatroom-message-send $room3_p2 msg_r3_2" + send "chatroom-message-send $room3_p2 msg_r3_3" + expect /chatroom-message-new $room3_p2 room third_room from Owner2 text msg_r3_1/ + expect /chatroom-message-new $room3_p2 room third_room from Owner2 text msg_r3_2/ + expect /chatroom-message-new $room3_p2 room third_room from Owner2 text msg_r3_3/ + + with p1: + local: + expect /chatroom-message-new [a-z0-9#]+ room ([a-z_]+) from Owner2 text ([a-z0-9_]+)/ capture room, message + guard (room == "second_room") + guard (message == "msg_r2_1") + local: + expect /chatroom-message-new [a-z0-9#]+ room ([a-z_]+) from Owner2 text ([a-z0-9_]+)/ capture room, message + guard (room == "second_room") + guard (message == "msg_r2_2") + local: + expect /chatroom-message-new [a-z0-9#]+ room ([a-z_]+) from Owner2 text ([a-z0-9_]+)/ capture room, message + guard (room == "second_room") + guard (message == "msg_r2_3") + + with p3: + expect /chatroom-message-new $room2_p3 room second_room from Owner2 text msg_r2_1/ + expect /chatroom-message-new $room2_p3 room second_room from Owner2 text msg_r2_2/ + expect /chatroom-message-new $room2_p3 room second_room from Owner2 text msg_r2_3/ + expect /chatroom-message-new $room3_p3 room third_room from Owner2 text msg_r3_1/ + expect /chatroom-message-new $room3_p3 room third_room from Owner2 text msg_r3_2/ + expect /chatroom-message-new $room3_p3 room third_room from Owner2 text msg_r3_3/ + + # Unsubscribe + + send "chatroom-unsubscribe $room1_p1" to p1 + expect /chatroom-watched-updated $room1_p1 [a-z_]+ sub false .*/ from p1 + send "chatroom-unsubscribe $room1_p3" to p3 + expect /chatroom-watched-updated $room1_p3 [a-z_]+ sub false .*/ from p3 + send "chatroom-unsubscribe $room2_p3" to p3 + expect /chatroom-watched-updated $room2_p3 [a-z_]+ sub false .*/ from p3 + + with p2: + send "chatroom-message-send $room1_p2 msg_r1_4" + expect /chatroom-message-new $room1_p2 room first_room from Owner2 text msg_r1_4/ + + send "chatroom-message-send $room2_p2 msg_r2_4" + expect /chatroom-message-new $room2_p2 room second_room from Owner2 text msg_r2_4/ + + send "chatroom-message-send $room3_p2 msg_r3_4" + expect /chatroom-message-new $room3_p2 room third_room from Owner2 text msg_r3_4/ + + with p1: + local: + expect /chatroom-message-new [a-z0-9#]+ room ([a-z_]+) from Owner2 text ([a-z0-9_]+)/ capture room, message + guard (room == "second_room") + guard (message == "msg_r2_4") + + with p3: + local: + expect /chatroom-message-new [a-z0-9#]+ room ([a-z_]+) from Owner2 text ([a-z0-9_]+)/ capture room, message + guard (room == "third_room") + guard (message == "msg_r3_4") -- cgit v1.2.3 From c946dea60c6a9121a8b8af766c654b81170a13a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Mon, 15 Jul 2024 22:47:31 +0200 Subject: (test) Send current chatroom subscriptions to new peers --- chatroom.test | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/chatroom.test b/chatroom.test index c4cdc6d..9b68839 100644 --- a/chatroom.test +++ b/chatroom.test @@ -239,3 +239,44 @@ test ChatroomMessages: expect /chatroom-message-new [a-z0-9#]+ room ([a-z_]+) from Owner2 text ([a-z0-9_]+)/ capture room, message guard (room == "third_room") guard (message == "msg_r3_4") + + +test ChatroomSubscribedBeforeStart: + spawn as p1 + spawn as p2 + + send "create-identity Device1 Owner1" to p1 + send "create-identity Device2 Owner2" to p2 + + for p in [ p1, p2 ]: + with p: + send "chatroom-watch-local" + send "start-server" + + send "chatroom-create first_room" to p1 + expect /chatroom-create-done ([a-z0-9#]+) first_room.*/ from p1 capture room1_p1 + + expect /chatroom-watched-added [a-z0-9#]+ first_room sub true/ from p1 + expect /chatroom-watched-added ([a-z0-9#]+) first_room sub false/ from p2 capture room1_p2 + + with p2: + send "chatroom-subscribe $room1_p2" + expect /chatroom-watched-updated [a-z0-9#]+ first_room sub true .*/ + + for p in [p1, p2]: + with p: + send "stop-server" + for p in [p1, p2]: + with p: + expect /stop-server-done/ + for p in [p1, p2]: + with p: + send "start-server" + + send "chatroom-message-send $room1_p1 message1" to p1 + expect /chatroom-message-new $room1_p1 room first_room from Owner1 text message1/ from p1 + expect /chatroom-message-new $room1_p2 room first_room from Owner1 text message1/ from p2 + + send "chatroom-message-send $room1_p2 message2" to p2 + expect /chatroom-message-new $room1_p1 room first_room from Owner2 text message2/ from p1 + expect /chatroom-message-new $room1_p2 room first_room from Owner2 text message2/ from p2 -- cgit v1.2.3 From f3f5a8c60b3cd7a6c541f459c1658a60be3334e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 16 Jul 2024 21:18:59 +0200 Subject: (test) Handle parallel thread diff in chatrooms --- chatroom.test | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/chatroom.test b/chatroom.test index 9b68839..1998290 100644 --- a/chatroom.test +++ b/chatroom.test @@ -280,3 +280,67 @@ test ChatroomSubscribedBeforeStart: send "chatroom-message-send $room1_p2 message2" to p2 expect /chatroom-message-new $room1_p1 room first_room from Owner2 text message2/ from p1 expect /chatroom-message-new $room1_p2 room first_room from Owner2 text message2/ from p2 + + +test ParallelThreads: + spawn as p1 + spawn as p2 + + send "create-identity Device1 Owner1" to p1 + send "create-identity Device2 Owner2" to p2 + + for p in [ p1, p2 ]: + with p: + send "chatroom-watch-local" + send "start-server" + + send "chatroom-create first_room" to p1 + expect /chatroom-create-done ([a-z0-9#]+) first_room.*/ from p1 capture room1_p1 + + expect /chatroom-watched-added [a-z0-9#]+ first_room sub true/ from p1 + expect /chatroom-watched-added ([a-z0-9#]+) first_room sub false/ from p2 capture room1_p2 + + with p2: + send "chatroom-subscribe $room1_p2" + expect /chatroom-watched-updated [a-z0-9#]+ first_room sub true .*/ + + for p in [p1, p2]: + with p: + send "stop-server" + for p in [p1, p2]: + with p: + expect /stop-server-done/ + + send "chatroom-message-send $room1_p1 message1A" to p1 + send "chatroom-message-send $room1_p1 message1B" to p1 + send "chatroom-message-send $room1_p2 message2A" to p2 + send "chatroom-message-send $room1_p2 message2B" to p2 + with p1: + expect /chatroom-message-new $room1_p1 room first_room from Owner. text message(..)/ capture msg + guard (msg == "1A") + with p1: + expect /chatroom-message-new $room1_p1 room first_room from Owner. text message(..)/ capture msg + guard (msg == "1B") + with p2: + expect /chatroom-message-new $room1_p2 room first_room from Owner. text message(..)/ capture msg + guard (msg == "2A") + with p2: + expect /chatroom-message-new $room1_p2 room first_room from Owner. text message(..)/ capture msg + guard (msg == "2B") + + for p in [p1, p2]: + with p: + send "start-server" + + with p1: + expect /chatroom-message-new $room1_p1 room first_room from Owner. text message(..)/ capture msg + guard (msg == "2A") + with p1: + expect /chatroom-message-new $room1_p1 room first_room from Owner. text message(..)/ capture msg + guard (msg == "2B") + with p2: + expect /chatroom-message-new $room1_p2 room first_room from Owner. text message(..)/ capture msg + guard (msg == "1A") + with p2: + expect /chatroom-message-new $room1_p2 room first_room from Owner. text message(..)/ capture msg + guard (msg == "1B") -- cgit v1.2.3