summaryrefslogtreecommitdiff
path: root/tests/end_to_end
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-06-24 11:25:04 +0200
committerlouiz’ <louiz@louiz.org>2016-06-24 11:25:04 +0200
commit7ae29890c3fd498d8d4fecd64cfc0da703b77a1a (patch)
tree19c6fbff1e2d0796c496c2ca2e51f20513eb3ee5 /tests/end_to_end
parentfcb2681b7b3f221160fac027731fc3688d73d59d (diff)
downloadbiboumi-7ae29890c3fd498d8d4fecd64cfc0da703b77a1a.tar.gz
biboumi-7ae29890c3fd498d8d4fecd64cfc0da703b77a1a.tar.bz2
biboumi-7ae29890c3fd498d8d4fecd64cfc0da703b77a1a.tar.xz
biboumi-7ae29890c3fd498d8d4fecd64cfc0da703b77a1a.zip
Add a e2e for self-ping, with a single channel resource
Diffstat (limited to 'tests/end_to_end')
-rw-r--r--tests/end_to_end/__main__.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index 7859202..ebd2a73 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -701,7 +701,32 @@ if __name__ == '__main__':
),
partial(expect_stanza, "/message[@from='#biboumi\\40louiz.org\\3a80%{irc_server_one}'][@type='groupchat']/subject[not(text())]"),
]),
+ Scenario("self_ping_on_real_channel",
+ [
+ handshake_sequence(),
+ partial(send_stanza,
+ "<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
+ connection_sequence("irc.localhost", '{jid_one}/{resource_one}'),
+ partial(expect_stanza,
+ "/message/body[text()='Mode #foo [+nt] by {irc_host_one}']"),
+ partial(expect_stanza,
+ ("/presence[@to='{jid_one}/{resource_one}'][@from='#foo%{irc_server_one}/{nick_one}']/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']",
+ "/presence/muc_user:x/muc_user:status[@code='110']")
+ ),
+ partial(expect_stanza, "/message[@from='#foo%{irc_server_one}'][@type='groupchat']/subject[not(text())]"),
+ # Send a ping to ourself
+ partial(send_stanza,
+ "<iq type='get' from='{jid_one}/{resource_one}' id='first_ping' to='#foo%{irc_server_one}/{nick_one}'><ping xmlns='urn:xmpp:ping' /></iq>"),
+ # We receive our own ping request,
+ partial(expect_stanza,
+ "/iq[@from='{lower_nick_one}!{irc_server_one}'][@type='get'][@to='{jid_one}/{resource_one}'][@id='gnip_tsrif']"),
+ # Respond to the request
+ partial(send_stanza,
+ "<iq type='result' to='{lower_nick_one}!{irc_server_one}' id='gnip_tsrif' from='{jid_one}/{resource_one}'/>"),
+ partial(expect_stanza,
+ "/iq[@from='#foo%{irc_server_one}/{nick_one}'][@type='result'][@to='{jid_one}/{resource_one}'][@id='first_ping']"),
+ ]),
)
failures = 0