aboutsummaryrefslogtreecommitdiffstats
path: root/spec/scansion
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
committerKim Alvefur <zash@zash.se>2019-12-24 00:39:45 +0100
commit1eabf5bdb449b0312dfa272884e02cc84175775c (patch)
tree94b4ebcb9443e8e6751e1903ade3c9dc8ec9d678 /spec/scansion
parent575cd4c57d062a1addc761aa0036b1db752900a9 (diff)
parent8537138d41a6bca5e855040c8928ef2aae59802f (diff)
downloadprosody-1eabf5bdb449b0312dfa272884e02cc84175775c.tar.gz
prosody-1eabf5bdb449b0312dfa272884e02cc84175775c.zip
Merge 0.11->trunk
Diffstat (limited to 'spec/scansion')
-rw-r--r--spec/scansion/basic_message.scs6
-rw-r--r--spec/scansion/keep_full_sub_req.scs58
-rw-r--r--spec/scansion/muc_create_destroy.scs250
-rw-r--r--spec/scansion/muc_members_only_change.scs2
-rw-r--r--spec/scansion/muc_nickname_change.scs127
-rw-r--r--spec/scansion/muc_password.scs2
-rw-r--r--spec/scansion/muc_register.scs14
-rw-r--r--spec/scansion/muc_subject_issue_667.scs129
-rw-r--r--spec/scansion/presence_preapproval.scs74
-rw-r--r--spec/scansion/prosody.cfg.lua17
-rw-r--r--spec/scansion/pubsub_basic.scs2
-rw-r--r--spec/scansion/pubsub_preconditions.scs234
12 files changed, 900 insertions, 15 deletions
diff --git a/spec/scansion/basic_message.scs b/spec/scansion/basic_message.scs
index fb21c465..1258dbf5 100644
--- a/spec/scansion/basic_message.scs
+++ b/spec/scansion/basic_message.scs
@@ -79,7 +79,7 @@ Juliet's phone receives:
<message from="${Romeo's full JID}" type="chat">
<body>Hello Juliet, are you there?</body>
<delay xmlns='urn:xmpp:delay' from='localhost' stamp='{scansion:any}' />
- </message>
+ </message>
# Romeo sends another bare-JID message, it should be delivered
# instantly to Juliet's phone
@@ -92,7 +92,7 @@ Romeo sends:
Juliet's phone receives:
<message from="${Romeo's full JID}" type="chat">
<body>Oh, hi!</body>
- </message>
+ </message>
# Juliet's laptop goes online, but with a negative priority
@@ -122,7 +122,7 @@ Romeo sends:
Juliet's phone receives:
<message from="${Romeo's full JID}" type="chat">
<body>How are you?</body>
- </message>
+ </message>
# Romeo sends direct to Juliet's full JID, and she should receive it
diff --git a/spec/scansion/keep_full_sub_req.scs b/spec/scansion/keep_full_sub_req.scs
new file mode 100644
index 00000000..41ffec0d
--- /dev/null
+++ b/spec/scansion/keep_full_sub_req.scs
@@ -0,0 +1,58 @@
+# server MUST keep a record of the complete presence stanza comprising the subscription request (#689)
+
+[Client] Alice
+ jid: pars-a@localhost
+ password: password
+
+[Client] Bob
+ jid: pars-b@localhost
+ password: password
+
+[Client] Bob's phone
+ jid: pars-b@localhost/phone
+ password: password
+
+---------
+
+Alice connects
+
+Alice sends:
+ <presence to="${Bob's JID}" type="subscribe">
+ <preauth xmlns="urn:xmpp:pars:0" token="1tMFqYDdKhfe2pwp" />
+ </presence>
+
+Alice disconnects
+
+Bob connects
+
+Bob sends:
+ <presence/>
+
+Bob receives:
+ <presence from="${Bob's full JID}"/>
+
+Bob receives:
+ <presence from="${Alice's JID}" type="subscribe">
+ <preauth xmlns="urn:xmpp:pars:0" token="1tMFqYDdKhfe2pwp" />
+ </presence>
+
+Bob disconnects
+
+# Works if they reconnect too
+
+Bob's phone connects
+
+Bob's phone sends:
+ <presence/>
+
+Bob's phone receives:
+ <presence from="${Bob's phone's full JID}"/>
+
+
+Bob's phone receives:
+ <presence from="${Alice's JID}" type="subscribe">
+ <preauth xmlns="urn:xmpp:pars:0" token="1tMFqYDdKhfe2pwp" />
+ </presence>
+
+Bob's phone disconnects
+
diff --git a/spec/scansion/muc_create_destroy.scs b/spec/scansion/muc_create_destroy.scs
new file mode 100644
index 00000000..fea759a3
--- /dev/null
+++ b/spec/scansion/muc_create_destroy.scs
@@ -0,0 +1,250 @@
+# MUC creation, basic messages and destruction
+
+[Client] Romeo
+ jid: romeo@localhost/mK0dD6Ha
+ password: password
+
+[Client] Juliet
+ jid: juliet@localhost/lVwkim_k
+ password: password
+
+-----
+
+Romeo connects
+
+Romeo sends:
+ <presence to="garden@conference.localhost/romeo">
+ <x xmlns="http://jabber.org/protocol/muc"/>
+ </presence>
+
+Romeo receives:
+ <presence from="garden@conference.localhost/romeo">
+ <x xmlns="vcard-temp:x:update">
+ <photo/>
+ </x>
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <status code="201"/>
+ <item affiliation="owner" jid="${Romeo's full JID}" role="moderator"/>
+ <status code="110"/>
+ </x>
+ </presence>
+
+Romeo receives:
+ <message from="garden@conference.localhost" type="groupchat">
+ <subject/>
+ </message>
+
+Romeo sends:
+ <iq to="garden@conference.localhost" id="lx3" type="set">
+ <query xmlns="http://jabber.org/protocol/muc#owner">
+ <x type="submit" xmlns="jabber:x:data"/>
+ </query>
+ </iq>
+
+Romeo receives:
+ <iq id="lx3" type="result" from="garden@conference.localhost"/>
+
+Juliet connects
+
+Romeo sends:
+ <message to="garden@conference.localhost" type="groupchat" id="rm1">
+ <body>Where are thou my Juliet?</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" from="garden@conference.localhost/romeo" id="rm1">
+ <body>Where are thou my Juliet?</body>
+ </message>
+
+Juliet sends:
+ <presence to="garden@conference.localhost/juliet">
+ <x xmlns="http://jabber.org/protocol/muc"/>
+ </presence>
+
+Juliet receives:
+ <presence from="garden@conference.localhost/romeo">
+ <x xmlns="vcard-temp:x:update">
+ <photo/>
+ </x>
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <item affiliation="owner" role="moderator"/>
+ </x>
+ </presence>
+
+Juliet receives:
+ <presence from="garden@conference.localhost/juliet">
+ <x xmlns="vcard-temp:x:update">
+ <photo/>
+ </x>
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <item affiliation="none" jid="${Juliet's full JID}" role="participant"/>
+ <status code="110"/>
+ </x>
+ </presence>
+
+Juliet receives:
+ <message from="garden@conference.localhost/romeo" id="rm1" type="groupchat">
+ <body>Where are thou my Juliet?</body>
+ <delay stamp="{scansion:any}" xmlns="urn:xmpp:delay" from="garden@conference.localhost"/>
+ <x stamp="{scansion:any}" xmlns="jabber:x:delay" from="garden@conference.localhost"/>
+ </message>
+
+Juliet receives:
+ <message from="garden@conference.localhost" type="groupchat">
+ <subject/>
+ </message>
+
+Romeo receives:
+ <presence from="garden@conference.localhost/juliet">
+ <x xmlns="vcard-temp:x:update">
+ <photo/>
+ </x>
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <item affiliation="none" jid="${Juliet's full JID}" role="participant"/>
+ </x>
+ </presence>
+
+Juliet sends:
+ <message to="garden@conference.localhost" type="groupchat" id="jm1">
+ <body>/me jumps out from behind a tree</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" id="jm1" from="garden@conference.localhost/juliet">
+ <body>/me jumps out from behind a tree</body>
+ </message>
+
+Juliet receives:
+ <message type="groupchat" id="jm1" from="garden@conference.localhost/juliet">
+ <body>/me jumps out from behind a tree</body>
+ </message>
+
+Juliet sends:
+ <message to="garden@conference.localhost" type="groupchat" id="jm2">
+ <body>Here I am!</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" id="jm2" from="garden@conference.localhost/juliet">
+ <body>Here I am!</body>
+ </message>
+
+Juliet receives:
+ <message type="groupchat" id="jm2" from="garden@conference.localhost/juliet">
+ <body>Here I am!</body>
+ </message>
+
+Romeo sends:
+ <message to="garden@conference.localhost" type="groupchat" id="rm2">
+ <body>What is this place?</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" id="rm2" from="garden@conference.localhost/romeo">
+ <body>What is this place?</body>
+ </message>
+
+Juliet receives:
+ <message type="groupchat" id="rm2" from="garden@conference.localhost/romeo">
+ <body>What is this place?</body>
+ </message>
+
+Juliet sends:
+ <message to="garden@conference.localhost" type="groupchat" id="jm3">
+ <body>I think we&apos;re in a script!</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" id="jm3" from="garden@conference.localhost/juliet">
+ <body>I think we&apos;re in a script!</body>
+ </message>
+
+Juliet receives:
+ <message type="groupchat" id="jm3" from="garden@conference.localhost/juliet">
+ <body>I think we&apos;re in a script!</body>
+ </message>
+
+Romeo sends:
+ <message to="garden@conference.localhost" type="groupchat" id="rm3">
+ <body>Oh no! Does that mean our love is not real?!</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" id="rm3" from="garden@conference.localhost/romeo">
+ <body>Oh no! Does that mean our love is not real?!</body>
+ </message>
+
+Juliet receives:
+ <message type="groupchat" id="rm3" from="garden@conference.localhost/romeo">
+ <body>Oh no! Does that mean our love is not real?!</body>
+ </message>
+
+Juliet sends:
+ <message to="garden@conference.localhost" type="groupchat" id="jm4">
+ <body>I refuse to accept this! Let&apos;s burn this place to the ground!</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" id="jm4" from="garden@conference.localhost/juliet">
+ <body>I refuse to accept this! Let&apos;s burn this place to the ground!</body>
+ </message>
+
+Juliet receives:
+ <message type="groupchat" id="jm4" from="garden@conference.localhost/juliet">
+ <body>I refuse to accept this! Let&apos;s burn this place to the ground!</body>
+ </message>
+
+Romeo sends:
+ <message to="garden@conference.localhost" type="groupchat" id="rm4">
+ <body>Yes!</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" id="rm4" from="garden@conference.localhost/romeo">
+ <body>Yes!</body>
+ </message>
+
+Juliet receives:
+ <message type="groupchat" id="rm4" from="garden@conference.localhost/romeo">
+ <body>Yes!</body>
+ </message>
+
+Romeo sends:
+ <iq to="garden@conference.localhost" id="lx4" type="set">
+ <query xmlns="http://jabber.org/protocol/muc#owner">
+ <destroy>
+ <reason>We refuse to live in this fantasy!</reason>
+ </destroy>
+ </query>
+ </iq>
+
+Juliet receives:
+ <presence from="garden@conference.localhost/juliet" type="unavailable">
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <destroy>
+ <reason>We refuse to live in this fantasy!</reason>
+ </destroy>
+ <item affiliation="none" jid="${Juliet's full JID}" role="none"/>
+ <status code="110"/>
+ </x>
+ </presence>
+
+Romeo receives:
+ <presence from="garden@conference.localhost/romeo" type="unavailable">
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <destroy>
+ <reason>We refuse to live in this fantasy!</reason>
+ </destroy>
+ <item affiliation="owner" jid="${Romeo's full JID}" role="none"/>
+ <status code="110"/>
+ </x>
+ </presence>
+
+Romeo receives:
+ <iq id="lx4" type="result" from="garden@conference.localhost"/>
+
+Juliet disconnects
+
+Romeo disconnects
+
+# recording ended on 2019-08-31T13:45:32Z
diff --git a/spec/scansion/muc_members_only_change.scs b/spec/scansion/muc_members_only_change.scs
index dc40b5a0..a708dbfb 100644
--- a/spec/scansion/muc_members_only_change.scs
+++ b/spec/scansion/muc_members_only_change.scs
@@ -94,7 +94,7 @@ Romeo sends:
<item affiliation='none' jid="${Juliet's JID}" />
</query>
</iq>
-
+
# As a non-member, Juliet must now be removed from the room
Romeo receives:
<presence type='unavailable' from='room@conference.localhost/Juliet'>
diff --git a/spec/scansion/muc_nickname_change.scs b/spec/scansion/muc_nickname_change.scs
new file mode 100644
index 00000000..73f81203
--- /dev/null
+++ b/spec/scansion/muc_nickname_change.scs
@@ -0,0 +1,127 @@
+# MUC: Change nickname
+# Make sure a role is not reset, see #1466
+
+[Client] Romeo
+ jid: user@localhost
+ password: password
+
+[Client] Juliet
+ jid: user2@localhost
+ password: password
+
+-----
+
+Romeo connects
+
+Romeo sends:
+ <presence to="room@conference.localhost/Romeo">
+ <x xmlns="http://jabber.org/protocol/muc"/>
+ </presence>
+
+Romeo receives:
+ <presence from='room@conference.localhost/Romeo'>
+ <x xmlns='http://jabber.org/protocol/muc#user'>
+ <status code='201'/>
+ <item jid="${Romeo's full JID}" affiliation='owner' role='moderator'/>
+ <status code='110'/>
+ </x>
+ </presence>
+
+Romeo receives:
+ <message type='groupchat' from='room@conference.localhost'><subject/></message>
+
+Romeo sends:
+ <iq id='config1' to='room@conference.localhost' type='set'>
+ <query xmlns='http://jabber.org/protocol/muc#owner'>
+ <x xmlns='jabber:x:data' type='submit'>
+ <field var='FORM_TYPE'>
+ <value>http://jabber.org/protocol/muc#roomconfig</value>
+ </field>
+ <field var='muc#roomconfig_moderatedroom'>
+ <value>1</value>
+ </field>
+ </x>
+ </query>
+ </iq>
+
+Romeo receives:
+ <iq id="config1" from="room@conference.localhost" type="result"/>
+
+Juliet connects
+
+Juliet sends:
+ <presence to="room@conference.localhost/Juliet">
+ <x xmlns="http://jabber.org/protocol/muc"/>
+ </presence>
+
+Juliet receives:
+ <presence from='room@conference.localhost/Romeo'>
+ <x xmlns='http://jabber.org/protocol/muc#user'>
+ <item role='moderator' xmlns='http://jabber.org/protocol/muc#user' affiliation='owner'/>
+ </x>
+ </presence>
+
+Juliet receives:
+ <presence from='room@conference.localhost/Juliet'>
+ <x xmlns='http://jabber.org/protocol/muc#user'>
+ <item jid="${Juliet's full JID}" affiliation='none' role='visitor'/>
+ <status code='110'/>
+ </x>
+ </presence>
+
+
+Juliet receives:
+ <message type='groupchat' from='room@conference.localhost'><subject/></message>
+
+Romeo receives:
+ <presence from='room@conference.localhost/Juliet'>
+ <x xmlns='http://jabber.org/protocol/muc#user'>
+ <item affiliation="none" role="visitor" jid="${Juliet's full JID}"/>
+ </x>
+ </presence>
+
+Romeo sends:
+ <iq id='config1' to='room@conference.localhost' type='set'>
+ <query xmlns='http://jabber.org/protocol/muc#owner'>
+ <x xmlns='jabber:x:data' type='submit'>
+ <field var='FORM_TYPE'>
+ <value>http://jabber.org/protocol/muc#roomconfig</value>
+ </field>
+ <field var='muc#roomconfig_moderatedroom'>
+ <value>0</value>
+ </field>
+ </x>
+ </query>
+ </iq>
+
+Romeo receives:
+ <iq id="config1" from="room@conference.localhost" type="result"/>
+
+Juliet receives:
+ <message type='groupchat' from='room@conference.localhost'>
+ <x xmlns='http://jabber.org/protocol/muc#user'>
+ <status xmlns='http://jabber.org/protocol/muc#user' code='104'/>
+ </x>
+ </message>
+
+Juliet sends:
+ <presence to="room@conference.localhost/Juliet2">
+ </presence>
+
+Juliet receives:
+ <presence from='room@conference.localhost/Juliet' type='unavailable'>
+ <x xmlns='http://jabber.org/protocol/muc#user'>
+ <status code='303'/>
+ <item nick='Juliet2' jid="${Juliet's full JID}" affiliation='none' role='visitor'/>
+ <status code='110'/>
+ </x>
+ </presence>
+
+Juliet receives:
+ <presence from='room@conference.localhost/Juliet2'>
+ <x xmlns='http://jabber.org/protocol/muc#user'>
+ <item jid="${Juliet's full JID}" affiliation='none' role='visitor'/>
+ <status code='110'/>
+ </x>
+ </presence>
+
diff --git a/spec/scansion/muc_password.scs b/spec/scansion/muc_password.scs
index 82611183..63c821e0 100644
--- a/spec/scansion/muc_password.scs
+++ b/spec/scansion/muc_password.scs
@@ -58,7 +58,7 @@ Juliet sends:
Juliet receives:
<presence from="room@conference.localhost/Juliet" type="error">
- <error type="auth" code="401">
+ <error type="auth" code="401" by="room@conference.localhost">
<not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</presence>
diff --git a/spec/scansion/muc_register.scs b/spec/scansion/muc_register.scs
index e1eaf4e0..81612829 100644
--- a/spec/scansion/muc_register.scs
+++ b/spec/scansion/muc_register.scs
@@ -100,7 +100,9 @@ Juliet receives:
<field type='hidden' var='FORM_TYPE'>
<value>http://jabber.org/protocol/muc#register</value>
</field>
- <field type='text-single' label='Nickname' var='muc#register_roomnick'/>
+ <field type='text-single' label='Nickname' var='muc#register_roomnick'>
+ <required/>
+ </field>
</x>
</query>
</iq>
@@ -175,7 +177,7 @@ Rosaline sends:
Rosaline receives:
<presence type='error' from='room@conference.localhost/Juliet'>
- <error type='cancel'>
+ <error type='cancel' by='room@conference.localhost'>
<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
<x xmlns='http://jabber.org/protocol/muc'/>
@@ -286,7 +288,7 @@ Rosaline sends:
Rosaline receives:
<presence type='error' from='room@conference.localhost/Juliet'>
- <error type='cancel'>
+ <error type='cancel' by='room@conference.localhost'>
<conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
<x xmlns='http://jabber.org/protocol/muc'/>
@@ -326,7 +328,7 @@ Romeo receives:
</iq>
# Romeo updates his own registration
-
+
Romeo sends:
<iq id='jw81b36f' to='room@conference.localhost' type='get'>
<query xmlns='jabber:iq:register'/>
@@ -339,7 +341,9 @@ Romeo receives:
<field type='hidden' var='FORM_TYPE'>
<value>http://jabber.org/protocol/muc#register</value>
</field>
- <field type='text-single' label='Nickname' var='muc#register_roomnick'/>
+ <field type='text-single' label='Nickname' var='muc#register_roomnick'>
+ <required/>
+ </field>
</x>
</query>
</iq>
diff --git a/spec/scansion/muc_subject_issue_667.scs b/spec/scansion/muc_subject_issue_667.scs
new file mode 100644
index 00000000..74980073
--- /dev/null
+++ b/spec/scansion/muc_subject_issue_667.scs
@@ -0,0 +1,129 @@
+# #667 MUC message with subject and body SHALL NOT be interpreted as a subject change
+
+[Client] Romeo
+ password: password
+ jid: romeo@localhost
+
+-----
+
+Romeo connects
+
+# and creates a room
+Romeo sends:
+ <presence to="issue667@conference.localhost/Romeo">
+ <x xmlns="http://jabber.org/protocol/muc"/>
+ </presence>
+
+Romeo receives:
+ <presence from="issue667@conference.localhost/Romeo">
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <status code="201"/>
+ <item affiliation="owner" role="moderator" jid="${Romeo's full JID}"/>
+ <status code="110"/>
+ </x>
+ </presence>
+
+# the default (empty) subject
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost">
+ <subject/>
+ </message>
+
+# this should be treated as a normal message
+Romeo sends:
+ <message to="issue667@conference.localhost" type="groupchat">
+ <subject>Greetings</subject>
+ <body>Hello everyone</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost/Romeo">
+ <subject>Greetings</subject>
+ <body>Hello everyone</body>
+ </message>
+
+# Resync
+Romeo sends:
+ <presence to="issue667@conference.localhost/Romeo">
+ <x xmlns="http://jabber.org/protocol/muc"/>
+ </presence>
+
+# Presences
+Romeo receives:
+ <presence from="issue667@conference.localhost/Romeo">
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <item affiliation="owner" role="moderator" jid="${Romeo's full JID}"/>
+ <status code="110"/>
+ </x>
+ </presence>
+
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost/Romeo">
+ <subject>Greetings</subject>
+ <body>Hello everyone</body>
+ </message>
+
+# the still empty subject
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost">
+ <subject/>
+ </message>
+
+# this is a subject change
+Romeo sends:
+ <message to="issue667@conference.localhost" type="groupchat">
+ <subject>Something to talk about</subject>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost/Romeo">
+ <subject>Something to talk about</subject>
+ </message>
+
+# a message without <subject>
+Romeo sends:
+ <message to="issue667@conference.localhost" type="groupchat">
+ <body>Lorem ipsum dolor sit amet</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost/Romeo">
+ <body>Lorem ipsum dolor sit amet</body>
+ </message>
+
+# Resync
+Romeo sends:
+ <presence to="issue667@conference.localhost/Romeo">
+ <x xmlns="http://jabber.org/protocol/muc"/>
+ </presence>
+
+# Presences
+Romeo receives:
+ <presence from="issue667@conference.localhost/Romeo">
+ <x xmlns="http://jabber.org/protocol/muc#user">
+ <item affiliation="owner" role="moderator" jid="${Romeo's full JID}"/>
+ <status code="110"/>
+ </x>
+ </presence>
+
+# History
+# These have delay tags but we ignore those for now
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost/Romeo">
+ <subject>Greetings</subject>
+ <body>Hello everyone</body>
+ </message>
+
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost/Romeo">
+ <body>Lorem ipsum dolor sit amet</body>
+ </message>
+
+# Finally, the topic
+Romeo receives:
+ <message type="groupchat" from="issue667@conference.localhost/Romeo">
+ <subject>Something to talk about</subject>
+ </message>
+
+Romeo disconnects
+
diff --git a/spec/scansion/presence_preapproval.scs b/spec/scansion/presence_preapproval.scs
new file mode 100644
index 00000000..e34ac7cf
--- /dev/null
+++ b/spec/scansion/presence_preapproval.scs
@@ -0,0 +1,74 @@
+# server supports contact subscription pre-approval (RFC 6121 3.4)
+
+[Client] Alice
+ jid: preappove-a@localhost
+ password: password
+
+[Client] Bob
+ jid: preapprove-b@localhost
+ password: password
+
+---------
+
+Alice connects
+
+Alice sends:
+ <presence/>
+
+Alice receives:
+ <presence/>
+
+Alice sends:
+ <presence to="${Bob's JID}" type="subscribed"/>
+
+Bob connects
+
+Bob sends:
+ <iq type="get" id="roster1">
+ <query xmlns="jabber:iq:roster"/>
+ </iq>
+
+Bob receives:
+ <iq type="result" id="roster1">
+ <query xmlns="jabber:iq:roster" ver="{scansion:any}">
+ </query>
+ </iq>
+
+Bob sends:
+ <presence/>
+
+Bob receives:
+ <presence from="${Bob's full JID}"/>
+
+Bob sends:
+ <presence to="${Alice's JID}" type="subscribe" />
+
+Bob receives:
+ <iq type='set' id='{scansion:any}'>
+ <query ver='1' xmlns='jabber:iq:roster'>
+ <item jid="${Alice's JID}" subscription='none' ask='subscribe' />
+ </query>
+ </iq>
+
+
+
+Bob receives:
+ <presence from="${Alice's JID}" type="subscribed" />
+
+Bob disconnects
+
+Alice sends:
+ <iq type="get" id="roster1">
+ <query xmlns="jabber:iq:roster"/>
+ </iq>
+
+Alice receives:
+ <iq type="result" id="roster1">
+ <query xmlns="jabber:iq:roster" ver="{scansion:any}">
+ <item jid="${Bob's JID}" subscription="from" />
+ </query>
+ </iq>
+
+Alice disconnects
+
+Bob disconnects
diff --git a/spec/scansion/prosody.cfg.lua b/spec/scansion/prosody.cfg.lua
index f95ea31b..3f804c4e 100644
--- a/spec/scansion/prosody.cfg.lua
+++ b/spec/scansion/prosody.cfg.lua
@@ -8,16 +8,17 @@ modules_enabled = {
-- Generally required
"roster"; -- Allow users to have a roster. Recommended ;)
"saslauth"; -- Authentication for clients and servers. Recommended if you want to log in.
- "tls"; -- Add support for secure TLS on c2s/s2s connections
- "dialback"; -- s2s dialback support
+ --"tls"; -- Add support for secure TLS on c2s/s2s connections
+ --"dialback"; -- s2s dialback support
"disco"; -- Service discovery
-- Not essential, but recommended
"carbons"; -- Keep multiple clients in sync
- "pep"; -- Enables users to publish their mood, activity, playing music and more
+ "pep"; -- Enables users to publish their avatar, mood, activity, playing music and more
"private"; -- Private XML storage (for room bookmarks, etc.)
"blocklist"; -- Allow users to block communications with other users
- "vcard"; -- Allow users to set vCards
+ "vcard4"; -- User profiles (stored in PEP)
+ "vcard_legacy"; -- Conversion between legacy vCard and PEP Avatar, vcard
-- Nice to have
"version"; -- Replies to server version requests
@@ -26,6 +27,11 @@ modules_enabled = {
"ping"; -- Replies to XMPP pings with pongs
"register"; -- Allow users to register on this server using a client and change passwords
"mam"; -- Store messages in an archive and allow users to access it
+ --"csi_simple"; -- Simple Mobile optimizations
+
+ -- Admin interfaces
+ --"admin_adhoc"; -- Allows administration via an XMPP client that supports ad-hoc commands
+ --"admin_telnet"; -- Opens telnet console interface on localhost port 5582
-- HTTP modules
--"bosh"; -- Enable BOSH clients, aka "Jabber over HTTP"
@@ -47,6 +53,9 @@ modules_enabled = {
--"scansion_record"; -- Records things that happen in scansion test case format
}
+modules_disabled = {
+ "s2s";
+}
certificate = "certs"
allow_registration = false
diff --git a/spec/scansion/pubsub_basic.scs b/spec/scansion/pubsub_basic.scs
index d983ff66..0adf6857 100644
--- a/spec/scansion/pubsub_basic.scs
+++ b/spec/scansion/pubsub_basic.scs
@@ -32,7 +32,7 @@ Juliet connects
-- <subscribe node="princely_musings" jid="${Romeo's full JID}"/>
-- </pubsub>
-- </iq>
---
+--
-- Juliet receives:
-- <iq type="error"/>
diff --git a/spec/scansion/pubsub_preconditions.scs b/spec/scansion/pubsub_preconditions.scs
new file mode 100644
index 00000000..25afaa8d
--- /dev/null
+++ b/spec/scansion/pubsub_preconditions.scs
@@ -0,0 +1,234 @@
+# Pubsub preconditions are enforced
+
+[Client] Romeo
+ password: password
+ jid: jqpcrbq2@localhost
+
+-----
+
+Romeo connects
+
+Romeo sends:
+ <iq id="67eb1f47-1e69-4cb3-91e2-4d5943e72d4c" type="set">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
+ <publish node="http://jabber.org/protocol/tune">
+ <item id="current">
+ <tune xmlns="http://jabber.org/protocol/tune"/>
+ </item>
+ </publish>
+ </pubsub>
+ </iq>
+
+Romeo receives:
+ <iq id="67eb1f47-1e69-4cb3-91e2-4d5943e72d4c" type="result">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
+ <publish node="http://jabber.org/protocol/tune">
+ <item id="current"/>
+ </publish>
+ </pubsub>
+ </iq>
+
+Romeo sends:
+ <iq id="52d74a36-afb0-4028-87ed-b25b988b049e" type="get">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
+ <configure node="http://jabber.org/protocol/tune"/>
+ </pubsub>
+ </iq>
+
+Romeo receives:
+ <iq id="52d74a36-afb0-4028-87ed-b25b988b049e" type="result">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
+ <configure node="http://jabber.org/protocol/tune">
+ <x xmlns="jabber:x:data" type="form">
+ <field var="FORM_TYPE" type="hidden">
+ <value>http://jabber.org/protocol/pubsub#node_config</value>
+ </field>
+ <field var="pubsub#title" label="Title" type="text-single"/>
+ <field var="pubsub#description" label="Description" type="text-single"/>
+ <field var="pubsub#type" label="The type of node data, usually specified by the namespace of the payload (if any)" type="text-single"/>
+ <field var="pubsub#max_items" label="Max # of items to persist" type="text-single">
+ <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="xs:integer"/>
+ <value>1</value>
+ </field>
+ <field var="pubsub#persist_items" label="Persist items to storage" type="boolean">
+ <value>1</value>
+ </field>
+ <field var="pubsub#access_model" label="Specify the subscriber model" type="list-single">
+ <option label="authorize">
+ <value>authorize</value>
+ </option>
+ <option label="open">
+ <value>open</value>
+ </option>
+ <option label="presence">
+ <value>presence</value>
+ </option>
+ <option label="roster">
+ <value>roster</value>
+ </option>
+ <option label="whitelist">
+ <value>whitelist</value>
+ </option>
+ <value>presence</value>
+ </field>
+ <field var="pubsub#publish_model" label="Specify the publisher model" type="list-single">
+ <option label="publishers">
+ <value>publishers</value>
+ </option>
+ <option label="subscribers">
+ <value>subscribers</value>
+ </option>
+ <option label="open">
+ <value>open</value>
+ </option>
+ <value>publishers</value>
+ </field>
+ <field var="pubsub#deliver_notifications" label="Whether to deliver event notifications" type="boolean">
+ <value>1</value>
+ </field>
+ <field var="pubsub#deliver_payloads" label="Whether to deliver payloads with event notifications" type="boolean">
+ <value>1</value>
+ </field>
+ <field var="pubsub#notification_type" label="Specify the delivery style for notifications" type="list-single">
+ <option label="Messages of type normal">
+ <value>normal</value>
+ </option>
+ <option label="Messages of type headline">
+ <value>headline</value>
+ </option>
+ <value>headline</value>
+ </field>
+ <field var="pubsub#notify_delete" label="Whether to notify subscribers when the node is deleted" type="boolean">
+ <value>1</value>
+ </field>
+ <field var="pubsub#notify_retract" label="Whether to notify subscribers when items are removed from the node" type="boolean">
+ <value>1</value>
+ </field>
+ </x>
+ </configure>
+ </pubsub>
+ </iq>
+
+Romeo sends:
+ <iq id="a73aac09-74be-4ee2-97e5-571bbdbcd956" type="set">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub#owner">
+ <configure node="http://jabber.org/protocol/tune">
+ <x xmlns="jabber:x:data" type="submit">
+ <field var="FORM_TYPE" type="hidden">
+ <value>http://jabber.org/protocol/pubsub#node_config</value>
+ </field>
+ <field var="pubsub#title" type="text-single" label="Title">
+ <value>Nice tunes</value>
+ </field>
+ <field var="pubsub#description" type="text-single" label="Description"/>
+ <field var="pubsub#type" type="text-single" label="The type of node data, usually specified by the namespace of the payload (if any)"/>
+ <field var="pubsub#max_items" type="text-single" label="Max # of items to persist">
+ <validate xmlns="http://jabber.org/protocol/xdata-validate" datatype="xs:integer"/>
+ <value>1</value>
+ </field>
+ <field var="pubsub#persist_items" type="boolean" label="Persist items to storage">
+ <value>1</value>
+ </field>
+ <field var="pubsub#access_model" type="list-single" label="Specify the subscriber model">
+ <option label="authorize">
+ <value>authorize</value>
+ </option>
+ <option label="open">
+ <value>open</value>
+ </option>
+ <option label="presence">
+ <value>presence</value>
+ </option>
+ <option label="roster">
+ <value>roster</value>
+ </option>
+ <option label="whitelist">
+ <value>whitelist</value>
+ </option>
+ <value>presence</value>
+ </field>
+ <field var="pubsub#publish_model" type="list-single" label="Specify the publisher model">
+ <option label="publishers">
+ <value>publishers</value>
+ </option>
+ <option label="subscribers">
+ <value>subscribers</value>
+ </option>
+ <option label="open">
+ <value>open</value>
+ </option>
+ <value>publishers</value>
+ </field>
+ <field var="pubsub#deliver_notifications" type="boolean" label="Whether to deliver event notifications">
+ <value>1</value>
+ </field>
+ <field var="pubsub#deliver_payloads" type="boolean" label="Whether to deliver payloads with event notifications">
+ <value>1</value>
+ </field>
+ <field var="pubsub#notification_type" type="list-single" label="Specify the delivery style for notifications">
+ <option label="Messages of type normal">
+ <value>normal</value>
+ </option>
+ <option label="Messages of type headline">
+ <value>headline</value>
+ </option>
+ <value>headline</value>
+ </field>
+ <field var="pubsub#notify_delete" type="boolean" label="Whether to notify subscribers when the node is deleted">
+ <value>1</value>
+ </field>
+ <field var="pubsub#notify_retract" type="boolean" label="Whether to notify subscribers when items are removed from the node">
+ <value>1</value>
+ </field>
+ </x>
+ </configure>
+ </pubsub>
+ </iq>
+
+Romeo receives:
+ <iq id="a73aac09-74be-4ee2-97e5-571bbdbcd956" type="result"/>
+
+Romeo sends:
+ <iq id="ab0e92d2-c06b-4987-9d45-f9f9e7721709" type="get">
+ <query xmlns="http://jabber.org/protocol/disco#items"/>
+ </iq>
+
+Romeo receives:
+ <iq id="ab0e92d2-c06b-4987-9d45-f9f9e7721709" type="result">
+ <query xmlns="http://jabber.org/protocol/disco#items">
+ <item name="Nice tunes" node="http://jabber.org/protocol/tune" jid="${Romeo's JID}"/>
+ </query>
+ </iq>
+
+Romeo sends:
+ <iq id="67eb1f47-1e69-4cb3-91e2-4d5943e72d4c" type="set">
+ <pubsub xmlns="http://jabber.org/protocol/pubsub">
+ <publish node="http://jabber.org/protocol/tune">
+ <item id="current">
+ <tune xmlns="http://jabber.org/protocol/tune"/>
+ </item>
+ </publish>
+ <publish-options>
+ <x xmlns="jabber:x:data">
+ <field var="FORM_TYPE" type="hidden">
+ <value>http://jabber.org/protocol/pubsub#publish-options</value>
+ </field>
+ <field var="pubsub#access_model">
+ <value>whitelist</value>
+ </field>
+ </x>
+ </publish-options>
+ </pubsub>
+ </iq>
+
+Romeo receives:
+ <iq type='error' id='67eb1f47-1e69-4cb3-91e2-4d5943e72d4c'>
+ <error type='cancel'>
+ <conflict xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
+ <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Field does not match: access_model</text>
+ <precondition-not-met xmlns='http://jabber.org/protocol/pubsub#errors'/>
+ </error>
+ </iq>
+
+Romeo disconnects
+