Commit Graph

17 Commits

Author SHA1 Message Date
Patrick Ohly
4a3d822689 DRA e2e: make driver deployment possible in Go unit tests
This leverages ktesting as wrapper around Ginkgo and testing.T to make all
helper code that is needed to deploy a DRA driver available to Go unit
tests and thus integration tests.

How to proceed with unifying helper code for integration and E2E testing is
open. This is just a minimal first step in that direction. Ideally, such
code should be in separate packages where usage of Ginkgo, e2e/framework
and gomega.Expect/Eventually/Consistently are forbidden.

While at it, the builder gets extended to make cleanup optional.
This will be needed for upgrade/downgrade testing with sub-tests.

(cherry picked from commit 7c7b1e1018)
2026-01-16 07:53:00 +01:00
Patrick Ohly
e999d595b1 testing: partial revert of E2E + DRA upgrade/downgrade
Refactoring the DRA upgrade/downgrade testing such that it runs as Go test
depended on supporting ktesting in the E2E framework. That change worked during
presubmit testing, but broke some periodic jobs. Therefore the relevant commits
from https://github.com/kubernetes/kubernetes/pull/135664/commits get reverted:

c47ad64820 DRA e2e+integration: test ResourceSlice controller
047682908d ktesting: replace Begin/End with TContext.Step
de47714879 DRA upgrade/downgrade: rewrite as Go unit test
7c7b1e1018 DRA e2e: make driver deployment possible in Go unit tests
65ef31973c DRA upgrade/downgrade: split out individual test steps
47b613eded e2e framework: support creating TContext

The last one is what must have caused the problem, but the other commits depend
on it.
2026-01-11 09:55:17 +01:00
Patrick Ohly
7c7b1e1018 DRA e2e: make driver deployment possible in Go unit tests
This leverages ktesting as wrapper around Ginkgo and testing.T to make all
helper code that is needed to deploy a DRA driver available to Go unit
tests and thus integration tests.

How to proceed with unifying helper code for integration and E2E testing is
open. This is just a minimal first step in that direction. Ideally, such
code should be in separate packages where usage of Ginkgo, e2e/framework
and gomega.Expect/Eventually/Consistently are forbidden.

While at it, the builder gets extended to make cleanup optional.
This will be needed for upgrade/downgrade testing with sub-tests.
2026-01-07 14:11:33 +01:00
Morten Torkildsen
b5dae0ffaa DRA: Update e2e tests for Partitionable Devices 2025-11-06 21:30:46 +00:00
yliao
870062df4f adjusts DRA extended resource quota to include devices usages from regular resource claims 2025-11-05 23:24:24 +00:00
Patrick Ohly
545526cfe0 DRA E2E: only check ResourceClaims in the test namespace
That was the original intent, but the implementation then ended up checking
ResourceClaims in all namespaces. Depending on timing this was merely
misleading (showing ResourceClaim changes from a different test running in
parallel), but with upcoming CRUD tests which intentionally set an allocation
result without a finalizer it breaks the non-CRUD tests when they check the
those CRUD ResourceClaims.
2025-10-02 16:07:48 +02:00
Patrick Ohly
8a95e8a71c DRA E2E: clean up class creation for extended resource tests
The initial testing of DRAExtendedResource changed the common setup for all
tests so that each test runs with seven DeviceClasses. This is unnecessary and
confusing, for example when looking at the endpoint stats for the simple
conformance test ("Are the stats correct? The test should only create one
class.").

This update changes it so that each test which needs more than the default
class explicitly creates those itself. For clarity, the special -1 index gets a
name and naming of the DeviceClasses gets updated to keep the default class
simple (no additional suffix).

Using the same "example.com/resource0" in tests which run in parallel might
explain https://github.com/kubernetes/kubernetes/issues/133653. This gets
replaced with extended resource names based on the driver name, which is unique
in each parallel test.
2025-08-22 18:12:34 +02:00
yliao
23d6f73e72 extended resource backed by DRA: test 2025-07-29 18:55:28 +00:00
Patrick Ohly
c954e13255 Revert "DRAAdminAccess: add upgrade downgrade test" 2025-07-24 14:04:08 +02:00
Patrick Ohly
5c4f81743c DRA: use v1 API
As before when adding v1beta2, DRA drivers built using the
k8s.io/dynamic-resource-allocation helper packages remain compatible with all
Kubernetes release >= 1.32. The helper code picks whatever API version is
enabled from v1beta1/v1beta2/v1.

However, the control plane now depends on v1, so a cluster configuration where
only v1beta1 or v1beta2 are enabled without the v1 won't work.
2025-07-24 08:33:45 +02:00
Kubernetes Prow Robot
ca569e152d Merge pull request #132700 from pohly/dra-kubelet-grpc-v1
DRA kubelet: add v1 gRPC
2025-07-23 17:36:26 -07:00
Rita Zhang
216f7485bd DRAAdminAccess: add upgrade downgrade test
Signed-off-by: Rita Zhang <rita.z.zhang@gmail.com>
2025-07-22 11:54:34 -07:00
Patrick Ohly
f77ce8951e DRA: debug output for list/watch client
Upgrade/downgrade testing after the DRA GA graduation gets stuck because the
ResourceSlice controller's informer doesn't pick up that the ResourceSlice got
deleted.

This additional log output shows a List+Watch after a watch got closed due to a
disconnect from the apiserver, so right now everything is working as expected.
2025-07-19 11:38:12 +02:00
Patrick Ohly
f141907ddd DRA kubelet: add v1 gRPC
The API is a direct copy of v1beta1, with v1beta1 replaced by v1.
The interoperability support is the same that was used for v1alpha4.
Adding it "reverts" the removal of the v1alpha4 support in
a57f15e081, except that now v1beta1 is the legacy
API which needs conversion. If kubelet and the plugin both support v1, no
conversion is needed.
2025-07-17 07:56:03 +02:00
Patrick Ohly
d44b737447 DRA: handle grpc.Server.Serve failures
Added an errHandler callback to startGRPCServer for handling errors.
Replaced direct logging of server failures with calls to the
provided error handler. This change ensures that errors are surfaced
and handled consistently.

Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2025-07-16 15:49:32 +03:00
Patrick Ohly
c8ca9249ac DRA integration: add upgrade/downgrade testing with local-up-cluster.sh
The test brings up the cluster and uses that power to run through
an upgrade/downgrade scenario. Version skew testing (running tests while the cluster
is partially up- or downgraded) could be added.

The new helper code for managing the cluster is written so that it could be
used both in an integration test and an E2E
test. https://github.com/kubernetes/kubernetes/pull/122481 could make that a
bit easier in an E2E test, but is not absolutely required.

In contrast to running on a normal cluster, pods need no privileges.
Instead, the caller has to make sure that the test itself can write
into system directories used by the cluster.
2025-07-15 12:54:40 +02:00
Patrick Ohly
60e9316c0c DRA E2E: refactor helper code
The helper code is useful for a separate Ginkgo suite for upgrade/downgrade
testing. We don't want to import test/e2e/dra there because that would also
define additional tests.
2025-07-15 12:54:40 +02:00