Remove some unnecessary code

This commit is contained in:
Chaoguang Lin 2021-06-04 00:58:23 +00:00
parent e6ff1d75eb
commit 6eff38ebf7
2 changed files with 7 additions and 12 deletions

View File

@ -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()

View File

@ -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,13 +84,10 @@ 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()