Skip to content

Commit

Permalink
Add some cases to improve CI test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
a13xp0p0v committed Nov 16, 2024
1 parent 301f965 commit d2c5862
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/functional_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,21 @@ coverage run -a --branch bin/kernel-hardening-checker -c ./test.config -v /proc/

echo "Collect coverage for error handling"

echo ">>>>> -a and any config args together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -a -c ./test.config && exit 1
coverage run -a --branch bin/kernel-hardening-checker -a -l /proc/cmdline && exit 1
coverage run -a --branch bin/kernel-hardening-checker -a -s $SYSCTL_EXAMPLE && exit 1
coverage run -a --branch bin/kernel-hardening-checker -a -v /proc/version && exit 1

echo ">>>>> -a and -p together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -p X86_64 -a && exit 1

echo ">>>>> -a and -g together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -g X86_64 -a && exit 1

echo ">>>>> permission denied <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -c /proc/slabinfo && exit 1

echo ">>>>> -c and -p together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -p X86_64 -c ./test.config && exit 1

Expand All @@ -123,19 +138,28 @@ coverage run -a --branch bin/kernel-hardening-checker -g X86_64 -c ./test.config
echo ">>>>> -l without -c <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -l /proc/cmdline && exit 1

echo ">>>>> -s and -v together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -s $SYSCTL_EXAMPLE -v /proc/version && exit 1

echo ">>>>> -s and -p together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -p X86_64 -s $SYSCTL_EXAMPLE && exit 1

echo ">>>>> -s and -g together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -g X86_64 -s $SYSCTL_EXAMPLE && exit 1

echo ">>>>> -p and -v together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -p X86_64 -v /proc/version && exit 1

echo ">>>>> -p and -g together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -p X86_64 -g X86_64 && exit 1

echo ">>>>> wrong modes for -p <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -p X86_64 -m show_ok && exit 1
coverage run -a --branch bin/kernel-hardening-checker -p X86_64 -m show_fail && exit 1

echo ">>>>> -g and -v together <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -g X86_64 -v /proc/version && exit 1

echo ">>>>> wrong mode for -g <<<<<"
coverage run -a --branch bin/kernel-hardening-checker -g X86_64 -m show_ok && exit 1

Expand Down

0 comments on commit d2c5862

Please sign in to comment.