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
Collaborator

Summary

Add functional tests for the /autoping command and automatic server ping functionality (XEP-0199).

Changes

  • Add test_autoping.c and test_autoping.h with 6 new functional tests
  • Integrate tests into functionaltests.c test groups
  • Update Makefile.am to include new test files

Tests Added

Fast tests (Group 1 - no timer delays)

Test Description
autoping_set_interval Verify /autoping 60 sets ping interval
autoping_set_zero_disables Verify /autoping 0 disables autoping
autoping_timeout_set Verify /autoping timeout 15 sets timeout
autoping_timeout_zero_disables Verify /autoping timeout 0 disables timeout

Slow tests (Group 3 - require timer waits)

Test Description
autoping_sends_ping_after_interval Verify ping IQ is sent after configured interval
autoping_server_not_supporting_ping Verify graceful handling of <service-unavailable/> error

Testing

[] CI

Resolved #84

## Summary Add functional tests for the `/autoping` command and automatic server ping functionality (XEP-0199). ## Changes - Add `test_autoping.c` and `test_autoping.h` with 6 new functional tests - Integrate tests into `functionaltests.c` test groups - Update `Makefile.am` to include new test files ## Tests Added ### Fast tests (Group 1 - no timer delays) | Test | Description | |------|-------------| | `autoping_set_interval` | Verify `/autoping 60` sets ping interval | | `autoping_set_zero_disables` | Verify `/autoping 0` disables autoping | | `autoping_timeout_set` | Verify `/autoping timeout 15` sets timeout | | `autoping_timeout_zero_disables` | Verify `/autoping timeout 0` disables timeout | ### Slow tests (Group 3 - require timer waits) | Test | Description | |------|-------------| | `autoping_sends_ping_after_interval` | Verify ping IQ is sent after configured interval | | `autoping_server_not_supporting_ping` | Verify graceful handling of `<service-unavailable/>` error | ## Testing [] CI Resolved #84
jabber.developer2 added 1 commit 2026-02-10 15:41:24 +00:00
test: add functional tests for autoping (XEP-0199)
Some checks failed
CI Code / Check spelling (pull_request) Successful in 22s
CI Code / Check coding style (pull_request) Successful in 37s
CI Code / Linux (debian) (pull_request) Successful in 6m35s
CI Code / Code Coverage (pull_request) Successful in 9m5s
CI Code / Linux (arch) (pull_request) Successful in 11m0s
CI Code / Linux (ubuntu) (pull_request) Failing after 14m2s
a01afb34b4
- autoping_set_interval: verify /autoping set command
- autoping_set_zero_disables: verify disabling autoping
- autoping_timeout_set: verify /autoping timeout command
- autoping_timeout_zero_disables: verify disabling timeout
- autoping_sends_ping_after_interval: verify automatic ping IQ
- autoping_server_not_supporting_ping: verify error handling

Fast tests (command parsing) in Group 1, slow tests (timer-based) in Group 3.
jabber.developer2 added 1 commit 2026-02-10 20:46:26 +00:00
Add functional tests for /disco command (XEP-0030)
All checks were successful
CI Code / Check spelling (pull_request) Successful in 21s
CI Code / Check coding style (pull_request) Successful in 32s
CI Code / Code Coverage (pull_request) Successful in 4m50s
CI Code / Linux (debian) (pull_request) Successful in 6m20s
CI Code / Linux (ubuntu) (pull_request) Successful in 6m24s
CI Code / Linux (arch) (pull_request) Successful in 11m34s
6393926dfe
- Add 8 tests for disco info and disco items commands
- Fix XEP-0030 compliance bug: show message for empty disco#items results
- Tests cover: identity display, features, server/jid queries, error handling,
  items display, empty results, and connection requirement
