test: add functional tests for autoping and service discovery (XEP-0199, XEP-0030) #88

Manually merged
jabber.developer2 merged 4 commits from test/autoping-functional-tests into master 2026-03-03 16:24:46 +00:00
7 changed files with 594 additions and 6 deletions
Showing only changes of commit 9e1b95a814 - Show all commits

View File

@@ -193,7 +193,6 @@ main(int argc, char* argv[])
PROF_FUNC_TEST(disco_info_without_name),
PROF_FUNC_TEST(disco_items_without_name),
PROF_FUNC_TEST(disco_info_service_unavailable),
PROF_FUNC_TEST(disco_items_error_handling),
};
/* ============================================================

View File

@@ -418,28 +418,3 @@ disco_info_service_unavailable(void **state)
assert_true(prof_output_regex("Service discovery failed.*service-unavailable"));
prof_timeout_reset();
}
void
disco_items_error_handling(void **state)
{
/*
* Test that /disco items displays error responses to user.
* Per XEP-0030 Section 7: errors like service-unavailable must be shown.
*/
stbbr_for_query("http://jabber.org/protocol/disco#items",
"<iq to='stabber@localhost/profanity' type='error' from='broken.localhost'>"
"<error type='cancel'>"
"<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>"
"</error>"
"</iq>"
);
prof_connect();
prof_input("/disco items broken.localhost");
prof_timeout(10);
/* Per XEP-0030, error should be displayed to user */
assert_true(prof_output_regex("Service discovery failed.*service-unavailable"));
prof_timeout_reset();
}

View File

@@ -17,4 +17,3 @@ void disco_info_multiple_identities(void **state);
void disco_info_without_name(void **state);
void disco_items_without_name(void **state);
void disco_info_service_unavailable(void **state);
void disco_items_error_handling(void **state);