Skip to content

Commit 2cc51ca

Browse files
committed
refactor(conformance): remove unused CLI scenario APIs
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent f519183 commit 2cc51ca

6 files changed

Lines changed: 4 additions & 59 deletions

File tree

‎crates/openshell-conformance/src/lib.rs‎

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ use self::executor::{CliExecutionError, CliExecutor, ProcessCli};
2525

2626
pub use scenarios::{
2727
FILE_TRANSFER_GIT_FILTERING_SCENARIO, FILE_TRANSFER_PATH_SAFETY_SCENARIO,
28-
FILE_TRANSFER_ROUND_TRIP_SCENARIO, FILE_TRANSFER_SCENARIO, MECHANISTIC_PROPOSAL_SCENARIO,
28+
FILE_TRANSFER_ROUND_TRIP_SCENARIO, MECHANISTIC_PROPOSAL_SCENARIO,
2929
NEW_HOSTNAME_PROPOSAL_SCENARIO, POLICY_LOCAL_SCENARIO, SANDBOX_LIFECYCLE_SCENARIO,
3030
SMOKE_SCENARIO,
3131
};
3232

33-
/// An installed conformance scenario.
33+
/// A portable conformance scenario exercised by the Cargo test suite.
3434
#[derive(Debug)]
3535
pub struct Scenario {
3636
pub name: &'static str,
37-
pub description: &'static str,
3837
run: for<'a> fn(&'a mut OpenShellRunner) -> ScenarioFuture<'a>,
3938
}
4039

@@ -46,25 +45,6 @@ impl Scenario {
4645
}
4746
}
4847

49-
const SCENARIOS: &[Scenario] = &[
50-
SMOKE_SCENARIO,
51-
SANDBOX_LIFECYCLE_SCENARIO,
52-
FILE_TRANSFER_SCENARIO,
53-
MECHANISTIC_PROPOSAL_SCENARIO,
54-
NEW_HOSTNAME_PROPOSAL_SCENARIO,
55-
POLICY_LOCAL_SCENARIO,
56-
];
57-
58-
/// Returns every scenario compiled into this distribution.
59-
pub fn scenarios() -> &'static [Scenario] {
60-
SCENARIOS
61-
}
62-
63-
/// Finds a scenario by its stable command-line name.
64-
pub fn scenario(name: &str) -> Option<&'static Scenario> {
65-
scenarios().iter().find(|candidate| candidate.name == name)
66-
}
67-
6848
const CLEANUP_TIMEOUT: Duration = Duration::from_mins(2);
6949
pub const STATUS_TIMEOUT: Duration = Duration::from_secs(30);
7050
const GATEWAY_STATUS_ATTEMPT_TIMEOUT: Duration = Duration::from_secs(10);
@@ -281,13 +261,6 @@ pub struct OpenShellCommand<'a> {
281261
}
282262

