Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/validations/special/duplicate-whitelist-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TMPFILE=`mktemp /tmp/buffer.XXXXXXXX`
trap 'rm "$TMPFILE"' EXIT

for host in `cat test/validations/special/duplicate-whitelist.txt`; do
REPEATS=`grep -F "target host=\"$host\"" src/chrome/content/rules/*.xml | wc -l`
REPEATS=`egrep -l "<target\s+host=\s*\"$host\"\s*/>" src/chrome/content/rules/*.xml | wc -l`
if [ $REPEATS -gt 1 ]; then
echo $host
fi
Expand Down
57 changes: 55 additions & 2 deletions test/validations/special/duplicate-whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ www1.arun.gov.uk
mailing.channel4.com
training.citrix.com
consumerreports.org
c-spanvideo.org
dell.com
www.dell.com
investors.demandware.com
Expand Down Expand Up @@ -74,7 +73,6 @@ www2.scribblelive.com
sparxtrading.com
suppliesfordreams.org
www.techrepublic.com
tesco.com
thefederalistpapers.org
thompsonhotels.com
ti.com
Expand All @@ -97,3 +95,58 @@ www.blogsmithmedia.com
www.hostingcatalog.com
zylon.net
www.zylon.net
www.lduhtrp.net
tpsnews.ca
www.tpsnews.ca
pygmyboats.com
www.pygmyboats.com
hosting.unimatrix.si
www.mediciglobal.com
bbc.co.uk
www.bbc.co.uk
www.linbit.com
petitions.moveon.org
about.fundinfo.com
email.bild.de
direct.asda.com
event.kmd.dk
static.naukri.com
info.mheducation.com
www.wiltshire.police.uk
www.coochey.net
editions.thing.net
www.zdv.uni-mainz.de
www.cherwell.gov.uk
go.sirsidynix.com
amazingcareers.firstdirect.com
www.amazingcareers.firstdirect.com
info.unit4.com
licensing.ofcom.org.uk
styles.ofcom.org.uk
www.autotrader.co.uk
autotrader.co.uk
datafile.com
www.datafile.com
nitroflare.com
www.nitroflare.com
www.scotland.police.uk
*.espivblogs.net
www.20min.ch
m.20min.ch
www.adyadvantage.com
reverb.echo.nasa.gov
thediplomat.com
www.thediplomat.com
www.thefederalistpapers.org
voxmedia.com
marketing.voxmedia.com
product.voxmedia.com
www.voxmedia.com
councilmeetings.lewisham.gov.uk
files.conferencemanager.dk
music.cbc.ca
huuto.net
salattu.huuto.net
www.huuto.net
www.thebureauinvestigates.com
www.upi.com
14 changes: 4 additions & 10 deletions test/validations/special/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,18 @@ def nomes_all(where=sys.argv[1:]):
failure = 1
fail("%s failed test: %s" % (filename, test.__doc__))

platform_list = xpath_ruleset_platform(tree)
if len(platform_list) == 0:
platform = ''
else:
platform = platform_list[0]

targets = xpath_host(tree)
for target in targets:
host_counter.update([(target, platform)])
host_counter.update([target])


for (host, platform), count in host_counter.most_common():
for host, count in host_counter.most_common():
if count > 1:
if host in duplicate_allowed_list:
warn("Whitelisted hostname %s with platform '%s' shows up in %d different rulesets." % (host, platform, count))
warn("Whitelisted hostname %s shows up in %d different rulesets." % (host, count))
else:
failure = 1
fail("Hostname %s with platform '%s' shows up in %d different rulesets." % (host, platform, count))
fail("Hostname %s shows up in %d different rulesets." % (host, count))
if not is_valid_target_host(host):
failure = 1
fail("%s failed: %s" % (host, is_valid_target_host.__doc__))
Expand Down