Thu, 23 Mar 2023 12:14:53 +0000
client: Fix timeout handling
Previously, the timeout handler would fire an error that would get caught and
logged by the timer code. However that error never reached the upper levels of
scansion, leading to the whole thing just hanging.
Now we just trigger resumption of the async runner, and throw the error from
there if we haven't received the stanza yet.
With this change, timeouts are now correctly handled and reported as failures.
166
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 | # Scansion - Automated XMPP Client |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 | Scansion is an automated scriptable XMPP client, useful for testing and |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 | automating tasks. It is primarily designed to be a handy tool in an XMPP |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 | developer's toolbox, however its scripting language is designed to be easy |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 | to read and write by non-programmers who understand basic XML and XMPP. |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 | An example Scansion script: |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 | ```xml |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 | # Pubsub: Test node creation |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 | [Client] Romeo |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 | jid: admin@localhost |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 | password: password |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 | [Client] Juliet |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 | jid: juliet@localhost |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 | password: password |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 | --------- |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 | Romeo connects |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 | # Create the node |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 | Romeo sends: |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 | <iq type='set' to='pubsub.localhost' id='create-node'> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 | <pubsub xmlns='http://jabber.org/protocol/pubsub'> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 | <create node='princely_musings'/> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 | </pubsub> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 | </iq> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
32 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 | # Server acknowledges successful creation |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 | Romeo receives: |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
35 | <iq type='result' id='create-node'/> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
36 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
37 | # Juliet sees the node appear in the node list |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
38 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
39 | Juliet connects |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
40 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
41 | Juliet sends: |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
42 | <iq type='get' id='list-nodes' to='pubsub.localhost'> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
43 | <query xmlns='http://jabber.org/protocol/disco#items'/> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
44 | </iq> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
45 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
46 | Juliet receives: |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
47 | <iq type='result' id='list-nodes' from='pubsub.localhost'> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
48 | <query xmlns='http://jabber.org/protocol/disco#items'> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
49 | <item xmlns='http://jabber.org/protocol/disco#items' jid='pubsub.localhost' node='princely_musings'/> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
50 | </query> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
51 | </iq> |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
52 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
53 | # Yay! |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
54 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
55 | ``` |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
56 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
57 | This example demonstrates how Scansion: |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
58 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
59 | - Supports multiple characters in a script |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
60 | - Takes care of establishing a connection and authentication |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
61 | - Automatically verifies responses to stanzas |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
62 | |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
63 | This final point is what makes Scansion a great tool for testing - it |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
64 | has a flexible matching system that allows you to ensure a certain stanza |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
65 | receives the response you expect. |
5d39804f108b
docs: Add initial documentation
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
66 |