Commit Graph
3 Commits
Author SHA1 Message Date
a81d084c93 fix: validate container_name in container scenario plugin (#1409) (#1410)
* fix: validate container_name in container scenario plugin

The container scenario plugin removed pods and incremented killed_count
even when the requested container_name was never found, causing scenarios
to silently report success with no disruption (issue #1409).

Track whether a container was actually found and killed; only increment
killed_count on a real kill, skip pods that lack the target container,
and raise a clear RuntimeError once all pods are exhausted without a kill.

Adds unit tests covering invalid, valid, empty, heterogeneous, and
count-exceeds-target scenarios.

Closes #1409

* fix: report actual kill count in container-not-found error

When the candidate pod list is exhausted without finding the target
container, the RuntimeError now reports how many containers were
actually killed ("N of M requested container(s) were killed") instead
of always claiming "No containers were killed", which was inaccurate in
partial-success cases.

* fix: only raise container-not-found error when nothing was killed

Address review feedback: the "not found in any matching pod" error was
raised even after one or more containers had already been killed (when
count exceeds the number of pods containing the target), making the
message contradictory.

Now that error only fires when killed_count == 0. When some kills
already happened but the candidate list is exhausted, the loop falls
through to the existing "Trying to kill more containers than were found"
error, which accurately describes that case.

---------

Co-authored-by: augmentcode[bot] <185243770+augmentcode[bot]@users.noreply.github.com>
Co-authored-by: Darshan Jain <darjain@redhat.com>
2026-07-01 00:52:01 +05:30
Paige Patton 35ee9d7bae adding changes to properly pass/fail a scenario if errors occur (#1065)
Signed-off-by: Paige Patton <prubenda@redhat.com>
2026-03-31 12:31:25 -04:00
Paige Patton a373dcf453 adding virt checker tests (#960)
Functional & Unit Tests / Functional & Unit Tests (push) Failing after 3m45s
Functional & Unit Tests / Generate Coverage Badge (push) Has been skipped
Signed-off-by: Paige Patton <prubenda@redhat.com>
2025-11-18 14:27:59 -05:00