Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
98
Issues
98
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
376b2817
Commit
376b2817
authored
Apr 22, 2016
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: Split the connection sequence into two
We can now insert steps between the two parts
parent
38a59c38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
17 deletions
+29
-17
tests/end_to_end/__main__.py
tests/end_to_end/__main__.py
+29
-17
No files found.
tests/end_to_end/__main__.py
View file @
376b2817
...
...
@@ -287,51 +287,59 @@ def handshake_sequence():
partial
(
send_stanza
,
"<handshake xmlns='jabber:component:accept'/>"
))
def
connection_sequence
(
irc_host
,
jid
):
def
connection_
begin_
sequence
(
irc_host
,
jid
):
jid
=
jid
.
format_map
(
common_replacements
)
xpath
=
"/message[@to='"
+
jid
+
"'][@from='irc.localhost@biboumi.localhost']/body[text()='%s']"
xpath_re
=
"/message[@to='"
+
jid
+
"'][@from='irc.localhost@biboumi.localhost']/body[re:test(text(), '%s')]"
return
(
partial
(
expect_stanza
,
xpath
%
(
'Connecting to %s:6697 (encrypted)'
%
irc_host
)),
xpath
%
(
'Connecting to %s:6697 (encrypted)'
%
irc_host
)),
partial
(
expect_stanza
,
xpath
%
'Connection failed: Connection refused'
),
partial
(
expect_stanza
,
xpath
%
(
'Connecting to %s:6670 (encrypted)'
%
irc_host
)),
xpath
%
(
'Connecting to %s:6670 (encrypted)'
%
irc_host
)),
partial
(
expect_stanza
,
xpath
%
'Connection failed: Connection refused'
),
partial
(
expect_stanza
,
xpath
%
(
'Connecting to %s:6667 (not encrypted)'
%
irc_host
)),
xpath
%
(
'Connecting to %s:6667 (not encrypted)'
%
irc_host
)),
partial
(
expect_stanza
,
xpath
%
'Connected to IRC server.'
),
# These two messages can be receive in any order
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: \*\*\* (Checking Ident|Looking up your hostname...)$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: \*\*\* (Checking Ident|Looking up your hostname...)$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: \*\*\* (Checking Ident|Looking up your hostname...)$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: \*\*\* (Checking Ident|Looking up your hostname...)$'
%
irc_host
)),
# These three messages can be received in any order
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: (\*\*\* Found your hostname: .*|ACK multi-prefix|\*\*\* No Ident response)$'
%
irc_host
)),
)
def
connection_end_sequence
(
irc_host
,
jid
):
jid
=
jid
.
format_map
(
common_replacements
)
xpath
=
"/message[@to='"
+
jid
+
"'][@from='irc.localhost@biboumi.localhost']/body[text()='%s']"
xpath_re
=
"/message[@to='"
+
jid
+
"'][@from='irc.localhost@biboumi.localhost']/body[re:test(text(), '%s')]"
return
(
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: Your host is .*$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: Your host is .*$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: This server was created .*$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: This server was created .*$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: There are \d+ users and \d+ invisible on \d+ servers$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: There are \d+ users and \d+ invisible on \d+ servers$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: \d+ channels formed$'
%
irc_host
),
optional
=
True
),
xpath_re
%
(
r
'^%s: \d+ channels formed$'
%
irc_host
),
optional
=
True
),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: I have \d+ clients and \d+ servers$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: I have \d+ clients and \d+ servers$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: \d+ \d+ Current local users \d+, max \d+$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: \d+ \d+ Current local users \d+, max \d+$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: \d+ \d+ Current global users \d+, max \d+$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: \d+ \d+ Current global users \d+, max \d+$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath_re
%
(
r
'^%s: Highest connection count: \d+ \(\d+ clients\) \(\d+ connections received\)$'
%
irc_host
)),
xpath_re
%
(
r
'^%s: Highest connection count: \d+ \(\d+ clients\) \(\d+ connections received\)$'
%
irc_host
)),
partial
(
expect_stanza
,
xpath
%
"- This is charybdis MOTD you might replace it, but if not your friends will
\n
- laugh at you.
\n
"
),
partial
(
expect_stanza
,
...
...
@@ -339,6 +347,10 @@ def connection_sequence(irc_host, jid):
)
def
connection_sequence
(
irc_host
,
jid
):
return
connection_begin_sequence
(
irc_host
,
jid
)
+
connection_end_sequence
(
irc_host
,
jid
)
if
__name__
==
'__main__'
:
atexit
.
register
(
asyncio
.
get_event_loop
().
close
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment