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(
NAME fdbcli_tests
COMMAND ${CMAKE_SOURCE_DIR}/bindings/python/tests/fdbcli_tests.py
@CLUSTER_FILE@
${CMAKE_BINARY_DIR}/bin/fdbcli
@CLUSTER_FILE@
)
endif()

View File

@ -4,10 +4,8 @@ import os
import sys
import subprocess
import logging
import fdb
import functools
def enable_logging(level=logging.ERROR):
"""Enable logging in the function with the specified logging level
@ -63,7 +61,7 @@ def advanceversion(logger):
logger.debug("Read version: {}".format(version4))
assert version4 >= version3
@enable_logging(logging.DEBUG)
@enable_logging()
def maintenance(logger):
# fdbcli output when there's no ongoing maintenance
no_maintenance_output = 'No ongoing maintenance.'
@ -86,14 +84,11 @@ def maintenance(logger):
assert output3 == no_maintenance_output
if __name__ == '__main__':
# specify fdb version
fdb.api_version(710)
# fdbcli_tests.py <path_to_fdb_cluster_file> <path_to_fdbcli_binary>
assert len(sys.argv) == 3, "Please pass arguments: <path_to_fdb_cluster_file> <path_to_fdbcli_binary>"
# open the existing database
db = fdb.open(sys.argv[1])
command_template = [sys.argv[2], '--exec']
# fdbcli_tests.py <path_to_fdbcli_binary> <path_to_fdb_cluster_file>
assert len(sys.argv) == 3, "Please pass arguments: <path_to_fdbcli_binary> <path_to_fdb_cluster_file>"
# shell command template
command_template = [sys.argv[1], '-C', sys.argv[2], '--exec']
# tests for fdbcli commands
# assertions will fail if fdbcli does not work as expected
advanceversion()
maintenance()
maintenance()