Skip to content

e2e-ish: add support for DRA. - #865

Open
klihub wants to merge 3 commits into
stacked/klihub/e2eish/resizefrom
stacked/klihub/e2eish/dra-replay
Open

klihub wants to merge 3 commits into
stacked/klihub/e2eish/resizefrom
stacked/klihub/e2eish/dra-replay

Conversation

@klihub

@klihub klihub commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Add e2d-ish support for recording and replaying e2e tests involving DRA. Add an e2e-ish generated DRA device unit test corresponding to the topology-aware n4c16/test42-dra-devices e2e test.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@klihub
klihub added this pull request to stack #848 October 20, 2026 05:17
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from bec4dde to b28a5ef Compare October 20, 2026 07:55
@klihub
klihub removed this pull request from stack #848 October 20, 2026 08:38
@klihub
klihub added this pull request to stack #867 October 20, 2026 08:39
@bart0sh
bart0sh force-pushed the stacked/klihub/e2eish/dra-replay branch from b28a5ef to 1726c23 Compare October 20, 2026 09:11
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 1726c23 to c66f997 Compare October 20, 2026 11:26
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from c66f997 to 4663399 Compare October 20, 2026 19:04
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 4663399 to 5d4791a Compare October 20, 2026 20:15
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 5d4791a to 5957820 Compare October 21, 2026 09:10
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 5957820 to 42558de Compare October 21, 2026 11:39
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 42558de to 6563363 Compare October 21, 2026 15:02
@klihub
klihub requested a balanced review from Copilot October 21, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved correctness issues affect claim preservation, identity, pending-pod scheduling, and resume cleanup.

4 open issues
1 file not reviewed
  • cmd/plugins/topology-aware/policy/e2eish-gen-n4c16_test.go: Generated file
What changed in this PR

Adds Dynamic Resource Allocation (DRA) support to e2e-ish replay and test generation for resource policies.

Changes:

  • Models claim allocation, preparation, release, and pending pods.
  • Preserves DRA objects and claim references in generated tests.
  • Adds allocator tests and the topology-aware test42-dra-devices scenario.
File Description
pkg/​testutils/​e2eish/​script.go Adds DRA lifecycle and pending-pod handling.
pkg/​testutils/​e2eish/​replay.go Replays DRA object creation.
pkg/​testutils/​e2eish/​pod.go Adds pod and container claim options.
pkg/​testutils/​e2eish/​harness.go Supports claim preparation and CDI devices.
pkg/​testutils/​e2eish/​generate.go Generates DRA objects and claim options.
pkg/​testutils/​e2eish/​dra.go Implements replay-side claim allocation.
pkg/​testutils/​e2eish/​dra_test.go Tests allocation and object serialization.
pkg/​resmgr/​dra/​names.go Exposes CDI device naming.
pkg/​resmgr/​dra/​names_test.go Tests the shared naming helper.
pkg/​resmgr/​dra/​cdi.go Uses the shared naming helper.
go.sum Adds dependency checksums.
go.mod Adds allocator-related dependencies.
cmd/​plugins/​topology-aware/​policy/​e2eish-gen-n4c16_test.go Adds the generated DRA device scenario.
cmd/​plugins/​topology-aware/​policy/​e2eish_test.go Configures the policy's DRA driver.

Review effort: Balanced

ObjectMeta: metav1.ObjectMeta{
Namespace: ns,
Name: pod.Name + "-" + pc.Name,
UID: types.UID(ns + "-" + pod.Name + "-" + pc.Name + "-claim"),
}
}

func (g *genTest) createPod(r *record) {
Comment on lines +379 to +393
// startPending starts the pods waiting for their claims to fit, in the order
// they were created, up to the first which still does not fit. A cluster's
// scheduler would go on past that one, but the order claims are allocated in
// is what the log of the e2e test recorded.
func (s *Script) startPending() {
s.t.Helper()

for len(s.pending) > 0 {
p := s.pending[0]
if !s.startPod(p.ns, p.pod) {
return
}
s.pending = s.pending[1:]
}
}
s.h.DeletePods(name)
// The kubelet unprepares the claims of a pod once its containers
// have stopped, and a claim of a template is the pod's own.
s.h.ReleaseClaims(s.dra.release(ns, name)...)
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 6563363 to 6b1650c Compare October 21, 2026 17:12
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 6b1650c to baaaf7f Compare October 21, 2026 19:31
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from baaaf7f to 8a4975e Compare October 22, 2026 07:14
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 8a4975e to ab15b94 Compare October 22, 2026 07:32
@askervin
askervin force-pushed the stacked/klihub/e2eish/dra-replay branch from ab15b94 to 1519059 Compare October 22, 2026 10:57
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 1519059 to 041ed12 Compare October 22, 2026 11:12
Add e2e-ish support for stubbing enough of our DRA infra that
we can replay e2e tests involving DRA.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add unit tests for the e2e-ish DRA replay infrastructure itself.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add the e2e-ish generated unit test corresponding to the topology-
aware n4c16/test42-dra-devices e2e test.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@klihub
klihub force-pushed the stacked/klihub/e2eish/dra-replay branch from 041ed12 to 9ac3ee0 Compare October 22, 2026 12:13

This branch has not been deployed

No deployments
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.

2 participants