Commit efb695be authored by louiz’'s avatar louiz’

e2e: Implicitely include the handshake in all tests

Instead of having to write it manually everytime
parent 17366413
...@@ -292,7 +292,10 @@ def get_scenarios(test_path, provided_scenar_names): ...@@ -292,7 +292,10 @@ def get_scenarios(test_path, provided_scenar_names):
conf = "basic" conf = "basic"
if hasattr(mod, "conf"): if hasattr(mod, "conf"):
conf = mod.conf conf = mod.conf
scenarios.append(Scenario(module_name, mod.scenario, conf)) # Every scenario needs to start with the handshake sequence.
# Instead of repeating it everytime, we add it implicitely. This
# is done here.
scenarios.append(Scenario(module_name, (sequences.handshake(),) + mod.scenario, conf))
return scenarios return scenarios
......
from scenarios import * from scenarios import *
# At the start of every scenario, we automatically insert a
# sequences.handshake() call. So, this scenario is just here to test that
# this basic thing works fine.
scenario = ( scenario = (
sequences.handshake(),
) )
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
# Mutual subscription exchange # Mutual subscription exchange
send_stanza("<presence from='{jid_one}' to='{biboumi_host}' type='subscribe' id='subid1' />"), send_stanza("<presence from='{jid_one}' to='{biboumi_host}' type='subscribe' id='subid1' />"),
......
...@@ -3,7 +3,7 @@ from scenarios import * ...@@ -3,7 +3,7 @@ from scenarios import *
conf = "fixed_server" conf = "fixed_server"
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo@{biboumi_host}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo@{biboumi_host}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_one}/{resource_one}', fixed_irc_server=True), sequences.connection("irc.localhost", '{jid_one}/{resource_one}', fixed_irc_server=True),
expect_stanza("/message/body[text()='Mode #foo [+nt] by {irc_host_one}']"), expect_stanza("/message/body[text()='Mode #foo [+nt] by {irc_host_one}']"),
......
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
from scenarios.simple_channel_join import expect_self_join_presence from scenarios.simple_channel_join import expect_self_join_presence
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_one}/{resource_one}'), sequences.connection("irc.localhost", '{jid_one}/{resource_one}'),
expect_self_join_presence(jid = '{jid_one}/{resource_one}', chan = "#foo", nick = "{nick_one}"), expect_self_join_presence(jid = '{jid_one}/{resource_one}', chan = "#foo", nick = "{nick_one}"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#true\\2ffalse%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#true\\2ffalse%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_one}/{resource_one}'), sequences.connection("irc.localhost", '{jid_one}/{resource_one}'),
expect_stanza("/message/body[text()='Mode #true/false [+nt] by {irc_host_one}']"), expect_stanza("/message/body[text()='Mode #true/false [+nt] by {irc_host_one}']"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#aaa%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#aaa%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_one}/{resource_one}'), sequences.connection("irc.localhost", '{jid_one}/{resource_one}'),
expect_stanza("/message"), expect_stanza("/message"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
# Configure the throttle option with an incorrect value # Configure the throttle option with an incorrect value
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']", expect_stanza("/iq[@type='result']",
......
...@@ -11,8 +11,6 @@ def incr_counter(): ...@@ -11,8 +11,6 @@ def incr_counter():
counter = incr_counter() counter = incr_counter()
scenario = ( scenario = (
sequences.handshake(),
# Disable the throttling, otherwise it’s way too long # Disable the throttling, otherwise it’s way too long
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']", expect_stanza("/iq[@type='result']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
# Disable the throttling, otherwise it’s way too long # Disable the throttling, otherwise it’s way too long
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']", expect_stanza("/iq[@type='result']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#biboumi\\40louiz.org\\3a80%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#biboumi\\40louiz.org\\3a80%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_one}/{resource_one}'), sequences.connection("irc.localhost", '{jid_one}/{resource_one}'),
expect_stanza("/message/body[text()='Mode #biboumi@louiz.org:80 [+nt] by {irc_host_one}']"), expect_stanza("/message/body[text()='Mode #biboumi@louiz.org:80 [+nt] by {irc_host_one}']"),
......
...@@ -3,8 +3,6 @@ from scenarios import * ...@@ -3,8 +3,6 @@ from scenarios import *
from scenarios.simple_channel_join import expect_self_join_presence from scenarios.simple_channel_join import expect_self_join_presence
scenario = ( scenario = (
sequences.handshake(),
# Admin connects to first server # Admin connects to first server
send_stanza("<presence from='{jid_admin}/{resource_one}' to='#bar%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_admin}/{resource_one}' to='#bar%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_admin}/{resource_one}'), sequences.connection("irc.localhost", '{jid_admin}/{resource_one}'),
......
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
from scenarios.simple_channel_join import expect_self_join_presence from scenarios.simple_channel_join import expect_self_join_presence
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_admin}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_admin}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_admin}/{resource_one}'), sequences.connection("irc.localhost", '{jid_admin}/{resource_one}'),
expect_self_join_presence(jid = '{jid_admin}/{resource_one}', chan = "#foo", nick = "{nick_one}"), expect_self_join_presence(jid = '{jid_admin}/{resource_one}', chan = "#foo", nick = "{nick_one}"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='command1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='disconnect-user' action='execute' /></iq>"), send_stanza("<iq type='set' id='command1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='disconnect-user' action='execute' /></iq>"),
expect_stanza("/iq[@type='error'][@id='command1']/commands:command[@node='disconnect-user']", expect_stanza("/iq[@type='error'][@id='command1']/commands:command[@node='disconnect-user']",
"/iq/commands:command/commands:error[@type='cancel']/stanza:forbidden"), "/iq/commands:command/commands:error[@type='cancel']/stanza:forbidden"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
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>"), 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>"),
expect_stanza("/iq[@type='result']/commands:command[@node='hello'][@sessionid][@status='executing']", 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:title[text()='Configure your name.']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
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>"), 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>"),
expect_stanza("/iq[@type='result']/commands:command[@node='hello'][@sessionid][@status='executing']", expect_stanza("/iq[@type='result']/commands:command[@node='hello'][@sessionid][@status='executing']",
"/iq/commands:command/commands:actions/commands:complete", "/iq/commands:command/commands:actions/commands:complete",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='ping-command1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='ping' action='execute' /></iq>"), send_stanza("<iq type='set' id='ping-command1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='ping' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='ping'][@status='completed']/commands:note[@type='info'][text()='Pong']") expect_stanza("/iq[@type='result']/commands:command[@node='ping'][@status='completed']/commands:note[@type='info'][text()='Pong']")
) )
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='ping-command1' from='{jid_admin}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='reload' action='execute' /></iq>"), send_stanza("<iq type='set' id='ping-command1' from='{jid_admin}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='reload' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='reload'][@status='completed']/commands:note[@type='info'][text()='Configuration reloaded.']"), expect_stanza("/iq[@type='result']/commands:command[@node='reload'][@status='completed']/commands:note[@type='info'][text()='Configuration reloaded.']"),
) )
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
conf = 'fixed_server' conf = 'fixed_server'
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence type='subscribe' from='{jid_one}/{resource_one}' to='{biboumi_host}' id='sub1' />"), send_stanza("<presence type='subscribe' from='{jid_one}/{resource_one}' to='{biboumi_host}' id='sub1' />"),
expect_stanza("/presence[@to='{jid_one}'][@from='{biboumi_host}'][@type='subscribed']") expect_stanza("/presence[@to='{jid_one}'][@from='{biboumi_host}'][@type='subscribed']")
) )
...@@ -3,8 +3,6 @@ from scenarios import * ...@@ -3,8 +3,6 @@ from scenarios import *
conf = 'fixed_server' conf = 'fixed_server'
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq from='{jid_one}/{resource_one}' to='#foo@{biboumi_host}' id='1' type='get'><query xmlns='http://jabber.org/protocol/disco#info'/></iq>"), send_stanza("<iq from='{jid_one}/{resource_one}' to='#foo@{biboumi_host}' id='1' type='get'><query xmlns='http://jabber.org/protocol/disco#info'/></iq>"),
expect_stanza("/iq[@from='#foo@{biboumi_host}'][@to='{jid_one}/{resource_one}'][@type='result']/disco_info:query", expect_stanza("/iq[@from='#foo@{biboumi_host}'][@to='{jid_one}/{resource_one}'][@type='result']/disco_info:query",
"/iq[@type='result']/disco_info:query/disco_info:identity[@category='conference'][@type='irc'][@name='#foo on {irc_host_one}']", "/iq[@type='result']/disco_info:query/disco_info:identity[@category='conference'][@type='irc'][@name='#foo on {irc_host_one}']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='command1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='get-irc-connection-info' action='execute' /></iq>"), send_stanza("<iq type='set' id='command1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='get-irc-connection-info' action='execute' /></iq>"),
expect_stanza("/iq/commands:command/commands:note[text()='You are not connected to the IRC server irc.localhost']"), expect_stanza("/iq/commands:command/commands:note[text()='You are not connected to the IRC server irc.localhost']"),
......
...@@ -3,8 +3,6 @@ from scenarios import * ...@@ -3,8 +3,6 @@ from scenarios import *
conf = 'fixed_server' conf = 'fixed_server'
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='command1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='get-irc-connection-info' action='execute' /></iq>"), send_stanza("<iq type='set' id='command1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='get-irc-connection-info' action='execute' /></iq>"),
expect_stanza("/iq/commands:command/commands:note[text()='You are not connected to the IRC server irc.localhost']"), expect_stanza("/iq/commands:command/commands:note[text()='You are not connected to the IRC server irc.localhost']"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']", expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']",
"/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']", "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']",
......
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
conf = 'fixed_server' conf = 'fixed_server'
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='global-configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='global-configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='global-configure'][@sessionid][@status='executing']", expect_stanza("/iq[@type='result']/commands:command[@node='global-configure'][@sessionid][@status='executing']",
"/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']", "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']",
......
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
conf='persistent_by_default' conf='persistent_by_default'
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']", expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']",
"/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']", "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure some global default settings.']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_one}/{resource_one}'), sequences.connection("irc.localhost", '{jid_one}/{resource_one}'),
expect_stanza("/message"), expect_stanza("/message"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute'><dummy/></command></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute'><dummy/></command></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']", expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']",
"/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_in']", "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_in']",
......
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
conf = 'fixed_server' conf = 'fixed_server'
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='#foo@{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='#foo@{biboumi_host}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']", expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']",
"/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_in']", "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_in']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='get' id='id1' from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}'><query xmlns='http://jabber.org/protocol/muc#owner'/></iq>"), send_stanza("<iq type='get' id='id1' from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}'><query xmlns='http://jabber.org/protocol/muc#owner'/></iq>"),
expect_stanza("/iq[@type='result']/muc_owner:query", expect_stanza("/iq[@type='result']/muc_owner:query",
"/iq/muc_owner:query/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_in']", "/iq/muc_owner:query/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_in']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']", expect_stanza("/iq[@type='result']/commands:command[@node='configure'][@sessionid][@status='executing']",
"/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure the IRC server irc.localhost']", "/iq/commands:command/dataform:x[@type='form']/dataform:title[text()='Configure the IRC server irc.localhost']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
sequences.connection(), sequences.connection(),
) )
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%doesnotexist@{biboumi_host}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%doesnotexist@{biboumi_host}/{nick_one}' />"),
expect_stanza("/message/body[text()='Connecting to doesnotexist:6697 (encrypted)']"), expect_stanza("/message/body[text()='Connecting to doesnotexist:6697 (encrypted)']"),
expect_stanza("/message/body[re:test(text(), 'Connection failed: (Domain name not found|Name or service not known)')]"), expect_stanza("/message/body[re:test(text(), 'Connection failed: (Domain name not found|Name or service not known)')]"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
# Mutual subscription exchange # Mutual subscription exchange
send_stanza("<presence from='{jid_one}' to='{irc_server_one}' type='subscribe' id='subid1' />"), send_stanza("<presence from='{jid_one}' to='{irc_server_one}' type='subscribe' id='subid1' />"),
expect_stanza("/presence[@type='subscribed'][@id='subid1']"), expect_stanza("/presence[@type='subscribed'][@id='subid1']"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence type='subscribe' from='{jid_one}/{resource_one}' to='{irc_server_one}' id='sub1' />"), send_stanza("<presence type='subscribe' from='{jid_one}/{resource_one}' to='{irc_server_one}' id='sub1' />"),
expect_stanza("/presence[@to='{jid_one}'][@from='{irc_server_one}'][@type='subscribed']"), expect_stanza("/presence[@to='{jid_one}'][@from='{irc_server_one}'][@type='subscribed']"),
) )
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
# First, use an adhoc command to configure how we connect to the irc server, configure # First, use an adhoc command to configure how we connect to the irc server, configure
# only one TLS port, and disable the cert verification. # only one TLS port, and disable the cert verification.
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
# Disable the throttling because the test is based on timings # Disable the throttling because the test is based on timings
send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"), send_stanza("<iq type='set' id='id1' from='{jid_one}/{resource_one}' to='{irc_server_one}'><command xmlns='http://jabber.org/protocol/commands' node='configure' action='execute' /></iq>"),
expect_stanza("/iq[@type='result']", expect_stanza("/iq[@type='result']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"), send_stanza("<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
sequences.connection("irc.localhost", '{jid_one}/{resource_one}'), sequences.connection("irc.localhost", '{jid_one}/{resource_one}'),
expect_stanza("/message"), expect_stanza("/message"),
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='get' id='idwhatever' from='{jid_one}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"), send_stanza("<iq type='get' id='idwhatever' from='{jid_one}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"),
expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']",
"/iq/disco_items:query/disco_items:item[@node='configure']", "/iq/disco_items:query/disco_items:item[@node='configure']",
......
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
conf = "fixed_server" conf = "fixed_server"
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='get' id='idwhatever' from='{jid_one}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"), send_stanza("<iq type='get' id='idwhatever' from='{jid_one}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"),
expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']",
"/iq/disco_items:query/disco_items:item[@node='global-configure']", "/iq/disco_items:query/disco_items:item[@node='global-configure']",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='get' id='idwhatever' from='{jid_one}/{resource_one}' to='{irc_host_one}@{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"), send_stanza("<iq type='get' id='idwhatever' from='{jid_one}/{resource_one}' to='{irc_host_one}@{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"),
expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']",
"/iq/disco_items:query/disco_items:item[2]", "/iq/disco_items:query/disco_items:item[2]",
......
from scenarios import * from scenarios import *
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='get' id='idwhatever' from='{jid_admin}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"), send_stanza("<iq type='get' id='idwhatever' from='{jid_admin}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"),
expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']",
"/iq/disco_items:query/disco_items:item[@node='configure']", "/iq/disco_items:query/disco_items:item[@node='configure']",
......
...@@ -3,7 +3,6 @@ from scenarios import * ...@@ -3,7 +3,6 @@ from scenarios import *
conf = "fixed_server" conf = "fixed_server"
scenario = ( scenario = (
sequences.handshake(),
send_stanza("<iq type='get' id='idwhatever' from='{jid_admin}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"), send_stanza("<iq type='get' id='idwhatever' from='{jid_admin}/{resource_one}' to='{biboumi_host}'><query xmlns='http://jabber.org/protocol/disco#items' node='http://jabber.org/protocol/commands' /></iq>"),
expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']", expect_stanza("/iq[@type='result']/disco_items:query[@node='http://jabber.org/protocol/commands']",
"/iq/disco_items:query/disco_items:item[@node='global-configure']", "/iq/disco_items:query/disco_items:item[@node='global-configure']",
......