Skip to content

Commit c768219

Browse files
committed
test(e2e): accept loopback plaintext rejection
Signed-off-by: Evan Lezar <[email protected]>
1 parent 9ef1670 commit c768219

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎e2e/python/test_security_tls.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,11 +234,14 @@ def test_plaintext_connection_rejected(
234234
stub = openshell_pb2_grpc.OpenShellStub(channel)
235235
with pytest.raises(grpc.RpcError) as exc_info:
236236
stub.Health(openshell_pb2.HealthRequest(), timeout=10)
237-
# Plaintext to a TLS port will fail at the transport level.
237+
# The loopback listener may intentionally accept plaintext service
238+
# HTTP. A gRPC request is still rejected, either at the transport
239+
# boundary or as an unimplemented HTTP route.
238240
assert exc_info.value.code() in (
239241
grpc.StatusCode.UNAVAILABLE,
240242
grpc.StatusCode.UNKNOWN,
241243
grpc.StatusCode.INTERNAL,
242-
), f"expected transport failure, got {exc_info.value.code()}"
244+
grpc.StatusCode.UNIMPLEMENTED,
245+
), f"expected plaintext gRPC rejection, got {exc_info.value.code()}"
243246
finally:
244247
channel.close()

0 commit comments

Comments
 (0)