From e52caa77fe2c6cec7b0116dc8308e0de7f96e870 Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Sat, 10 Feb 2018 11:18:59 +0100 Subject: [PATCH 1/3] Extend duplicates check to rulesets with different platforms --- test/validations/special/run.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/validations/special/run.py b/test/validations/special/run.py index 737fea1001ba..143d6a40c71e 100755 --- a/test/validations/special/run.py +++ b/test/validations/special/run.py @@ -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__)) From effb5680440a423e7510dba7307d695f25fad386 Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Sat, 10 Feb 2018 13:46:10 +0100 Subject: [PATCH 2/3] Use better regex in cleanup script --- test/validations/special/duplicate-whitelist-cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/validations/special/duplicate-whitelist-cleanup.sh b/test/validations/special/duplicate-whitelist-cleanup.sh index 142e1a3432ab..2f0607d8f957 100755 --- a/test/validations/special/duplicate-whitelist-cleanup.sh +++ b/test/validations/special/duplicate-whitelist-cleanup.sh @@ -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 "" src/chrome/content/rules/*.xml | wc -l` if [ $REPEATS -gt 1 ]; then echo $host fi From 3a361e56f9a9372cb728f3bcca4572f5e3542aa1 Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Fri, 2 Mar 2018 09:41:36 +0100 Subject: [PATCH 3/3] Update whitelist contents --- test/validations/special/duplicate-whitelist.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/validations/special/duplicate-whitelist.txt b/test/validations/special/duplicate-whitelist.txt index dfd97c354b6a..7491d3644f2a 100644 --- a/test/validations/special/duplicate-whitelist.txt +++ b/test/validations/special/duplicate-whitelist.txt @@ -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 @@ -74,7 +73,6 @@ www2.scribblelive.com sparxtrading.com suppliesfordreams.org www.techrepublic.com -tesco.com thefederalistpapers.org thompsonhotels.com ti.com