diff options
Diffstat (limited to 'debug_info_test')
-rw-r--r-- | debug_info_test/allowlist.py (renamed from debug_info_test/whitelist.py) | 28 | ||||
-rw-r--r-- | debug_info_test/check_exist.py | 10 | ||||
-rw-r--r-- | debug_info_test/check_ngcc.py | 6 | ||||
-rw-r--r-- | debug_info_test/exist_debug_info.allowlist (renamed from debug_info_test/exist_debug_info.whitelist) | 0 | ||||
-rw-r--r-- | debug_info_test/exist_producer.allowlist (renamed from debug_info_test/exist_producer.whitelist) | 0 | ||||
-rw-r--r-- | debug_info_test/ngcc_comp_path.allowlist (renamed from debug_info_test/ngcc_comp_path.whitelist) | 0 | ||||
-rw-r--r-- | debug_info_test/ngcc_dso_path.allowlist (renamed from debug_info_test/ngcc_dso_path.whitelist) | 2 |
7 files changed, 23 insertions, 23 deletions
diff --git a/debug_info_test/whitelist.py b/debug_info_test/allowlist.py index b53387a8..9cf42af0 100644 --- a/debug_info_test/whitelist.py +++ b/debug_info_test/allowlist.py @@ -3,12 +3,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -"""Whitelist functions.""" +"""Allowlist functions.""" from __future__ import print_function -import os import glob +import os import re @@ -18,20 +18,20 @@ import re # # The performance bottleneck of this script is readelf. Unless this becomes # slower than readelf, don't waste time here. -def is_whitelisted(list_name, pattern): - """Check whether the given pattern is specified in the whitelist. +def is_allowlisted(list_name, pattern): + """Check whether the given pattern is specified in the allowlist. Args: - list_name: name of the whitelist. + list_name: name of the allowlist. pattern: the target string. Returns: True if matched otherwise False. """ - return pattern and whitelists[list_name].match(pattern) + return pattern and allowlists[list_name].match(pattern) -def prepare_whitelist(patterns): +def prepare_allowlist(patterns): """Join and compile the re patterns. Args: @@ -43,26 +43,26 @@ def prepare_whitelist(patterns): return re.compile('|'.join(patterns)) -def load_whitelists(dirname): - """Load whitelists under dirname. +def load_allowlists(dirname): + """Load allowlists under dirname. - A whitelist ends with .whitelist. + An allowlist ends with .allowlist. Args: dirname: path to the dir. Returns: - A dictionary of 'filename' -> whitelist matcher. + A dictionary of 'filename' -> allowlist matcher. """ wlist = {} - for fn in glob.glob(os.path.join(dirname, '*.whitelist')): + for fn in glob.glob(os.path.join(dirname, '*.allowlist')): key = os.path.splitext(os.path.basename(fn))[0] with open(fn, 'r', encoding='utf-8') as f: patterns = f.read().splitlines() patterns = [l for l in patterns if l != ''] patterns = [l for l in patterns if l[0] != '#'] - wlist[key] = prepare_whitelist(patterns) + wlist[key] = prepare_allowlist(patterns) return wlist -whitelists = load_whitelists(os.path.dirname(__file__)) +allowlists = load_allowlists(os.path.dirname(__file__)) diff --git a/debug_info_test/check_exist.py b/debug_info_test/check_exist.py index dbb89127..f2cc7c6b 100644 --- a/debug_info_test/check_exist.py +++ b/debug_info_test/check_exist.py @@ -10,7 +10,7 @@ from __future__ import print_function import os import subprocess -from whitelist import is_whitelisted +from allowlist import is_allowlisted def check_debug_info(dso_path, readelf_content): @@ -24,8 +24,8 @@ def check_debug_info(dso_path, readelf_content): True if debug info section exists, otherwise False. """ - # Return True if it is whitelisted - if is_whitelisted('exist_debug_info', dso_path): + # Return True if it is allowlisted + if is_allowlisted('exist_debug_info', dso_path): return True for l in readelf_content: @@ -46,8 +46,8 @@ def check_producer(dso_path, readelf_content): Notice: If no compile unit in DSO, also return True. """ - # Return True if it is whitelisted - if is_whitelisted('exist_producer', dso_path): + # Return True if it is allowlisted + if is_allowlisted('exist_producer', dso_path): return True # Indicate if there is a producer under each cu diff --git a/debug_info_test/check_ngcc.py b/debug_info_test/check_ngcc.py index 501bb988..c86c220a 100644 --- a/debug_info_test/check_ngcc.py +++ b/debug_info_test/check_ngcc.py @@ -7,7 +7,7 @@ from __future__ import print_function -from whitelist import is_whitelisted +from allowlist import is_allowlisted def not_by_gcc(dso_path, producer, comp_path): @@ -21,10 +21,10 @@ def not_by_gcc(dso_path, producer, comp_path): Returns: False if compiled by gcc otherwise True. """ - if is_whitelisted('ngcc_comp_path', comp_path): + if is_allowlisted('ngcc_comp_path', comp_path): return True - if is_whitelisted('ngcc_dso_path', dso_path): + if is_allowlisted('ngcc_dso_path', dso_path): return True return 'GNU C' not in producer diff --git a/debug_info_test/exist_debug_info.whitelist b/debug_info_test/exist_debug_info.allowlist index e0076fd6..e0076fd6 100644 --- a/debug_info_test/exist_debug_info.whitelist +++ b/debug_info_test/exist_debug_info.allowlist diff --git a/debug_info_test/exist_producer.whitelist b/debug_info_test/exist_producer.allowlist index ee75de72..ee75de72 100644 --- a/debug_info_test/exist_producer.whitelist +++ b/debug_info_test/exist_producer.allowlist diff --git a/debug_info_test/ngcc_comp_path.whitelist b/debug_info_test/ngcc_comp_path.allowlist index 45c5b4a2..45c5b4a2 100644 --- a/debug_info_test/ngcc_comp_path.whitelist +++ b/debug_info_test/ngcc_comp_path.allowlist diff --git a/debug_info_test/ngcc_dso_path.whitelist b/debug_info_test/ngcc_dso_path.allowlist index 8d63a521..858465e0 100644 --- a/debug_info_test/ngcc_dso_path.whitelist +++ b/debug_info_test/ngcc_dso_path.allowlist @@ -1,5 +1,5 @@ # DSOs specified here are not CrOS packages compiled within CrOS SDK. -# CrOS packages should be whitelisted in *_comp_path.whitelist +# CrOS packages should be allowlisted in *_comp_path.allowlist # modules we don't care: .*/binutils/.* .*/binutils-bin/.* |