jabber.developer2 force-pushed test/autoping-functional-tests from 6393926dfe to a08e57743f 2026-02-11 11:38:53 +00:00 Compare
jabber.developer2 added 1 commit 2026-02-11 12:21:53 +00:00
test(disco): add comprehensive XEP-0030 functional tests
Some checks failed
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Code Coverage (pull_request) Failing after 5m12s
CI Code / Linux (debian) (pull_request) Failing after 7m5s
CI Code / Linux (ubuntu) (pull_request) Failing after 7m12s
CI Code / Linux (arch) (pull_request) Failing after 7m22s
3fc19112c9
Add 7 new tests for /disco command:
- disco_items_to_jid: query items to specific JID
- disco_info_empty_result: handle empty disco#info response
- disco_info_multiple_identities: multiple identity elements
- disco_info_without_name: identity without optional name attr
- disco_items_without_name: items without optional name attr
- disco_info_service_unavailable: error handling for info
- disco_items_error_handling: error handling for items (XEP-0030 §7)

The disco_items_error_handling test documents a bug where disco#items
errors are silently ignored (unlike disco#info which handles them).
This violates XEP-0030 Section 7 which requires error feedback to user.
jabber.developer2 added 1 commit 2026-02-16 08:25:08 +00:00
test(disco): remove disco_items_error_handling test
All checks were successful
CI Code / Check spelling (pull_request) Successful in 1m28s
CI Code / Check coding style (pull_request) Successful in 1m34s
CI Code / Linux (ubuntu) (pull_request) Successful in 9m26s
CI Code / Linux (debian) (pull_request) Successful in 10m23s
CI Code / Code Coverage (pull_request) Successful in 10m30s
CI Code / Linux (arch) (pull_request) Successful in 12m24s
a67f7a2d0c
This test requires the fix from fix/xep-0030-disco-items-error-handling
branch. Moved there along with the source code fix.
Author
Collaborator

Suggested squash commit message:

test: add functional tests for autoping and disco

Add autoping (XEP-0199) tests: interval/timeout configuration,
ping after interval, server not supporting ping.

Add disco (XEP-0030) tests: info/items queries, empty results,
error handling, multiple identities, missing attributes, JID
targeting, connection requirement.

14 disco tests, 6 autoping tests.

Suggested squash commit message: test: add functional tests for autoping and disco Add autoping (XEP-0199) tests: interval/timeout configuration, ping after interval, server not supporting ping. Add disco (XEP-0030) tests: info/items queries, empty results, error handling, multiple identities, missing attributes, JID targeting, connection requirement. 14 disco tests, 6 autoping tests.
jabber.developer2 changed title from WIP: test: add functional tests for autoping (XEP-0199) to test: add functional tests for autoping (XEP-0199) 2026-02-16 08:38:21 +00:00
jabber.developer requested changes 2026-02-16 15:23:07 +00:00
jabber.developer left a comment
Owner

Generally, LGTM. Thanks for the change. A minor improvement would make the PR even better.

Generally, LGTM. Thanks for the change. A minor improvement would make the PR even better.
@@ -0,0 +22,4 @@
{
prof_connect();
prof_input("/autoping set 0");

"Happy path" antipattern. Can we also test invalid values? Like -1, 9999999999, 99.123, string.

"Happy path" antipattern. Can we also test invalid values? Like -1, 9999999999, 99.123, string.
jabber.developer marked this conversation as resolved
admin added 2 commits 2026-03-03 15:57:10 +00:00
fix arch build
Some checks failed
CI Code / Check spelling (pull_request) Successful in 19s
CI Code / Check coding style (pull_request) Successful in 36s
CI Code / Linux (debian) (pull_request) Has been cancelled
CI Code / Linux (arch) (pull_request) Has been cancelled
CI Code / Code Coverage (pull_request) Has been cancelled
CI Code / Linux (ubuntu) (pull_request) Has been cancelled
c78907bb91
admin force-pushed test/autoping-functional-tests from c78907bb91 to 9e1b95a814 2026-03-03 15:57:45 +00:00 Compare
jabber.developer2 manually merged commit 9e1b95a814 into master 2026-03-03 16:24:46 +00:00
jabber.developer changed title from test: add functional tests for autoping (XEP-0199) to test: add functional tests for autoping and service discovery (XEP-0199, XEP-0030) 2026-03-04 11:41:21 +00:00
Sign in to join this conversation.
No description provided.