summaryrefslogtreecommitdiff
path: root/tests/end_to_end
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-05-13 15:15:10 +0200
committerlouiz’ <louiz@louiz.org>2016-05-13 15:17:29 +0200
commit8f80b9c53011561f8eee9875504e526c174317a3 (patch)
treea83394925da7b3eb9530ce88433ac27cb25f781c /tests/end_to_end
parent0b1bf92479f7086f04404538b6813106ce7733bb (diff)
downloadbiboumi-8f80b9c53011561f8eee9875504e526c174317a3.tar.gz
biboumi-8f80b9c53011561f8eee9875504e526c174317a3.tar.bz2
biboumi-8f80b9c53011561f8eee9875504e526c174317a3.tar.xz
biboumi-8f80b9c53011561f8eee9875504e526c174317a3.zip
Test the execution of the hello command
Diffstat (limited to 'tests/end_to_end')
-rw-r--r--tests/end_to_end/__main__.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index 815093e..706d177 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -111,6 +111,7 @@ def match(stanza, xpath):
matched = tree.xpath(xpath, namespaces={'re': 'http://exslt.org/regular-expressions',
'muc_user': 'http://jabber.org/protocol/muc#user',
'disco_items': 'http://jabber.org/protocol/disco#items',
+ 'commands': 'http://jabber.org/protocol/commands',
'dataform': 'jabber:x:data'})
return matched
@@ -561,6 +562,23 @@ if __name__ == '__main__':
partial(expect_stanza, ("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']",
"/iq/disco_items:query/disco_items:item[6]")),
], conf='fixed_server'),
+
+ Scenario("execute_hello_adhoc_command",
+ [
+ handshake_sequence(),
+ partial(send_stanza, "<iq type='set' id='hello-command1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='hello' action='execute' /></iq>"),
+ partial(expect_stanza, ("/iq[@type='result']/commands:command[@node='hello'][@sessionid][@status='executing']",
+ "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure your name.']",
+ "/iq/commands:command/dataform:x[@type='form']/dataform:instructions[text()='Please provide your name.']",
+ "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single']/dataform:required",
+ "/iq/commands:command/commands:actions/commands:next",
+ ),
+ after = partial(save_value, "sessionid", partial(extract_attribute, "/iq[@type='result']/commands:command[@node='hello']", "sessionid"))
+
+ ),
+ partial(send_stanza, "<iq type='set' id='hello-command2' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='hello' sessionid='{sessionid}' action='next'><x xmlns='jabber:x:data' type='submit'><field var='name'><value>COUCOU</value></field></x></command></iq>"),
+ partial(expect_stanza, "/iq[@type='result']/commands:command[@node='hello'][@status='completed']/commands:note[@type='info'][text()='Hello COUCOU!']")
+ ]),
)
failures = 0