Skip to content

test(monitor): implement unit and fuzz testing for syscallParser - #2788

Open
Rucha0901 wants to merge 1 commit into
kubearmor:mainfrom
Rucha0901:test/syscall-parser-tests
Open

test(monitor): implement unit and fuzz testing for syscallParser#2788
Rucha0901 wants to merge 1 commit into
kubearmor:mainfrom
Rucha0901:test/syscall-parser-tests

Conversation

@Rucha0901

Copy link
Copy Markdown
Contributor

Purpose of PR?:

This PR implements unit and fuzz testing for syscallParser.go which is responsible for binary decoding of system call contexts. It also updates the fuzzing build script to compile these targets.

Fixes #2787

Does this PR introduce a breaking change?

No.

If the changes in this PR are manually verified, list down the scenarios covered::

  1. Compilation Check: Compiled the monitor package and tests targeting Linux using:
    GOOS=linux go test -c ./monitor
    The compilation succeeded with no errors.
  2. Unit Tests Coverage:
    • readContextFromBuff with valid and truncated mock buffers.
    • readArgFromBuff with all supported argument type tags (integers, strings, string arrays, capabilities, syscall names, open/exec/mount/umount flags, ptrace reqs, socket domains/types, UDP messages, DNS query types) and socket address structures (AF_UNIX, AF_INET, AF_INET6).
    • GetHashes with correct/truncated/unknown hashes.
    • GetArgs with variable arguments.
    • Mapping utility helpers (flag formatting, error codes, capability names).
  3. Fuzz Targets Verification: Implemented four native Go fuzzers:
    • FuzzReadContextFromBuff
    • FuzzReadArgFromBuff
    • FuzzGetHashes
    • FuzzGetArgs

Additional information for reviewer? :

None.

Checklist:

  • Bug fix. Fixes test(monitor): implement unit and fuzz testing for syscallParser #2787
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

Signed-off-by: Rucha0901 <imt_2025071@iiitm.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(monitor): implement unit and fuzz testing for syscallParser

1 participant