Add fdbcli external client tests
This commit is contained in:
parent
11f2da7806
commit
cc18cc742c
|
@ -77,7 +77,7 @@ add_dependencies(packages python_package)
|
||||||
|
|
||||||
if (NOT WIN32 AND NOT OPEN_FOR_IDE)
|
if (NOT WIN32 AND NOT OPEN_FOR_IDE)
|
||||||
add_fdbclient_test(
|
add_fdbclient_test(
|
||||||
NAME fdbcli_tests
|
NAME single_process_fdbcli_tests
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/bindings/python/tests/fdbcli_tests.py
|
COMMAND ${CMAKE_SOURCE_DIR}/bindings/python/tests/fdbcli_tests.py
|
||||||
${CMAKE_BINARY_DIR}/bin/fdbcli
|
${CMAKE_BINARY_DIR}/bin/fdbcli
|
||||||
@CLUSTER_FILE@
|
@CLUSTER_FILE@
|
||||||
|
@ -92,4 +92,24 @@ if (NOT WIN32 AND NOT OPEN_FOR_IDE)
|
||||||
@CLUSTER_FILE@
|
@CLUSTER_FILE@
|
||||||
5
|
5
|
||||||
)
|
)
|
||||||
|
if (TARGET external_client) # external_client copies fdb_c to bindings/c/libfdb_c.so
|
||||||
|
add_fdbclient_test(
|
||||||
|
NAME single_process_external_client_fdbcli_tests
|
||||||
|
COMMAND ${CMAKE_SOURCE_DIR}/bindings/python/tests/fdbcli_tests.py
|
||||||
|
${CMAKE_BINARY_DIR}/bin/fdbcli
|
||||||
|
@CLUSTER_FILE@
|
||||||
|
1
|
||||||
|
${CMAKE_BINARY_DIR}/bindings/c/libfdb_c.so
|
||||||
|
)
|
||||||
|
add_fdbclient_test(
|
||||||
|
NAME multi_process_external_client_fdbcli_tests
|
||||||
|
PROCESS_NUMBER 5
|
||||||
|
TEST_TIMEOUT 120 # The test can take near to 1 minutes sometime, set timeout to 2 minutes to be safe
|
||||||
|
COMMAND ${CMAKE_SOURCE_DIR}/bindings/python/tests/fdbcli_tests.py
|
||||||
|
${CMAKE_BINARY_DIR}/bin/fdbcli
|
||||||
|
@CLUSTER_FILE@
|
||||||
|
5
|
||||||
|
${CMAKE_BINARY_DIR}/bindings/c/libfdb_c.so
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
import functools
|
import functools
|
||||||
|
@ -450,8 +451,14 @@ def wait_for_database_available(logger):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# fdbcli_tests.py <path_to_fdbcli_binary> <path_to_fdb_cluster_file> <process_number>
|
# fdbcli_tests.py <path_to_fdbcli_binary> <path_to_fdb_cluster_file> <process_number> [external_client_library_path]
|
||||||
assert len(sys.argv) == 4, "Please pass arguments: <path_to_fdbcli_binary> <path_to_fdb_cluster_file> <process_number>"
|
assert len(sys.argv) == 4 or len(sys.argv) == 5, "Please pass arguments: <path_to_fdbcli_binary> <path_to_fdb_cluster_file> <process_number> [external_client_library_path]"
|
||||||
|
# set external client library
|
||||||
|
if len(sys.argv) == 5:
|
||||||
|
external_client_library_path = sys.argv[4]
|
||||||
|
# disable local client and use the external client library
|
||||||
|
os.environ['FDB_NETWORK_OPTION_DISABLE_LOCAL_CLIENT'] = ''
|
||||||
|
os.environ['FDB_NETWORK_OPTION_EXTERNAL_CLIENT_LIBRARY'] = external_client_library_path
|
||||||
# shell command template
|
# shell command template
|
||||||
command_template = [sys.argv[1], '-C', sys.argv[2], '--exec']
|
command_template = [sys.argv[1], '-C', sys.argv[2], '--exec']
|
||||||
# tests for fdbcli commands
|
# tests for fdbcli commands
|
||||||
|
|
Loading…
Reference in New Issue