mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-25 08:40:05 +08:00
Use tls plugin for old binaries < 5.2.0
This fixes restart tests from old binaries < 5.2.0, which previously were immediately crashing in a TLS codepath. This behavior was not originally ported from the old test harness to the new test harness.
This commit is contained in:
parent
0c8b7d1b37
commit
cfec8bdd61
@ -139,6 +139,8 @@ class Config:
|
|||||||
self.max_errors_args = {'short_name': 'E'}
|
self.max_errors_args = {'short_name': 'E'}
|
||||||
self.old_binaries_path: Path = Path('/app/deploy/global_data/oldBinaries/')
|
self.old_binaries_path: Path = Path('/app/deploy/global_data/oldBinaries/')
|
||||||
self.old_binaries_path_args = {'help': 'Path to the directory containing the old fdb binaries'}
|
self.old_binaries_path_args = {'help': 'Path to the directory containing the old fdb binaries'}
|
||||||
|
self.tls_plugin_path: Path = Path('/app/deploy/runtime/.tls_5_1/FDBLibTLS.so')
|
||||||
|
self.tls_plugin_path_args = {'help': 'Path to the tls plugin used for binaries < 5.2.0'}
|
||||||
self.use_valgrind: bool = False
|
self.use_valgrind: bool = False
|
||||||
self.use_valgrind_args = {'action': 'store_true'}
|
self.use_valgrind_args = {'action': 'store_true'}
|
||||||
self.buggify = BuggifyOption('random')
|
self.buggify = BuggifyOption('random')
|
||||||
|
@ -18,7 +18,7 @@ from functools import total_ordering
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from test_harness.version import Version
|
from test_harness.version import Version
|
||||||
from test_harness.config import config
|
from test_harness.config import config
|
||||||
from typing import List, Pattern, OrderedDict
|
from typing import Dict, List, Pattern, OrderedDict
|
||||||
|
|
||||||
from test_harness.summarize import Summary, SummaryTree
|
from test_harness.summarize import Summary, SummaryTree
|
||||||
|
|
||||||
@ -309,6 +309,7 @@ class TestRun:
|
|||||||
self.trace_format: str | None = config.trace_format
|
self.trace_format: str | None = config.trace_format
|
||||||
if Version.of_binary(self.binary) < "6.1.0":
|
if Version.of_binary(self.binary) < "6.1.0":
|
||||||
self.trace_format = None
|
self.trace_format = None
|
||||||
|
self.use_tls_plugin = Version.of_binary(self.binary) < "5.2.0"
|
||||||
self.temp_path = config.run_dir / str(self.uid)
|
self.temp_path = config.run_dir / str(self.uid)
|
||||||
# state for the run
|
# state for the run
|
||||||
self.retryable_error: bool = False
|
self.retryable_error: bool = False
|
||||||
@ -332,6 +333,7 @@ class TestRun:
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
command: List[str] = []
|
command: List[str] = []
|
||||||
|
env: Dict[str, str] = os.environ.copy()
|
||||||
valgrind_file: Path | None = None
|
valgrind_file: Path | None = None
|
||||||
if self.use_valgrind:
|
if self.use_valgrind:
|
||||||
command.append('valgrind')
|
command.append('valgrind')
|
||||||
@ -346,6 +348,9 @@ class TestRun:
|
|||||||
'-s', str(self.random_seed)]
|
'-s', str(self.random_seed)]
|
||||||
if self.trace_format is not None:
|
if self.trace_format is not None:
|
||||||
command += ['--trace_format', self.trace_format]
|
command += ['--trace_format', self.trace_format]
|
||||||
|
if self.use_tls_plugin:
|
||||||
|
command += ['--tls_plugin', str(config.tls_plugin_path)]
|
||||||
|
env["FDB_TLS_PLUGIN"] = str(config.tls_plugin_path)
|
||||||
if Version.of_binary(self.binary) >= '7.1.0':
|
if Version.of_binary(self.binary) >= '7.1.0':
|
||||||
command += ['-fi', 'on' if self.fault_injection_enabled else 'off']
|
command += ['-fi', 'on' if self.fault_injection_enabled else 'off']
|
||||||
if self.restarting:
|
if self.restarting:
|
||||||
@ -361,7 +366,7 @@ class TestRun:
|
|||||||
resources = ResourceMonitor()
|
resources = ResourceMonitor()
|
||||||
resources.start()
|
resources.start()
|
||||||
process = subprocess.Popen(command, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, cwd=self.temp_path,
|
process = subprocess.Popen(command, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE, cwd=self.temp_path,
|
||||||
text=True)
|
text=True, env=env)
|
||||||
did_kill = False
|
did_kill = False
|
||||||
timeout = 20 * config.kill_seconds if self.use_valgrind else config.kill_seconds
|
timeout = 20 * config.kill_seconds if self.use_valgrind else config.kill_seconds
|
||||||
err_out: str
|
err_out: str
|
||||||
|
Loading…
x
Reference in New Issue
Block a user