diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2023-05-23 22:11:42 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2023-05-23 22:32:01 +0200 |
commit | 15ad6ae7bd64d8d7319d75dbbb0827addd22fef2 (patch) | |
tree | c5f7ac828f4c1d5f51c461ad332b83e570ce3b26 /test/message.test | |
parent | fce349f8f1c53d3e205a8d86b79784fdfd2b7b7a (diff) |
Message sending to identity or contact
Diffstat (limited to 'test/message.test')
-rw-r--r-- | test/message.test | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/test/message.test b/test/message.test index 9567611..3f108d3 100644 --- a/test/message.test +++ b/test/message.test @@ -14,16 +14,57 @@ test DirectMessage: /peer ([0-9]+) addr ${p1.node.ip} 29665/ capture peer2_1 /peer $peer2_1 id Device1 Owner1/ + # Send messages to peers + for i in [1..2]: send "dm-send-peer $peer1_2 hello$i" to p1 expect /dm-received from Owner1 text hello$i/ from p2 for i in [1..2]: - send "dm-send-peer $peer1_2 hello$i" to p2 + send "dm-send-peer $peer2_1 hello$i" to p2 expect /dm-received from Owner2 text hello$i/ from p1 for i in [3..4]: send "dm-send-peer $peer1_2 hello$i" to p1 expect /dm-received from Owner1 text hello$i/ from p2 - send "dm-send-peer $peer1_2 hello$i" to p2 + send "dm-send-peer $peer2_1 hello$i" to p2 + expect /dm-received from Owner2 text hello$i/ from p1 + + # Create contacts + + local: + send "contact-request $peer1_2" to p1 + expect /contact-request $peer2_1 ([0-9]*)/ from p2 capture code2 + expect /contact-response $peer1_2 ([0-9]*)/ from p1 capture code1 + guard (code1 == code2) + + send "contact-accept $peer1_2" to p1 + send "contact-accept $peer2_1" to p2 + expect /contact-request-done $peer2_1/ from p2 + expect /contact-response-done $peer1_2/ from p1 + + send "contact-list" to p1 + expect from p1: + /contact-list-item ([a-z0-9#]+) Owner2 Owner2/ capture c1_2 + /contact-list-(.*)/ capture done1_1 + + send "contact-list" to p2 + expect from p2: + /contact-list-item ([a-z0-9#]+) Owner1 Owner1/ capture c2_1 + /contact-list-(.*)/ capture done1_2 + + # Send messages to contacts + + for i in [1..2]: + send "dm-send-contact $c1_2 hello$i" to p1 + expect /dm-received from Owner1 text hello$i/ from p2 + + for i in [1..2]: + send "dm-send-contact $c2_1 hello$i" to p2 + expect /dm-received from Owner2 text hello$i/ from p1 + + for i in [3..4]: + send "dm-send-contact $c1_2 hello$i" to p1 + expect /dm-received from Owner1 text hello$i/ from p2 + send "dm-send-contact $c2_1 hello$i" to p2 expect /dm-received from Owner2 text hello$i/ from p1 |