283263
impl OpenShellRunner {
284-
pub fn new(scenario: &str) -> Result<Self, RunnerError> {
285-
Ok(Self::with_executor(
286-
Arc::new(ProcessCli::new(PathBuf::from("openshell"))),
287-
scenario,
288-
))
289-
}
290-
291264
/// Uses an explicit `openshell` binary rather than resolving it on `PATH`.
292265
pub fn with_binary(binary: PathBuf, scenario: &str) -> Result<Self, RunnerError> {
293266
if !binary.is_file() {
@@ -335,10 +308,6 @@ impl OpenShellRunner {
335308
&self.run_id
336309
}
337310

338-
pub fn scenario(&self) -> &str {
339-
&self.scenario
340-
}
341-
342311
pub fn step(&self, step: impl Into<String>) -> CommandStep<'_> {
343312
CommandStep {
344313
runner: self,
@@ -871,7 +840,6 @@ mod tests {
871840
let (mut runner, _cli) = test_runner(Vec::new());
872841

873842
assert_eq!(runner.id().len(), 10);
874-
assert_eq!(runner.scenario(), "smoke");
875843
runner.finished = true;
876844
}
877845

‎crates/openshell-conformance/src/scenarios/file_transfer.rs‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,24 @@ const COMMAND_TIMEOUT: Duration = Duration::from_mins(2);
1717
const TRANSFER_TIMEOUT: Duration = Duration::from_mins(5);
1818
const LARGE_FILE_SIZE: usize = 512 * 1024;
1919

20-
/// Certify portable upload and download behavior through the public CLI.
21-
pub const FILE_TRANSFER_SCENARIO: Scenario = Scenario {
22-
name: "file-transfer",
23-
description: "Verify sandbox uploads, downloads, Git filtering, and path safety.",
24-
run: run_file_transfer,
25-
};
26-
2720
/// Certify basic file and directory upload and download behavior.
2821
pub const FILE_TRANSFER_ROUND_TRIP_SCENARIO: Scenario = Scenario {
2922
name: "file-transfer/round-trip",
30-
description: "Verify file and directory upload and download round trips.",
3123
run: run_round_trip,
3224
};
3325

3426
/// Certify Git-aware upload filtering and explicit unfiltered uploads.
3527
pub const FILE_TRANSFER_GIT_FILTERING_SCENARIO: Scenario = Scenario {
3628
name: "file-transfer/git-filtering",
37-
description: "Verify Git-aware upload selection and explicit unfiltered uploads.",
3829
run: run_git_filtering,
3930
};
4031

4132
/// Certify file-transfer workspace boundary and filename safety behavior.
4233
pub const FILE_TRANSFER_PATH_SAFETY_SCENARIO: Scenario = Scenario {
4334
name: "file-transfer/path-safety",
44-
description: "Verify workspace boundary enforcement and safe filename handling.",
4535
run: run_path_safety,
4636
};
4737

48-
fn run_file_transfer(runner: &mut OpenShellRunner) -> ScenarioFuture<'_> {
49-
Box::pin(async move {
50-
FILE_TRANSFER_ROUND_TRIP_SCENARIO.run(runner).await?;
51-
FILE_TRANSFER_GIT_FILTERING_SCENARIO.run(runner).await?;
52-
FILE_TRANSFER_PATH_SAFETY_SCENARIO.run(runner).await
53-
})
54-
}
55-
5638
fn run_round_trip(runner: &mut OpenShellRunner) -> ScenarioFuture<'_> {
5739
Box::pin(async move {
5840
let (sandbox_name, remote_root, local) = prepare_sandbox(runner, "round-trip").await?;

‎crates/openshell-conformance/src/scenarios/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
//! Registered, portable conformance scenarios.
4+
//! Portable conformance scenarios exercised by the Cargo test suite.
55
66
mod file_transfer;
77
mod policy_behavior;
@@ -10,7 +10,7 @@ mod smoke;
1010

1111
pub use file_transfer::{
1212
FILE_TRANSFER_GIT_FILTERING_SCENARIO, FILE_TRANSFER_PATH_SAFETY_SCENARIO,
13-
FILE_TRANSFER_ROUND_TRIP_SCENARIO, FILE_TRANSFER_SCENARIO,
13+
FILE_TRANSFER_ROUND_TRIP_SCENARIO,
1414
};
1515
pub use policy_behavior::{
1616
MECHANISTIC_PROPOSAL_SCENARIO, NEW_HOSTNAME_PROPOSAL_SCENARIO, POLICY_LOCAL_SCENARIO,

‎crates/openshell-conformance/src/scenarios/policy_behavior.rs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,16 @@ struct SandboxState {
2727

2828
pub const POLICY_LOCAL_SCENARIO: Scenario = Scenario {
2929
name: "policy-local",
30-
description: "Read and request a rule through the sandbox-local policy HTTP API.",
3130
run: run_policy_local,
3231
};
3332

3433
pub const MECHANISTIC_PROPOSAL_SCENARIO: Scenario = Scenario {
3534
name: "mechanistic-proposal",
36-
description: "Turn a denied transparent TCP open into a scoped policy draft.",
3735
run: run_mechanistic_proposal,
3836
};
3937

4038
pub const NEW_HOSTNAME_PROPOSAL_SCENARIO: Scenario = Scenario {
4139
name: "new-hostname-proposal",
42-
description: "Turn a denied TCP open to a hostname absent from policy into a scoped draft.",
4340
run: run_new_hostname_proposal,
4441
};
4542

‎crates/openshell-conformance/src/scenarios/sandbox_lifecycle.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ struct SandboxListPage {
3131
/// Certify sandbox stop, start, and deletion lifecycle behavior.
3232
pub const SANDBOX_LIFECYCLE_SCENARIO: Scenario = Scenario {
3333
name: "sandbox-lifecycle",
34-
description: "Verify sandbox stop, start, and deletion lifecycle behavior.",
3534
run: run_sandbox_lifecycle,
3635
};
3736

‎crates/openshell-conformance/src/scenarios/smoke.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ struct SandboxListPage {
3131
/// Certify status -> create -> list Ready -> exec -> delete -> list empty.
3232
pub const SMOKE_SCENARIO: Scenario = Scenario {
3333
name: "smoke",
34-
description: "Create, inspect, execute in, and delete a base sandbox.",
3534
run: run_smoke,
3635
};
3736

0 commit comments

Comments
 (0)