Commit 575ae82a by Alexander Popov

Test an unexpected line in the sysctl file

parent 5c17fe62
......@@ -125,4 +125,9 @@ echo 'hey man 1' > cmdline
echo 'hey man 2' >> cmdline
coverage run -a --branch bin/kconfig-hardened-check -c test.config -l cmdline && exit 1
echo ">>>>> unexpected line in the sysctl file <<<<<"
cp $SYSCTL_EXAMPLE error_sysctls
echo 'some strange line' >> error_sysctls
coverage run -a --branch bin/kconfig-hardened-check -c test.config -s error_sysctls && exit 1
echo "The end of the functional tests"
......@@ -205,7 +205,7 @@ def parse_sysctl_file(mode, parsed_options, fname):
for line in f.readlines():
line = line.strip()
if not sysctl_pattern.match(line):
sys.exit(f'[!] ERROR: unexpected line in sysctl file: {line}')
sys.exit(f'[!] ERROR: unexpected line in sysctl file: "{line}"')
option, value = line.split('=', 1)
option = option.strip()
value = value.strip()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment