Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Closed
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
2 changes: 0 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 Down
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