]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Test] Add comprehensive tests for URL deep processing
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 15 Nov 2025 09:49:22 +0000 (09:49 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 15 Nov 2025 09:49:22 +0000 (09:49 +0000)
commit7028883c8f38689ffe58aaf806f348f2cb019507
tree1ece3d73353cd49d2377ac7387b5b42121e00f40
parent6125b6ffe96af76302b5ca7ae363b4d16a026574
[Test] Add comprehensive tests for URL deep processing

Unit tests (test/lua/unit/lua_url_filter.lua):
- filter_url_string basic validation (normal, long user, multiple @)
- filter_url with URL objects
- UTF-8 validation (ASCII, Cyrillic, Japanese, invalid)
- Custom filter registration and chaining
- Issue #5731 regression test (oversized user parsing)

Functional tests (test/functional/cases/001_merged/400_url_suspect.robot):
- Moved to 001_merged for shared setup/teardown
- Long user field (80 chars) - URL_USER_LONG
- Very long user field (300 chars) - URL_USER_VERY_LONG
- Numeric IP - URL_NUMERIC_IP
- Numeric IP with user - URL_NUMERIC_IP_USER
- Suspicious TLD - URL_SUSPICIOUS_TLD
- Multiple @ signs - URL_MULTIPLE_AT_SIGNS
- Normal URLs (no false positives)
- All tests verify R_SUSPICIOUS_URL backward compatibility

Test messages (test/functional/messages/):
- url_suspect_long_user.eml (80-char user)
- url_suspect_very_long_user.eml (300-char user)
- url_suspect_numeric_ip.eml
- url_suspect_numeric_ip_user.eml
- url_suspect_bad_tld.eml
- url_suspect_multiple_at.eml
- url_suspect_normal.eml

Config:
- Enable url_suspect plugin in merged-override.conf
- Add Robot Framework outputs to gitignore
.gitignore
test/functional/cases/001_merged/400_url_suspect.robot [new file with mode: 0644]
test/functional/configs/merged-override.conf
test/functional/messages/url_suspect_bad_tld.eml [new file with mode: 0644]
test/functional/messages/url_suspect_long_user.eml [new file with mode: 0644]
test/functional/messages/url_suspect_multiple_at.eml [new file with mode: 0644]
test/functional/messages/url_suspect_normal.eml [new file with mode: 0644]
test/functional/messages/url_suspect_numeric_ip.eml [new file with mode: 0644]
test/functional/messages/url_suspect_numeric_ip_user.eml [new file with mode: 0644]
test/functional/messages/url_suspect_very_long_user.eml [new file with mode: 0644]
test/lua/unit/lua_url_filter.lua [new file with mode: 0644]