Skip to content

test: add tests for parser_sandbox._unshare_net_supported (closes #2444) - #2449

Open
tmdeveloper007 wants to merge 2 commits into
utksh1:mainfrom
tmdeveloper007:#2444
Open

test: add tests for parser_sandbox._unshare_net_supported (closes #2444)#2449
tmdeveloper007 wants to merge 2 commits into
utksh1:mainfrom
tmdeveloper007:#2444

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary

Adds unit tests for backend.secuscan.parser_sandbox._unshare_net_supported,a module-level helper that probes for unshare(1) network-namespace support.

Changes

  • New test file: testing/backend/unit/test_parser_sandbox_unshare_supported.py
  • 10 tests covering: non-Linux fallthrough, binary-not-found path,
    successful probe, probe failure, subprocess exceptions, and caching
  • Bug fix: early-return paths in _unshare_net_supported were not setting
    _unshare_available = False before returning, causing cached None
    on subsequent calls (fixed in backend/secuscan/parser_sandbox.py)

Testing

  • All 10 tests pass with python -m pytest testing/backend/unit/test_parser_sandbox_unshare_supported.py --noconftest -v

@utksh1 utksh1 added area:backend Backend API, database, or service work level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label labels Aug 4, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change is reviewed and the backend/lint checks are green. Merge remains blocked by the required frontend audit, which reports the pre-existing high-severity undici vulnerability; I am not bypassing that security gate.

@utksh1

utksh1 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

@tmdeveloper007 Please rebase this PR onto the latest main branch (2f82738) to resolve the merge conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants