Skip to content

Commit 77794c7

Browse files
test(e2e): port CLI exec, attach, and SSH host identity tests to testkit
Move the CLI exec, attached create, no-keep, attach, and SSH host identity tests from e2e/rust to the conformance suite, and the procfs-based connect transport recovery and signal forwarding tests to a new features/cli-attach suite. Delete the ported legacy tests, ssh_host_identity.rs, the now-unused PTY harness helper, and the stale Kubernetes nextest waiver. sandbox_lifecycle.rs keeps only the on-failure restart test until #5507 is fixed. The gateway-restart check of SSH host identity moves to a later port. Part of #5281 Closes #5426 Signed-off-by: Matthew Grossman <[email protected]>
1 parent ec21638 commit 77794c7

21 files changed

Lines changed: 967 additions & 1284 deletions

File tree

‎.config/nextest.toml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ failure-output = "immediate-final"
1010
slow-timeout = { period = "30s", terminate-after = 4 }
1111

1212
[profile.e2e-kubernetes]
13-
# Temporary waiver: port-forward reconnect can attach read-only while the old
14-
# SSH session retains stdin ownership. Keep recovery coverage on other drivers.
15-
# Remove this exclusion after resolving https://github.com/NVIDIA/OpenShell/issues/4445.
16-
default-filter = "not test(/^canonical_main_connect_recovers_its_ssh_transport$/)"
1713
fail-fast = false
1814
status-level = "slow"
1915
final-status-level = "fail"

‎.github/workflows/e2e-suites.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ jobs:
8989
{"environment":"fedora-podman-rootless","installer":"rpm","family":"features","package":"host-gateway","gateway":"openshell","runner":"ubuntu-24.04"},
9090
{"environment":"ubuntu-k3s","installer":"k3s","family":"features","package":"host-gateway","gateway":"tmachine","runner":"ubuntu-24.04"},
9191
{"environment":"ubuntu-k3s","installer":"k3s-ha","family":"features","package":"host-gateway","gateway":"tmachine","runner":"ubuntu-24.04"},
92+
{"environment":"ubuntu-docker-rootful","installer":"deb","family":"features","package":"cli-attach","gateway":"openshell","runner":"ubuntu-24.04"},
9293
{"environment":"fedora-podman-rootful-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
9394
{"environment":"fedora-podman-rootless-keycloak","installer":"rpm","family":"features","package":"keycloak-provider-refresh","gateway":"openshell","runner":"ubuntu-24.04"},
9495
{"environment":"fedora-podman-rootful-userns-default","installer":"rpm","family":"drivers/podman","gateway":"openshell","runner":"ubuntu-24.04"},

‎TESTING.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,11 @@ rootful and rootless, and the `k3s` and `k3s-ha` installers. The tests run on
636636
the K3s node, so the K3s installers set the chart's `server.hostGatewayIP` to
637637
the node's address.
638638

639+
The `cli-attach` feature suite (`tests/suites/features/cli-attach`) checks how
640+
`sandbox connect` supervises its `ssh` process: it reconnects after losing the
641+
SSH transport and forwards a SIGTERM to `ssh`. The tests find those processes
642+
in `/proc`, so they need a Linux test host. CI runs them on Docker rootful.
643+
639644
Run the VM-backed Rust CLI e2e suite:
640645

641646
```shell

‎e2e/rust/Cargo.lock‎

Lines changed: 0 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎e2e/rust/Cargo.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ tonic-prost = "0.14"
278278
tokio-rustls = { version = "0.26", default-features = false, features = ["logging", "tls12"] }
279279
tower = "0.5"
280280
url = "2"
281-
nix = { version = "0.29", features = ["process", "signal", "term", "user"] }
282281

283282
[dev-dependencies]
284283
openshell-ocsf-validate = { path = "../../crates/openshell-ocsf-validate" }

‎e2e/rust/src/harness/binary.rs‎

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -52,41 +52,6 @@ pub fn openshell_cmd() -> tokio::process::Command {
5252
cmd
5353
}
5454

55-
fn shell_escape(arg: &str) -> String {
56-
if arg
57-
.chars()
58-
.all(|c| c.is_ascii_alphanumeric() || "-_./:@".contains(c))
59-
{
60-
return arg.to_string();
61-
}
62-
63-
format!("'{}'", arg.replace('\'', "'\\''"))
64-
}
65-
66-
/// Create a [`tokio::process::Command`] that runs `openshell` under a PTY.
67-
pub fn openshell_tty_cmd(args: &[&str]) -> tokio::process::Command {
68-
let bin = openshell_bin();
69-
let mut cmd = tokio::process::Command::new("script");
70-
71-
if cfg!(target_os = "macos") {
72-
cmd.arg("-q").arg("/dev/null").arg(bin).args(args);
73-
} else {
74-
let mut shell_command = shell_escape(bin.to_str().expect("openshell path is utf-8"));
75-
for arg in args {
76-
shell_command.push(' ');
77-
shell_command.push_str(&shell_escape(arg));
78-
}
79-
cmd.arg("-q")
80-
.arg("-e")
81-
.arg("-c")
82-
.arg(shell_command)
83-
.arg("/dev/null");
84-
}
85-
86-
cmd.kill_on_drop(true);
87-
cmd
88-
}
89-
9055
#[cfg(test)]
9156
mod tests {
9257
use super::*;

‎e2e/rust/tests/oidc_pkce.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,8 +1457,8 @@ async fn delete_workspace(admin: &LoginSession, workspace: &str) {
14571457
}
14581458

14591459
// Keep RBAC fixtures running until cleanup so authorization checks do not also
1460-
// exercise fast canonical-process completion. That lifecycle belongs to the
1461-
// dedicated sandbox_lifecycle suite.
1460+
// exercise fast canonical-process completion. The conformance `lifecycle`
1461+
// suite covers that.
14621462
async fn assert_can_create_sandbox(session: &LoginSession, workspace: &str, sandbox_name: &str) {
14631463
let create = run_workspace_cli(
14641464
session,

0 commit comments

Comments
 (0)