Skip to content

Commit 8bad162

Browse files
committed
test(host-gateway): run client as sandbox main process
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent cd11d9a commit 8bad162

2 files changed

Lines changed: 17 additions & 28 deletions

File tree

‎TESTING.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,8 @@ rootful and rootless, and the `k3s` and `k3s-ha` installers. The tests run on
601601
the K3s node, so the K3s installers set the chart's `server.hostGatewayIP` to
602602
the node's address.
603603

604+
The client runs as the main process of `sandbox create`. The `k3s-ha` row also exercises attaching to this short-lived main process through a gateway with several replicas.
605+
604606
Run the VM-backed Rust CLI e2e suite:
605607

606608
```shell

‎tests/suites/features/host-gateway/tests/host_gateway.rs‎

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,41 +56,28 @@ async fn python_sandbox_reaches_host_server(cx: &mut Context) -> testkit::Result
5656
let port = server.port.to_string();
5757
let image = testkit::python_image();
5858

59-
// The client runs through `sandbox exec` in a Ready sandbox, not as the
60-
// main process. A gateway with several replicas (k3s-ha) can refuse to
61-
// attach to a main process that already finished with "sandbox is not
62-
// ready" when the request reaches a replica that doesn't hold the
63-
// sandbox's session.
6459
let name = cx.name("hg");
6560
cx.track(&name);
66-
cx.cli([
67-
"sandbox",
68-
"create",
69-
"--name",
70-
&name,
71-
"--from",
72-
&image,
73-
"--policy",
74-
policy.path()?,
75-
"--detach",
76-
"--no-tty",
77-
"--",
78-
"sh",
79-
"-c",
80-
"exec sleep infinity",
81-
])
82-
.await?
83-
.success()
84-
.context(format!("create a sandbox from {image}"))?;
85-
cx.adopt(&name).await?.wait_ready().await?;
86-
8761
let client = cx
8862
.cli([
89-
"sandbox", "exec", "--name", &name, "--no-tty", "--", PYTHON, "-c", CLIENT, &port,
63+
"sandbox",
64+
"create",
65+
"--name",
66+
&name,
67+
"--from",
68+
&image,
69+
"--policy",
70+
policy.path()?,
71+
"--no-tty",
72+
"--",
73+
PYTHON,
74+
"-c",
75+
CLIENT,
76+
&port,
9077
])
9178
.await?
9279
.success()
93-
.context("run the client in the sandbox")?;
80+
.context("run the client as the sandbox's main process")?;
9481
testkit::ensure!(
9582
client.stdout.contains(&marker),
9683
"the client did not get the host server's response:\n{}{}",

0 commit comments

Comments
 (0)