Skip to content

Commit 453459a

Browse files
test(testkit): expose gateway info on Context
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent 8b678f2 commit 453459a

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

‎tests/testkit/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ fails. A killed test process skips cleanup, so names are unique to the run.
9595
- `cx.expect_compute_driver(name)` to fail unless the gateway runs only that
9696
compute driver. Driver suites call it first. `cx.compute_driver()` returns
9797
the driver's name, for setup that depends on it, such as a driver config.
98+
`cx.gateway_info()` returns the whole gateway info, such as the resource
99+
capabilities the driver reports.
98100
- `testkit::base_image()` for the image to create sandboxes from or build on:
99101
`OPENSHELL_TEST_BASE_IMAGE`, or OpenShell's default sandbox image.
100102
- `testkit::python_image()` for sandboxes that run `python3`, curl, git, or

‎tests/testkit/testkit/src/context.rs‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,16 +294,21 @@ impl Context {
294294
/// tests whose setup depends on it. Fails unless gateway info reports
295295
/// exactly one driver, under the same configured and driver name.
296296
pub async fn compute_driver(&self) -> Result<String> {
297-
let info = self
297+
single_compute_driver(&self.gateway_info().await?)
298+
}
299+
300+
/// The gateway's info: its version, compute drivers and their reported
301+
/// capabilities, and negotiated extensions.
302+
pub async fn gateway_info(&self) -> Result<proto::GetGatewayInfoResponse> {
303+
Ok(self
298304
.handles
299305
.grpc
300306
.client()
301307
.await?
302308
.get_gateway_info(proto::GetGatewayInfoRequest {})
303309
.await
304310
.context("get gateway info")?
305-
.into_inner();
306-
single_compute_driver(&info)
311+
.into_inner())
307312
}
308313

309314
/// Run the cleanup hooks, including deleting the sandboxes the test

0 commit comments

Comments
 (0)