From d78bd730e5654ba99f1fbdda5ef07b8b271efe4b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 6 Sep 2018 16:44:48 +0100 Subject: spec/scansion: Add scansion scripts used for testing All past, except issue978-multi which fails randomly based on ordering of elements - this is a scansion issue to be resolved. --- spec/scansion/basic.scs | 16 ++ spec/scansion/basic_message.scs | 174 +++++++++++++++++++++ spec/scansion/basic_roster.scs | 39 +++++ spec/scansion/issue505.scs | 77 +++++++++ spec/scansion/issue978-multi.scs | 109 +++++++++++++ spec/scansion/issue978.scs | 84 ++++++++++ spec/scansion/muc_mediated_invite.scs | 74 +++++++++ spec/scansion/muc_password-trunk.scs | 141 +++++++++++++++++ spec/scansion/muc_password.scs | 149 ++++++++++++++++++ spec/scansion/muc_register.scs | 286 ++++++++++++++++++++++++++++++++++ spec/scansion/pubsub_advanced.scs | 162 +++++++++++++++++++ spec/scansion/pubsub_basic.scs | 102 ++++++++++++ spec/scansion/pubsub_createdelete.scs | 61 ++++++++ 13 files changed, 1474 insertions(+) create mode 100644 spec/scansion/basic.scs create mode 100644 spec/scansion/basic_message.scs create mode 100644 spec/scansion/basic_roster.scs create mode 100644 spec/scansion/issue505.scs create mode 100644 spec/scansion/issue978-multi.scs create mode 100644 spec/scansion/issue978.scs create mode 100644 spec/scansion/muc_mediated_invite.scs create mode 100644 spec/scansion/muc_password-trunk.scs create mode 100644 spec/scansion/muc_password.scs create mode 100644 spec/scansion/muc_register.scs create mode 100644 spec/scansion/pubsub_advanced.scs create mode 100644 spec/scansion/pubsub_basic.scs create mode 100644 spec/scansion/pubsub_createdelete.scs (limited to 'spec/scansion') diff --git a/spec/scansion/basic.scs b/spec/scansion/basic.scs new file mode 100644 index 00000000..c88672c1 --- /dev/null +++ b/spec/scansion/basic.scs @@ -0,0 +1,16 @@ +[Client] Romeo + jid: user@localhost + password: password + +--------- + +Romeo connects + +Romeo sends: + + +Romeo receives: + + +Romeo disconnects + diff --git a/spec/scansion/basic_message.scs b/spec/scansion/basic_message.scs new file mode 100644 index 00000000..f01d8925 --- /dev/null +++ b/spec/scansion/basic_message.scs @@ -0,0 +1,174 @@ +# A script testing basic message routing and delivery + +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: juliet@localhost + password: password + +[Client] Juliet's phone + jid: juliet@localhost + password: password + resource: mobile + +--------- + +# Act 1, scene 1 +# The clients connect + +Romeo connects + +Juliet connects + +Juliet's phone connects + +# Romeo publishes his presence. Juliet has not, and so does not receive presence. + +Romeo sends: + + +Romeo receives: + + +# Romeo sends a message to Juliet's full JID + +Romeo sends: + + Hello Juliet! + + +Juliet receives: + + Hello Juliet! + + +# Romeo sends a message to Juliet's phone + +Romeo sends: + + Hello Juliet, on your phone. + + +Juliet's phone receives: + + Hello Juliet, on your phone. + + +# Scene 2 +# This requires the server to support offline messages (which is optional). + +# Romeo sends a message to Juliet's bare JID. This is not immediately delivered, as she +# has not published presence on either of her resources. + +Romeo sends: + + Hello Juliet, are you there? + + +# Juliet sends presence on her phone, and should receive the message there + +Juliet's phone sends: + + +Juliet's phone receives: + + +Juliet's phone receives: + + Hello Juliet, are you there? + + + +# Romeo sends another bare-JID message, it should be delivered +# instantly to Juliet's phone + +Romeo sends: + + Oh, hi! + + +Juliet's phone receives: + + Oh, hi! + + +# Juliet's laptop goes online, but with a negative priority + +Juliet sends: + + -1 + + +Juliet receives: + + -1 + + +Juliet's phone receives: + + -1 + + +# Again, Romeo sends a message to her bare JID, but it should +# only get delivered to her phone: + +Romeo sends: + + How are you? + + +Juliet's phone receives: + + How are you? + + +# Romeo sends direct to Juliet's full JID, and she should receive it + +Romeo sends: + + Are you hiding? + + +Juliet receives: + + Are you hiding? + + +# Juliet publishes non-negative presence + +Juliet sends: + + +Juliet receives: + + +Juliet's phone receives: + + +# And now Romeo's bare JID messages get delivered to both resources +# (server behaviour may vary here) + +Romeo sends: + + There! + + +Juliet receives: + + There! + + +Juliet's phone receives: + + There! + + +# The End + +Romeo disconnects + +Juliet disconnects + +Juliet's phone disconnects diff --git a/spec/scansion/basic_roster.scs b/spec/scansion/basic_roster.scs new file mode 100644 index 00000000..2655639a --- /dev/null +++ b/spec/scansion/basic_roster.scs @@ -0,0 +1,39 @@ +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: juliet@localhost + password: password + +--------- + +Romeo connects + +Juliet connects + +Romeo sends: + + +Romeo receives: + + +Romeo sends: + + + + +Romeo receives: + + + + +Romeo disconnects + +#Juliet receives: +# +# +#Juliet receives: +# +# +#Juliet disconnects diff --git a/spec/scansion/issue505.scs b/spec/scansion/issue505.scs new file mode 100644 index 00000000..6d4d27b7 --- /dev/null +++ b/spec/scansion/issue505.scs @@ -0,0 +1,77 @@ +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + + + +Romeo receives: + + + +# Juliet connects, and joins the room +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + +Juliet sends: + + Farewell + + +Romeo receives: + + Farewell + + + + diff --git a/spec/scansion/issue978-multi.scs b/spec/scansion/issue978-multi.scs new file mode 100644 index 00000000..340f2b27 --- /dev/null +++ b/spec/scansion/issue978-multi.scs @@ -0,0 +1,109 @@ +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +[Client] Juliet's phone + jid: user2@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + + + +Romeo receives: + + + +# Juliet connects, and joins the room +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + +# Juliet's phone connects, and joins the room +Juliet's phone connects + +Juliet's phone sends: + + + + +Juliet's phone receives: + + +Juliet's phone receives: + + +Juliet's phone receives: + + +Romeo receives: + + + + + + + +# Juliet leaves with an error +Juliet sends: + + + + Test error + + + +Romeo receives: + + + + + diff --git a/spec/scansion/issue978.scs b/spec/scansion/issue978.scs new file mode 100644 index 00000000..d47473be --- /dev/null +++ b/spec/scansion/issue978.scs @@ -0,0 +1,84 @@ +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + anyone + + + + + +Romeo receives: + + + +# Juliet connects, and joins the room +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + +Juliet sends: + + + + Test error + + + +Romeo receives: + + Kicked: service unavailable: Test error + + + + + diff --git a/spec/scansion/muc_mediated_invite.scs b/spec/scansion/muc_mediated_invite.scs new file mode 100644 index 00000000..7662fc7b --- /dev/null +++ b/spec/scansion/muc_mediated_invite.scs @@ -0,0 +1,74 @@ +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + + + +Romeo receives: + + + +# Juliet connects +Juliet connects + +Juliet sends: + + +Juliet receives: + + + +# Romeo invites Juliet to join the room + +Romeo sends: + + + + + + +Juliet receives: + + + + + + + room@conference.localhost/Romeo invited you to the room room@conference.localhost + + diff --git a/spec/scansion/muc_password-trunk.scs b/spec/scansion/muc_password-trunk.scs new file mode 100644 index 00000000..0a343b91 --- /dev/null +++ b/spec/scansion/muc_password-trunk.scs @@ -0,0 +1,141 @@ +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + cauldronburn + + + + + +Romeo receives: + + + +# Juliet connects, and tries to join the room (password-protected) +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + + + + + +# Retry with the correct password +Juliet sends: + + + cauldronburn + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + +# Ok, now Juliet leaves, and Romeo unsets the password + +Juliet sends: + + +Romeo receives: + + +Juliet receives: + + +# Remove room password +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + + + + + +# Config change success +Romeo receives: + + + +# Notification of room configuration update +Romeo receives: + + + + + + +# Juliet tries to join (should succeed) +Juliet sends: + + + + +# Notification of Romeo's presence in the room +Juliet receives: + + +Juliet receives: + + +# Room topic +Juliet receives: + + +Romeo receives: + + diff --git a/spec/scansion/muc_password.scs b/spec/scansion/muc_password.scs new file mode 100644 index 00000000..813265a5 --- /dev/null +++ b/spec/scansion/muc_password.scs @@ -0,0 +1,149 @@ +# MUC password test +# Ensures that setting and unsetting a MUC password works, and that the password is +# required to join a password-protected room. + +## prosody-0.9 result: fails because of missing 201 status code (related to issue #328) +## prosody-0.10 result: fails because of missing 201 status code (related to issue #328) + +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + cauldronburn + + + + + +Romeo receives: + + + +# Juliet connects, and tries to join the room (password-protected) +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + + + + + +# Retry with the correct password +Juliet sends: + + + cauldronburn + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + +# Ok, now Juliet leaves, and Romeo unsets the password + +Juliet sends: + + +Romeo receives: + + +Juliet receives: + + +# Remove room password +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + + + + + + +# Config change success +Romeo receives: + + + +# Notification of room configuration update +Romeo receives: + + + + + + +# Juliet tries to join (should succeed) +Juliet sends: + + + + +# Notification of Romeo's presence in the room +Juliet receives: + + +Juliet receives: + + +# Room topic +Juliet receives: + + +Romeo receives: + + diff --git a/spec/scansion/muc_register.scs b/spec/scansion/muc_register.scs new file mode 100644 index 00000000..3bbf251b --- /dev/null +++ b/spec/scansion/muc_register.scs @@ -0,0 +1,286 @@ +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +[Client] Rosaline + jid: user3@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + + + +Romeo receives: + + + +Romeo sends: + + + + + + +Romeo receives: + + +# Juliet connects, and joins the room +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + +# Juliet retrieves the registration form + +Juliet sends: + + + + +Juliet receives: + + + + + http://jabber.org/protocol/muc#register + + + + + + +Juliet sends: + + + + + http://jabber.org/protocol/muc#register + + + Juliet + + + + + +Juliet receives: + + + + + + + +Juliet receives: + + +# Juliet discovers her reserved nick + +Juliet sends: + + + + +Juliet receives: + + + + + + +# Juliet leaves the room: + +Juliet sends: + + +Juliet receives: + + + + + + + +Romeo receives: + + + + + + +# Rosaline connect and tries to join the room as Juliet + +Rosaline connects + +Rosaline sends: + + + + +Rosaline receives: + + + + + + + +# In a heated moment, Juliet unregisters from the room + +Juliet sends: + + + + + + +Juliet receives: + + +# Rosaline attempts once more to sneak into the room, disguised as Juliet + +Rosaline sends: + + + + +Rosaline receives: + + + + + + +Rosaline receives: + + + + + + + +Romeo receives: + + + + + + +# On discovering the ruse, Romeo restores Juliet's nick and status within the room + +Romeo sends: + + + + + + +# Rosaline is evicted from the room + +Romeo receives: + + + + + This nickname is reserved + + + + +Romeo receives: + + +Rosaline receives: + + + + + This nickname is reserved + + + + + +# Rosaline, frustrated, attempts to get back into the room... + +Rosaline sends: + + + + +# ...but once again, is denied + +Rosaline receives: + + + + + + + +# Juliet, however, quietly joins the room with success + +Juliet sends: + + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + diff --git a/spec/scansion/pubsub_advanced.scs b/spec/scansion/pubsub_advanced.scs new file mode 100644 index 00000000..b7b96a22 --- /dev/null +++ b/spec/scansion/pubsub_advanced.scs @@ -0,0 +1,162 @@ +[Client] Balthasar + jid: admin@localhost + password: password + +[Client] Romeo + jid: romeo@localhost + password: password + +[Client] Juliet + jid: juliet@localhost + password: password + +--------- + +Romeo connects + +Romeo sends: + + + + + + +Romeo receives: + + + + + + +Balthasar connects + +Balthasar sends: + + + + + + +Balthasar receives: + + +Balthasar sends: + + + + + + +Balthasar receives: + + + + + + +Juliet connects + +Juliet sends: + + + + + + +Juliet receives: + + +Juliet sends: + + + + + + +Juliet receives: + + + + + + +Balthasar sends: + + + + + + +Balthasar receives: + + + + + + +Balthasar sends: + + + + + + + + +Balthasar receives: + + +Romeo sends: + + + + + + Soliloquy + Lorem ipsum dolor sit amet + + + + + + +Juliet receives: + + + + + + Soliloquy + Lorem ipsum dolor sit amet + + + + + + +Romeo receives: + + +Juliet sends: + + + + + + +Juliet receives: + + +Balthasar sends: + + + + + + +Balthasar receives: + + +Romeo disconnects + +// vim: syntax=xml: diff --git a/spec/scansion/pubsub_basic.scs b/spec/scansion/pubsub_basic.scs new file mode 100644 index 00000000..ec21afdc --- /dev/null +++ b/spec/scansion/pubsub_basic.scs @@ -0,0 +1,102 @@ +[Client] Romeo + jid: admin@localhost + password: password + +// admin@localhost is assumed to have node creation privileges + +[Client] Juliet + jid: juliet@localhost + password: password + +--------- + +Romeo connects + +Romeo sends: + + + + + + +Romeo receives: + + +Juliet connects + +-- Juliet sends: +-- +-- +-- +-- +-- +-- +-- Juliet receives: +-- + +Juliet sends: + + + + + + +Juliet receives: + + +Romeo sends: + + + + + + Soliloquy + Lorem ipsum dolor sit amet + + + + + + +Romeo receives: + + +Juliet receives: + + + + + + Soliloquy + Lorem ipsum dolor sit amet + + + + + + +Juliet sends: + + + + + + +Juliet receives: + + +Juliet disconnects + +Romeo sends: + + + + + + +Romeo receives: + + +Romeo disconnects + +// vim: syntax=xml: diff --git a/spec/scansion/pubsub_createdelete.scs b/spec/scansion/pubsub_createdelete.scs new file mode 100644 index 00000000..f6fd1831 --- /dev/null +++ b/spec/scansion/pubsub_createdelete.scs @@ -0,0 +1,61 @@ +[Client] Romeo + jid: admin@localhost + password: password + +// admin@localhost is assumed to have node creation privileges + +--------- + +Romeo connects + +Romeo sends: + + + + + + +Romeo receives: + + +Romeo sends: + + + + + + +Romeo receives: + + + + + + +Romeo sends: + + + + + + +Romeo receives: + + +Romeo sends: + + + + + + +Romeo receives: + + + + + + +Romeo disconnects + +// vim: syntax=xml: -- cgit v1.2.3