Skip to content

Commit 9a2965d

Browse files
committed
fix server startup
1 parent e81e277 commit 9a2965d

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

.evergreen/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ functions:
207207
binary: bash
208208
working_dir: "src"
209209
include_expansions_in_env: [VERSION, TOPOLOGY, AUTH, SSL, ORCHESTRATION_FILE, PYTHON_BINARY, PYTHON_VERSION,
210-
STORAGE_ENGINE, REQUIRE_API_VERSION, DRIVERS_TOOLS, TEST_CRYPT_SHARED, AUTH_AWS, LOAD_BALANCER]
210+
STORAGE_ENGINE, REQUIRE_API_VERSION, DRIVERS_TOOLS, TEST_CRYPT_SHARED, AUTH_AWS, LOAD_BALANCER, LOCAL_ATLAS]
211211
args: [.evergreen/just.sh, run-server, "${TEST_NAME}"]
212212
- command: expansions.update
213213
params:

.evergreen/scripts/run_server.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ def start_server():
2828
elif test_name == "load_balancer":
2929
set_env("LOAD_BALANCER")
3030

31-
elif test_name == "ocsp":
32-
opts.ssl = True
33-
if "ORCHESTRATION_FILE" not in os.environ:
34-
found = False
35-
for opt in extra_opts:
36-
if opt.startswith("--orchestration-file"):
37-
found = True
38-
if not found:
39-
raise ValueError("Please provide an orchestration file")
40-
4131
elif test_name == "search_index":
4232
os.environ["TOPOLOGY"] = "replica_set"
4333
os.environ["MONGODB_VERSION"] = "7.0"

.evergreen/scripts/setup_tests.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,15 @@ def handle_test_env() -> None:
322322
env["OCSP_ALGORITHM"] = ocsp_algo
323323
run_command(f"bash {DRIVERS_TOOLS}/.evergreen/ocsp/setup.sh", env=env)
324324

325+
# The mock OCSP responder MUST BE started before the mongod as the mongod expects that
326+
# a responder will be available upon startup.
327+
cmd = ["bash", f"{DRIVERS_TOOLS}/.evergreen/run-orchestration.sh", "--ssl"]
328+
if opts.verbose:
329+
cmd.append("-v")
330+
elif opts.quiet:
331+
cmd.append("-q")
332+
run_command(cmd, cwd=DRIVERS_TOOLS)
333+
325334
if SSL != "nossl":
326335
if not DRIVERS_TOOLS:
327336
raise RuntimeError("Missing DRIVERS_TOOLS")

.evergreen/scripts/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ class Distro:
5454

5555
EXTRA_TESTS = ["mod_wsgi", "aws_lambda"]
5656

57-
# Tests that do not use run-orchestration.
58-
NO_RUN_ORCHESTRATION = ["auth_oidc", "atlas_connect", "data_lake", "mockupdb", "serverless"]
57+
# Tests that do not use run-orchestration directly.
58+
NO_RUN_ORCHESTRATION = ["auth_oidc", "atlas_connect", "data_lake", "mockupdb", "serverless", "ocsp"]
5959

6060

6161
def get_test_options(

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ You must have `docker` or `podman` installed locally.
335335
- Export the orchestration file, e.g. `export ORCHESTRATION_FILE=rsa-basic-tls-ocsp-disableStapling.json`.
336336
This corresponds to a config file in `$DRIVERS_TOOLS/.evergreen/orchestration/configs/servers`.
337337
MongoDB servers on MacOS and Windows do not staple OCSP responses and only support RSA.
338-
- Run `just run-server ocsp`.
338+
NOTE: because the mock ocsp responder MUST be started prior to the server starting, the ocsp tests start the server
339+
as part of `setup-tests`.
340+
339341
- Run `just setup-tests ocsp <sub test>` (options are "valid", "revoked", "valid-delegate", "revoked-delegate").
340342
- Run `just run-tests`
341343

0 commit comments

Comments
 (0)