Skip to content

Commit c70462f

Browse files
authored
Merge pull request #1904 from evgenyz/rename_blacklist_in_tests
Rename blacklist in tests
2 parents a5015ab + f0f43ad commit c70462f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

tests/codestyle/all.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ function test_illicit_function_use {
2222
return 1;
2323
fi
2424

25-
whitelisted=$(echo $codebase | xsed 's/\S*\/source\/oscap_source.c / /g' -)
26-
27-
if grep xmlReadFile $whitelisted; then
25+
codebase_without_xml_read_file=$(echo $codebase | xsed 's/\S*\/source\/oscap_source.c / /g' -)
26+
if grep xmlReadFile $codebase_without_xml_read_file; then
2827
echo "xmlReadFile is not allowed within OpenSCAP project. Please make a use of oscap_source facility."
2928
return 1;
3029
fi

tests/probes/sysctl/test_sysctl_probe_all.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ set -e -o pipefail
88
# non root users
99
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
1010

11-
# non root users are not able to access some kernel params, so they get blacklisted
12-
SYSCTL_BLACKLIST='
11+
# non root users are not able to access some kernel params, so they get excluded
12+
SYSCTL_EXCLUDE='
1313
dev.parport.parport0.autoprobe
1414
fs.protected_hardlinks
1515
fs.protected_fifos
@@ -29,9 +29,9 @@ SYSCTL_BLACKLIST='
2929
vm.mmap_rnd_compat_bits
3030
vm.stat_refresh'
3131

32-
SYSCTL_BLACKLIST_REGEX="$(printf '\|%s' $SYSCTL_BLACKLIST)"
32+
SYSCTL_EXCLUDE_REGEX="$(printf '\|%s' $SYSCTL_EXCLUDE)"
3333
# strip leading '\|'
34-
SYSCTL_BLACKLIST_REGEX=${SYSCTL_BLACKLIST_REGEX:2}
34+
SYSCTL_EXCLUDE_REGEX=${SYSCTL_EXCLUDE_REGEX:2}
3535

3636
function perform_test {
3737
probecheck "sysctl" || return 255
@@ -58,11 +58,11 @@ case $(uname) in
5858
# sysctl has duplicities in output
5959
# hide permission errors like: "sysctl: permission denied on key 'fs.protected_hardlinks'"
6060
# kernel parameters might use "/" and "." separators interchangeably - normalizing
61-
sysctl -aN --deprecated 2> /dev/null | grep -v $SYSCTL_BLACKLIST_REGEX | tr "/" "." | sort -u > "$sysctlNames"
61+
sysctl -aN --deprecated 2> /dev/null | grep -v $SYSCTL_EXCLUDE_REGEX | tr "/" "." | sort -u > "$sysctlNames"
6262
;;
6363
esac
6464

65-
grep unix-sys:name "$result" | grep -v $SYSCTL_BLACKLIST_REGEX | xsed -E 's;.*>(.*)<.*;\1;g' | sort > "$ourNames"
65+
grep unix-sys:name "$result" | grep -v $SYSCTL_EXCLUDE_REGEX | xsed -E 's;.*>(.*)<.*;\1;g' | sort > "$ourNames"
6666

6767
# If procps_ver > 3.3.12 we need to filter *stable_secret and vm.stat_refresh
6868
# options from the sysctl output, for more details see

0 commit comments

Comments
 (0)