Direct ACVP test execution discards pytest's failure status

Open Beginner friendly
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read test/test_acvp.py, especially the main block near line 193, and check the current branch to confirm the behavior and whether it is already fixed. Run the file directly with a passing and a deliberately failing ACVP case, then verify the process exit statuses and that imported pytest runs behave normally. Done means direct execution returns zero on success and nonzero on failure.

Written by the indexing model from the issue text.

Description

The following misuse was identified in a pinned snapshot of IBM/mlca. The observation is limited to that snapshot; the current branch, intended contract, reachability, and any existing fixes should be checked.

Problem
The direct entry point at test/test_acvp.py:193 calls pytest.main(sys.argv) without using its return code. If a PQ KEM or signature known-answer assertion fails, pytest records the failure internally but the script then reaches normal process completion with status zero. Automation invoking the file directly can therefore accept a failed ACVP suite as a successful command; running the same tests through an imported pytest session does not have this discarded-exit-status problem.

Suggested fix
Use raise SystemExit(pytest.main(sys.argv)) or sys.exit with the returned code in the main block. Add subprocess tests for one passing and one deliberately failing ACVP case, verifying exit statuses zero and nonzero respectively while preserving normal imported pytest behavior.


This issue was drafted with AI assistance.

Dominant language
C
Stars
5
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.