mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 18:02:31 +08:00
Remove some unnecessary code
This commit is contained in:
parent
e6ff1d75eb
commit
6eff38ebf7
@ -79,7 +79,7 @@ if (NOT WIN32)
|
|||||||
add_fdbclient_test(
|
add_fdbclient_test(
|
||||||
NAME fdbcli_tests
|
NAME fdbcli_tests
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/bindings/python/tests/fdbcli_tests.py
|
COMMAND ${CMAKE_SOURCE_DIR}/bindings/python/tests/fdbcli_tests.py
|
||||||
@CLUSTER_FILE@
|
|
||||||
${CMAKE_BINARY_DIR}/bin/fdbcli
|
${CMAKE_BINARY_DIR}/bin/fdbcli
|
||||||
|
@CLUSTER_FILE@
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@ -4,10 +4,8 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
import fdb
|
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
|
|
||||||
def enable_logging(level=logging.ERROR):
|
def enable_logging(level=logging.ERROR):
|
||||||
"""Enable logging in the function with the specified logging level
|
"""Enable logging in the function with the specified logging level
|
||||||
|
|
||||||
@ -63,7 +61,7 @@ def advanceversion(logger):
|
|||||||
logger.debug("Read version: {}".format(version4))
|
logger.debug("Read version: {}".format(version4))
|
||||||
assert version4 >= version3
|
assert version4 >= version3
|
||||||
|
|
||||||
@enable_logging(logging.DEBUG)
|
@enable_logging()
|
||||||
def maintenance(logger):
|
def maintenance(logger):
|
||||||
# fdbcli output when there's no ongoing maintenance
|
# fdbcli output when there's no ongoing maintenance
|
||||||
no_maintenance_output = 'No ongoing maintenance.'
|
no_maintenance_output = 'No ongoing maintenance.'
|
||||||
@ -86,14 +84,11 @@ def maintenance(logger):
|
|||||||
assert output3 == no_maintenance_output
|
assert output3 == no_maintenance_output
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# specify fdb version
|
# fdbcli_tests.py <path_to_fdbcli_binary> <path_to_fdb_cluster_file>
|
||||||
fdb.api_version(710)
|
assert len(sys.argv) == 3, "Please pass arguments: <path_to_fdbcli_binary> <path_to_fdb_cluster_file>"
|
||||||
# fdbcli_tests.py <path_to_fdb_cluster_file> <path_to_fdbcli_binary>
|
# shell command template
|
||||||
assert len(sys.argv) == 3, "Please pass arguments: <path_to_fdb_cluster_file> <path_to_fdbcli_binary>"
|
command_template = [sys.argv[1], '-C', sys.argv[2], '--exec']
|
||||||
# open the existing database
|
|
||||||
db = fdb.open(sys.argv[1])
|
|
||||||
command_template = [sys.argv[2], '--exec']
|
|
||||||
# tests for fdbcli commands
|
# tests for fdbcli commands
|
||||||
# assertions will fail if fdbcli does not work as expected
|
# assertions will fail if fdbcli does not work as expected
|
||||||
advanceversion()
|
advanceversion()
|
||||||
maintenance()
|
maintenance()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user