Fixes to new disconnected tests; add a version that doesn't use MVC

This commit is contained in:
A.J. Beamon 2021-09-29 08:13:34 -07:00 committed by Markus Pilman
parent de863d170d
commit c82d820bfd
2 changed files with 10 additions and 5 deletions

View File

@ -183,7 +183,11 @@ if(NOT WIN32)
NAME disconnected_timeout_unit_tests
COMMAND $<TARGET_FILE:disconnected_timeout_unit_tests>
@CLUSTER_FILE@
fdb
)
add_unavailable_fdbclient_test(
NAME disconnected_timeout_external_client_unit_tests
COMMAND $<TARGET_FILE:disconnected_timeout_unit_tests>
@CLUSTER_FILE@
${CMAKE_CURRENT_BINARY_DIR}/libfdb_c.so
)
endif()

View File

@ -7,6 +7,7 @@ import sys
from local_cluster import LocalCluster
from argparse import ArgumentParser, RawDescriptionHelpFormatter
from pathlib import Path
from random import choice
class ClusterFileGenerator:
def __init__(self, output_dir: str):
@ -16,14 +17,14 @@ class ClusterFileGenerator:
self.tmp_dir = self.output_dir.joinpath(
'tmp',
''.join(choice(LocalCluster.valid_letters_for_secret) for i in range(16)))
tmp_dir.mkdir(parents=True)
self.tmp_dir.mkdir(parents=True)
self.cluster_file_path = self.tmp_dir.joinpath('fdb.cluster')
def __enter__(self):
with open(self.cluster_file_path, 'x') as f:
f.write('foo:bar@1.1.1.1:5678')
with open(self.cluster_file_path, 'x') as f:
f.write('foo:bar@1.1.1.1:5678\n')
return self
return self
def __exit__(self, xc_type, exc_value, traceback):
shutil.rmtree(self.tmp_dir)