<test-history test='Presence 1 (c2s)'>
<OUTPUT test='Subscription receive'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'/>
</OUTPUT>
<INPUT test='Subscription receive'>
<stream:stream version="1.0" xml:lang="en" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" from="test-d" id="2008a31d-b0d0-432d-b9d6-0e42c18e3025"/>
</INPUT>
<INPUT test='Subscription receive'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register"/><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>
</INPUT>
<OUTPUT test='Subscription receive'>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFsbC14bXBwLXRlc3QAYWxsLXhtcHAtdGVzdC1wYXNzd29yZA==</auth>
</OUTPUT>
<INPUT test='Subscription receive'>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
</INPUT>
<OUTPUT test='Subscription receive'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'>
</OUTPUT>
<INPUT test='Subscription receive'>
<stream:stream version="1.0" xml:lang="en" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" from="test-d" id="2008a31d-b0d0-432d-b9d6-0e42c18e3025"/>
</INPUT>
<INPUT test='Subscription receive'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/><register xmlns="http://jabber.org/features/iq-register"/><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/></stream:features>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq type='set' id='bind1'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>def-user-resource</resource></bind></iq>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="result" id="bind1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>all-xmpp-test@test-d/def-user-resource</jid></bind></iq>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq type="get" id="sub-rec-1">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="result" id="sub-rec-1"><query xmlns="jabber:iq:roster"/></iq>
</INPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="set" id="tig1"><query xmlns="jabber:iq:roster"><item name="dynrost" jid="dynrost@test-d" subscription="both"><group>test group</group></item></query></iq>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq type="result" id="tig1"/>
</OUTPUT>
<OUTPUT test='Subscription receive'>
<presence type="available" id="sub-rec-2"/>
</OUTPUT>
<INPUT test='Subscription receive'>
<presence to="all-xmpp-test@test-d" xmlns="jabber:client" type="available" from="all-xmpp-test@test-d/def-user-resource" id="sub-rec-2"/>
</INPUT>
<OUTPUT test='Subscription send'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'/>
</OUTPUT>
<INPUT test='Subscription send'>
<stream:stream version="1.0" xml:lang="en" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" from="test-d" id="b02cbcc9-26b4-4197-9939-d4a295cc807e"/>
</INPUT>
<INPUT test='Subscription send'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>PLAIN</mechanism><mechanism>ANONYMOUS</mechanism></mechanisms><register xmlns="http://jabber.org/features/iq-register"/><auth xmlns="http://jabber.org/features/iq-auth"/></stream:features>
</INPUT>
<OUTPUT test='Subscription send'>
<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>AGFkbWluAHN0YXRz</auth>
</OUTPUT>
<INPUT test='Subscription send'>
<success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/>
</INPUT>
<OUTPUT test='Subscription send'>
<stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' to='test-d' version='1.0'>
</OUTPUT>
<INPUT test='Subscription send'>
<stream:stream version="1.0" xml:lang="en" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" from="test-d" id="b02cbcc9-26b4-4197-9939-d4a295cc807e"/>
</INPUT>
<INPUT test='Subscription send'>
<stream:features><ver xmlns="urn:xmpp:features:rosterver"/><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/><session xmlns="urn:ietf:params:xml:ns:xmpp-session"/><register xmlns="http://jabber.org/features/iq-register"/><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/></stream:features>
</INPUT>
<OUTPUT test='Subscription send'>
<iq type='set' id='bind1'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>def-user-resource</resource></bind></iq>
</OUTPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="result" id="bind1"><bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"><jid>admin@test-d/def-user-resource</jid></bind></iq>
</INPUT>
<OUTPUT test='Subscription send'>
<iq type="get" id="sub-send-1">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="result" id="sub-send-1"><query xmlns="jabber:iq:roster"/></iq>
</INPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="set" id="tig1"><query xmlns="jabber:iq:roster"><item name="dynrost" jid="dynrost@test-d" subscription="both"><group>test group</group></item></query></iq>
</INPUT>
<OUTPUT test='Subscription send'>
<iq type="result" id="tig1"/>
</OUTPUT>
<OUTPUT test='Subscription send'>
<presence type="available" id="sub-send-2"/>
</OUTPUT>
<INPUT test='Subscription send'>
<presence to="admin@test-d" xmlns="jabber:client" type="available" from="admin@test-d/def-user-resource" id="sub-send-2"/>
</INPUT>
<OUTPUT test='Subscription send'>
<presence to="all-xmpp-test@test-d" type="subscribe" id="sub-send-3"/>
</OUTPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="set" id="rsttig2"><query xmlns="jabber:iq:roster" ver="63c4b413ac6427886eb086952ab95e2a"><item name="all-xmpp-test" ask="subscribe" jid="all-xmpp-test@test-d" subscription="none"/></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence to="all-xmpp-test@test-d" xmlns="jabber:client" type="subscribe" from="admin@test-d" id="sub-send-3"/>
</INPUT>
<OUTPUT test='Subscription receive'>
<presence to="admin@test-d" type="subscribed" id="sub-rec-3"/>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="set" id="rsttig2"><query xmlns="jabber:iq:roster" ver="63c4b413ac6427886eb086952ab95e2a"><item name="admin" jid="admin@test-d" subscription="from"/></query></iq>
</INPUT>
<OUTPUT test='Subscription receive'>
<presence to="admin@test-d" type="subscribe" id="sub-rec-4"/>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="set" id="rsttig3"><query xmlns="jabber:iq:roster" ver="63c4b413ac6427886eb086952ab95e2a"><item name="admin" ask="subscribe" jid="admin@test-d" subscription="from"/></query></iq>
</INPUT>
<INPUT test='Subscription send'>
<presence to="admin@test-d" xmlns="jabber:client" type="subscribed" from="all-xmpp-test@test-d" id="sub-rec-3"/>
</INPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="set" id="rsttig3"><query xmlns="jabber:iq:roster" ver="63c4b413ac6427886eb086952ab95e2a"><item name="all-xmpp-test" jid="all-xmpp-test@test-d" subscription="to"/></query></iq>
</INPUT>
<INPUT test='Subscription send'>
<presence to="admin@test-d" xmlns="jabber:client" type="available" from="all-xmpp-test@test-d/def-user-resource" id="sub-rec-2"/>
</INPUT>
<INPUT test='Subscription send'>
<presence to="admin@test-d" xmlns="jabber:client" type="subscribe" from="all-xmpp-test@test-d" id="sub-rec-4"/>
</INPUT>
<OUTPUT test='Subscription send'>
<presence to="all-xmpp-test@test-d" type="subscribed" id="sub-send-4"/>
</OUTPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="set" id="rsttig4"><query xmlns="jabber:iq:roster" ver="63c4b413ac6427886eb086952ab95e2a"><item name="all-xmpp-test" jid="all-xmpp-test@test-d" subscription="both"/></query></iq>
</INPUT>
<OUTPUT test='Subscription send'>
<iq type="get" id="sub-send-5">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="result" id="sub-send-5"><query xmlns="jabber:iq:roster"><item name="all-xmpp-test" jid="all-xmpp-test@test-d" subscription="both"/></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence to="all-xmpp-test@test-d" xmlns="jabber:client" type="subscribed" from="admin@test-d" id="sub-send-4"/>
</INPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="set" id="rsttig4"><query xmlns="jabber:iq:roster" ver="63c4b413ac6427886eb086952ab95e2a"><item name="admin" jid="admin@test-d" subscription="both"/></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence to="all-xmpp-test@test-d" xmlns="jabber:client" type="available" from="admin@test-d/def-user-resource" id="sub-send-2"/>
</INPUT>
<OUTPUT test='Subscription receive'>
<iq type="get" id="sub-rec-5">
<query xmlns="jabber:iq:roster"/>
</iq>
</OUTPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="result" id="sub-rec-5"><query xmlns="jabber:iq:roster"><item name="admin" jid="admin@test-d" subscription="both"/></query></iq>
</INPUT>
<INPUT test='Subscription send'>
<iq to="admin@test-d/def-user-resource" xmlns="jabber:client" type="set" id="tig5"><query xmlns="jabber:iq:roster"><item name="dynrost" jid="dynrost@test-d" subscription="both"><group>test group</group></item></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<iq to="all-xmpp-test@test-d/def-user-resource" xmlns="jabber:client" type="set" id="tig5"><query xmlns="jabber:iq:roster"><item name="dynrost" jid="dynrost@test-d" subscription="both"><group>test group</group></item></query></iq>
</INPUT>
<INPUT test='Subscription receive'>
<presence to="all-xmpp-test@test-d" xmlns="jabber:client" type="unavailable" from="admin@test-d/def-user-resource" id="sub-send-2"/>
</INPUT>

</test-history>