You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by si...@apache.org on 2022/10/26 03:35:50 UTC
svn commit: r1904837 - in /spamassassin/trunk/t: data/spam/decodeshorturl/base.eml decodeshorturl.t
Author: sidney
Date: Wed Oct 26 03:35:50 2022
New Revision: 1904837
URL: http://svn.apache.org/viewvc?rev=1904837&view=rev
Log:
bug 8069 - Use shortened links that are under our control so test remains stable
Modified:
spamassassin/trunk/t/data/spam/decodeshorturl/base.eml
spamassassin/trunk/t/decodeshorturl.t
Modified: spamassassin/trunk/t/data/spam/decodeshorturl/base.eml
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/data/spam/decodeshorturl/base.eml?rev=1904837&r1=1904836&r2=1904837&view=diff
==============================================================================
--- spamassassin/trunk/t/data/spam/decodeshorturl/base.eml (original)
+++ spamassassin/trunk/t/data/spam/decodeshorturl/base.eml Wed Oct 26 03:35:50 2022
@@ -16,9 +16,11 @@ should get 404:
http://tinyurl.com/qqqxxxyyyzzz
-This used to have a blocked bit.ly link but bitly expires all blocked links
-so there is not a good regression test for it.
-
-# activity dot wps dot com
-https://kso.page.link/wps
+This used to have a blocked bit.ly link but bitly expires all blocked links.
+This tests that any shortened link that redirects to the bit.ly blocked page will hit the rule
+If bit.ly ever changes the URL of the blocked link page, this test will still pass but
+the functionality will be broken for actual bit.ly blocked links
+Blocked link: https://sadecodetest.page.link/bitlyblocked
+# should link to https spamassassin dot apache dot org slash news dot html
+https://sadecodetest.page.link/news
Modified: spamassassin/trunk/t/decodeshorturl.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/decodeshorturl.t?rev=1904837&r1=1904836&r2=1904837&view=diff
==============================================================================
--- spamassassin/trunk/t/decodeshorturl.t (original)
+++ spamassassin/trunk/t/decodeshorturl.t Wed Oct 26 03:35:50 2022
@@ -11,7 +11,7 @@ use constant HAS_DBD_SQLITE => eval { re
use constant SQLITE => (HAS_DBI && HAS_DBD_SQLITE);
plan skip_all => "Net tests disabled" unless conf_bool('run_net_tests');
-my $tests = 7;
+my $tests = 8;
$tests += 4 if (SQLITE);
plan tests => $tests;
@@ -33,7 +33,8 @@ body HAS_SHORT_REDIR eval:sho
body SHORT_URL_CHAINED eval:short_url_chained()
body SHORT_URL_404 eval:short_url_404()
body SHORT_URL_C404 eval:short_url_code('404')
-uri URI_PAGE_LINK m,^http://activity\.wps\.com/,
+uri URI_BITLY_BLOCKED m,^https://bitly\.com/a/blocked,
+uri URI_PAGE_LINK m,^https://spamassassin\.apache\.org/news\.html,
});
###
@@ -45,6 +46,7 @@ uri URI_PAGE_LINK m,^http://activity\.w
q{ 1.0 HAS_SHORT_REDIR } => '',
q{ 1.0 SHORT_URL_404 } => '',
q{ 1.0 SHORT_URL_C404 } => '',
+ q{ 1.0 URI_BITLY_BLOCKED } => '',
q{ 1.0 URI_PAGE_LINK } => '',
);
sarun ("-t < data/spam/decodeshorturl/base.eml", \&patterns_run_cb);