rewrite tests which exercise multiple container within the
same pod. Preserve the existing testcases, add more.
Note basic coverage for mixed pods - some containers requiring
exclusive CPUs, some not, was already added with the initial batch.
Signed-off-by: Francesco Romani <fromani@redhat.com>
We have tests which cover the case on which a pod
with a single container require multiple CPUs;
rewrite them preserving the testcases and actually
adding coverage.
Add and use stricter checks along the way.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Complete the rewrite the policy option compatibility tests,
rewriting the tests which check compatibility
between the `full-pcpus-only` and `distribute-cpus-across-numa`.
All testcases are preserved.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Rewrite the policy option compatibility tests.
We start with the tests which check the compatibility
between the `full-pcpus-only` and `strict-cpu-reservation`
tests, because the former is the only GA option
at time of writing.
All testcases are preserved.
Signed-off-by: Francesco Romani <fromani@redhat.com>
rewrite the cpumanager e2e tests for the
`strict-cpu-reservation` policy option to fit
into the new layout.
All testcases are preserved.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Rewrite the cpumanager tests to make use of the lessons
learned, more modern idioms, remove obsolete assumptions
and in gneeral remove all the legacy which was accumulating
over the years.
The goal is to have a simpler, flatter and more maintenable
code layout, de-entangle the net of dependency,
making the tests more robust and easier to extend.
In short, this is all about maintainability. All the testcases
will be preserved, and few other can be added along the way.
Comments in the code will explain the code layout decisions
and tradeoff, and provide a good guide to add more tests
in the future.
Special care was added in order to maximize the isolation between
tests, at cost, in selected cases of a controlled and planned
code duplication.
Signed-off-by: Francesco Romani <fromani@redhat.com>
Passing a constant value to gomega.Consistently means that it will not re-check
while running.
Found by linter after removing the suppression rule for the check. It was
disabled earlier because of a bug in the linter.
This fixes the pod with restartable init containers to have a proper
phase after the pod sandbox re-creation.
Currently, the `runtime.PodStatus` cannot retrieve the active container
statuses, which are the container statuses associated with the current
pod sandbox. This adds the `ActiveContainerStatuses` to
`runtime.PodStatus`, allowing it to include the container statuses of
the current pod sandbox, and fixes the kubelet to correctly set the pod
Phase to `Pending` when no active regular containers are present.