Skip to content

Commit bfcbcc7

Browse files
test(conformance): skip the sandbox log tests entirely on multi-replica gateways
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
1 parent b82757c commit bfcbcc7

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎tests/suites/conformance/src/credential_gating.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,9 @@ async fn profile_websocket_endpoint_rewrites_text_frames(cx: &mut Context) -> te
326326
/// or its variable name.
327327
#[testkit::test]
328328
async fn profile_endpoints_bind_static_credentials(cx: &mut Context) -> testkit::Result {
329+
if crate::skip_reading_sandbox_logs("profile_endpoints_bind_static_credentials") {
330+
return Ok(());
331+
}
329332
const SECRET_A: &str = "e2e-bound-secret";
330333
const SECRET_B: &str = "e2e-provider-b-secret";
331334
let authorized = |request: &Request| {
@@ -383,9 +386,6 @@ async fn profile_endpoints_bind_static_credentials(cx: &mut Context) -> testkit:
383386
output.stdout.replace(SECRET_A, "<secret>")
384387
);
385388

386-
if crate::sandbox_logs_unreliable("profile_endpoints_bind_static_credentials") {
387-
return Ok(());
388-
}
389389
let logs = sandbox
390390
.logs_until("the endpoint mismatch", |logs| {
391391
logs.contains("openshell.provider_credential.endpoint_mismatch")

‎tests/suites/conformance/src/lib.rs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ mod workspaces;
3636
/// one.
3737
const GATEWAY_REPLICAS_ENV: &str = "OPENSHELL_TEST_GATEWAY_REPLICAS";
3838

39-
/// Whether sandbox log reads can miss a sandbox's logs: a gateway replica
40-
/// holds only the logs of the sandboxes connected to it, and a read can reach
41-
/// another one (#5462). Says so when they can, so the test can skip its log
42-
/// check.
43-
fn sandbox_logs_unreliable(test: &str) -> bool {
39+
/// Whether a test that reads sandbox logs should skip itself, and says so
40+
/// when it should: a gateway replica holds only the logs of the sandboxes
41+
/// connected to it, and a read can reach another one (#5462). Remove this
42+
/// once #5462 is fixed or an environment can skip tests itself (#5752).
43+
fn skip_reading_sandbox_logs(test: &str) -> bool {
4444
let replicas = std::env::var(GATEWAY_REPLICAS_ENV)
4545
.ok()
4646
.and_then(|value| value.parse::<u32>().ok())
4747
.unwrap_or(1);
4848
if replicas > 1 {
4949
eprintln!(
50-
"[{test}] skipping the log check: the gateway has {replicas} replicas and \
51-
sandbox logs are read from only one (#5462)"
50+
"[{test}] skipping: the gateway has {replicas} replicas and sandbox logs \
51+
are read from only one (#5462, #5752)"
5252
);
5353
}
5454
replicas > 1

‎tests/suites/conformance/src/network_egress.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ async fn middleware_redacts_request_bodies(cx: &mut Context) -> testkit::Result
218218
/// byte reaches upstream, and the sandbox logs why.
219219
#[testkit::test]
220220
async fn fail_closed_middleware_blocks_uninspectable_traffic(cx: &mut Context) -> testkit::Result {
221+
if crate::skip_reading_sandbox_logs("fail_closed_middleware_blocks_uninspectable_traffic") {
222+
return Ok(());
223+
}
221224
let server = TcpServer::echo().await?;
222225
let policy = middleware_policy(server.port, "fail_closed", "")?;
223226
let sandbox = cx
@@ -235,9 +238,6 @@ async fn fail_closed_middleware_blocks_uninspectable_traffic(cx: &mut Context) -
235238
&& crate::network_l7::error_code(&reply).as_deref() == Some("unsupported_l7_protocol"),
236239
"expected the middleware to block the payload: {reply:?}"
237240
);
238-
if crate::sandbox_logs_unreliable("fail_closed_middleware_blocks_uninspectable_traffic") {
239-
return Ok(());
240-
}
241241
sandbox
242242
.logs_until("the middleware denial", |logs| {
243243
logs.contains("openshell.middleware.traffic_uninspectable")

‎tests/tmachine/ansible/playbooks/openshell-k3s-ha.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
openshell_client_gateway_endpoint: "https://openshell.openshell.svc.cluster.local:{{ k3s_gateway_address.stdout.split(':')[1] }}"
107107

108108
# Sandbox logs are read from one replica only (#5462); tests that read
109-
# them skip those checks here.
109+
# them skip themselves here until #5752.
110110
- name: Publish gateway test variables
111111
ansible.builtin.include_tasks: test-env.yaml
112112
vars:

0 commit comments

Comments
 (0)