diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py index 7259999..a718a63 100644 --- a/tests/end_to_end/__main__.py +++ b/tests/end_to_end/__main__.py @@ -49,6 +49,8 @@ class XMPPComponent(slixmpp.BaseXMPP): def __init__(self, scenario, biboumi): super().__init__(jid="biboumi.localhost", default_ns="jabber:component:accept") self.is_component = True + self.auto_authorize = None # Do not accept or reject subscribe requests automatically + self.auto_subscribe = False self.stream_header = '' % ( 'xmlns="jabber:component:accept"', 'xmlns:stream="%s"' % self.stream_ns, @@ -2671,7 +2673,28 @@ if __name__ == '__main__': partial(expect_stanza, "/message[@to='{jid_two}/{resource_two}'][@type='chat']/body[text()='irc.localhost: {nick_one}: Nickname is already in use.']"), partial(expect_stanza, "/presence[@type='error']/error[@type='cancel'][@code='409']/stanza:conflict"), partial(send_stanza, "") - ]) + ]), + Scenario("basic_subscribe_unsubscribe", + [ + handshake_sequence(), + + # Mutual subscription exchange + partial(send_stanza, ""), + partial(expect_stanza, "/presence[@type='subscribed'][@id='subid1']"), + + # Get the current presence of the biboumi gateway + partial(expect_stanza, "/presence"), + + partial(expect_stanza, "/presence[@type='subscribe']"), + partial(send_stanza, ""), + + + # Unsubscribe + partial(send_stanza, ""), + partial(expect_stanza, "/presence[@type='unavailable']"), + partial(expect_stanza, "/presence[@type='unsubscribe']"), + partial(send_stanza, ""), + ]) ) failures = 0