e2e: test connection failure
This commit is contained in:
@@ -541,6 +541,7 @@ void XmppComponent::send_presence_error(const std::string& muc_name,
|
|||||||
XmlNode text_node("text");
|
XmlNode text_node("text");
|
||||||
text_node["xmlns"] = STANZA_NS;
|
text_node["xmlns"] = STANZA_NS;
|
||||||
text_node.set_inner(text);
|
text_node.set_inner(text);
|
||||||
|
error.add_child(std::move(text_node));
|
||||||
}
|
}
|
||||||
if (!error_code.empty())
|
if (!error_code.empty())
|
||||||
error["code"] = error_code;
|
error["code"] = error_code;
|
||||||
|
|||||||
@@ -468,6 +468,20 @@ if __name__ == '__main__':
|
|||||||
"<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
|
"<presence from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' />"),
|
||||||
connection_sequence("irc.localhost", '{jid_one}/{resource_one}'),
|
connection_sequence("irc.localhost", '{jid_one}/{resource_one}'),
|
||||||
]),
|
]),
|
||||||
|
Scenario("irc_server_connection_failure",
|
||||||
|
[
|
||||||
|
handshake_sequence(),
|
||||||
|
partial(send_stanza,
|
||||||
|
"<presence from='{jid_one}/{resource_one}' to='#foo%doesnotexist@{biboumi_host}/{nick_one}' />"),
|
||||||
|
partial(expect_stanza,
|
||||||
|
"/message/body[text()='Connecting to doesnotexist:6697 (encrypted)']"),
|
||||||
|
partial(expect_stanza,
|
||||||
|
"/message/body[text()='Connection failed: Domain name not found']"),
|
||||||
|
partial(expect_stanza,
|
||||||
|
("/presence[@from='#foo%doesnotexist@{biboumi_host}/{nick_one}']/muc:x",
|
||||||
|
"/presence/error[@type='cancel']/stanza:item-not-found",
|
||||||
|
"/presence/error[@type='cancel']/stanza:text[text()='Domain name not found']")),
|
||||||
|
]),
|
||||||
Scenario("simple_channel_join",
|
Scenario("simple_channel_join",
|
||||||
[
|
[
|
||||||
handshake_sequence(),
|
handshake_sequence(),
|
||||||
|
|||||||
Reference in New Issue
Block a user