diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 98eafc9dd95eaac0832b0bfd5760af2a42a3db36..d7b14896a8a1b6b01bb08c8e9c74b9fbfcd80a91 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -59,7 +59,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/restart-scenarios-test.py ${CMAKE_CUR configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testUtils.py ${CMAKE_CURRENT_BINARY_DIR}/testUtils.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosiod_run_test.py ${CMAKE_CURRENT_BINARY_DIR}/eosiod_run_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosiod_run_remote_test.py ${CMAKE_CURRENT_BINARY_DIR}/eosiod_run_remote_test.py COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/consensusValidationMaliciousProducers.py ${CMAKE_CURRENT_BINARY_DIR}/consensusValidationMaliciousProducers.py COPYONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/consensus-validation-malicious-producers.py ${CMAKE_CURRENT_BINARY_DIR}/consensus-validation-malicious-producers.py COPYONLY) add_test(chain_test chain_test --report_level=detailed) add_test(NAME eosiod_run_test COMMAND tests/eosiod_run_test.py -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) @@ -76,8 +76,9 @@ endif() # TODO: add_test(NAME trans_sync_across_mixed_cluster_test COMMAND tests/trans_sync_across_mixed_cluster_test.sh -p 1 -n 2 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) # TODO: add_test(NAME distributed-transactions-test COMMAND tests/distributed-transactions-test.py -p 1 -n 4 --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) # TODO: add_test(NAME distributed-transactions-remote-test COMMAND tests/distributed-transactions-remote-test.py --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) -# TODO: add_test(NAME restart-scenarios-test_resync COMMAND tests/restart-scenarios-test.py -c resync -p3 --dumpErrorDetails WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) -# TODO: add_test(NAME restart-scenarios-test_replay COMMAND tests/restart-scenarios-test.py -c replay -p3 --dumpErrorDetails WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +# TODO: add_test(NAME restart-scenarios-test_resync COMMAND tests/restart-scenarios-test.py -c resync -p3 --dump-error-details WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +# TODO: add_test(NAME restart-scenarios-test_replay COMMAND tests/restart-scenarios-test.py -c replay -p3 --dump-error-details WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +# TODO: add_test(NAME consensus-validation-malicious-producers COMMAND tests/consensus-validation-malicious-producers.py -w 80 --dump-error-details WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) if(ENABLE_COVERAGE_TESTING) diff --git a/tests/consensusValidationMaliciousProducers.py b/tests/consensus-validation-malicious-producers.py similarity index 97% rename from tests/consensusValidationMaliciousProducers.py rename to tests/consensus-validation-malicious-producers.py index 751cc49100b037f29ecd0e68e49e7cf4e9108e90..a48e4da30750c498689f26bf281cbaad0da2c072 100755 --- a/tests/consensusValidationMaliciousProducers.py +++ b/tests/consensus-validation-malicious-producers.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import testUtils @@ -206,23 +206,23 @@ tests=[1,2,3] parser.add_argument("-t", "--tests", type=str, help="1|2|3 1=run no malicious producers test, 2=minority malicious, 3=majority malicious.", default=None) parser.add_argument("-w", type=int, help="system wait time", default=testUtils.Utils.systemWaitTimeout) parser.add_argument("-v", help="verbose logging", action='store_true') -parser.add_argument("--dumpErrorDetails", +parser.add_argument("--dump-error-details", help="Upon error print tn_data_*/config.ini and tn_data_*/stderr.log to stdout", action='store_true') -parser.add_argument("--keepLogs", help="Don't delete tn_data_* folders upon test completion", +parser.add_argument("--keep-logs", help="Don't delete tn_data_* folders upon test completion", action='store_true') parser.add_argument("--not-noon", help="This is not the Noon branch.", action='store_true') -parser.add_argument("--dontKill", help="Leave cluster running after test finishes", action='store_true') +parser.add_argument("--dont-kill", help="Leave cluster running after test finishes", action='store_true') args = parser.parse_args() testsArg=args.tests debug=args.v waitTimeout=args.w -dumpErrorDetails=args.dumpErrorDetails -keepLogs=args.keepLogs +dumpErrorDetails=args.dump-error-details +keepLogs=args.keep-logs amINoon=not args.not_noon -killEosInstances= not args.dontKill -killWallet= not args.dontKill +killEosInstances= not args.dont-kill +killWallet= not args.dont-kill testUtils.Utils.Debug=debug diff --git a/tests/distributed-transactions-remote-test.py b/tests/distributed-transactions-remote-test.py index bb7451f1dcef609c7df04cb0a8b9398254ce9d92..8714eda9bd597595f029192fa69c20270a14d3ee 100755 --- a/tests/distributed-transactions-remote-test.py +++ b/tests/distributed-transactions-remote-test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import testUtils diff --git a/tests/distributed-transactions-test.py b/tests/distributed-transactions-test.py index e2edb7d31c37e110eb828463a6ec64d2ab0bde4d..e5f468d82076d846569008724128a8e6f0383dcc 100755 --- a/tests/distributed-transactions-test.py +++ b/tests/distributed-transactions-test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import testUtils diff --git a/tests/eosiod_run_remote_test.py b/tests/eosiod_run_remote_test.py index 5d88b139a99e3c1dc8e0931c492a4563d16b9b94..b5825bf294ef708e2a4589802ed734bd66613001 100755 --- a/tests/eosiod_run_remote_test.py +++ b/tests/eosiod_run_remote_test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import testUtils diff --git a/tests/eosiod_run_test.py b/tests/eosiod_run_test.py index 1cc2f0ee0af263aed26426da7be2fc361ca54e04..e8cb278d1d258390b45caee5cd4232d01e5004b9 100755 --- a/tests/eosiod_run_test.py +++ b/tests/eosiod_run_test.py @@ -9,8 +9,8 @@ import re ############################################################### # eosiod_run_test -# --dumpErrorDetails -# --keepLogs +# --dump-error-details +# --keep-logs ############################################################### Print=testUtils.Utils.Print diff --git a/tests/restart-scenarios-test.py b/tests/restart-scenarios-test.py index f982b08ca8b3672244e5e3621df51017a617d3ec..df57703343960c03d8065aa6de34edd1873df927 100755 --- a/tests/restart-scenarios-test.py +++ b/tests/restart-scenarios-test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import testUtils @@ -14,11 +14,11 @@ import signal # -s # -d # -v -# --killSig -# --killCount -# --dontKill -# --dumpErrorDetails -# --keepLogs +# --kill-sig +# --kill-count +# --dont-kill +# --dump-error-details +# --keep-logs ############################################################### @@ -36,16 +36,16 @@ parser.add_argument("-s", type=str, help="topology", default="mesh") parser.add_argument("-c", type=str, help="chain strategy[%s|%s|%s]" % (testUtils.Utils.SyncResyncTag, testUtils.Utils.SyncReplayTag, testUtils.Utils.SyncNoneTag), default=testUtils.Utils.SyncResyncTag) -parser.add_argument("--killSig", type=str, help="kill signal[%s|%s]" % +parser.add_argument("--kill-sig", type=str, help="kill signal[%s|%s]" % (testUtils.Utils.SigKillTag, testUtils.Utils.SigTermTag), default=testUtils.Utils.SigKillTag) -parser.add_argument("--killCount", type=int, help="eosiod instances to kill", default=-1) +parser.add_argument("--kill-count", type=int, help="eosiod instances to kill", default=-1) parser.add_argument("-v", help="verbose logging", action='store_true') -parser.add_argument("--dontKill", help="Leave cluster running after test finishes", action='store_true') +parser.add_argument("--dont-kill", help="Leave cluster running after test finishes", action='store_true') parser.add_argument("--not-noon", help="This is not the Noon branch.", action='store_true') -parser.add_argument("--dumpErrorDetails", +parser.add_argument("--dump-error-details", help="Upon error print tn_data_*/config.ini and tn_data_*/stderr.log to stdout", action='store_true') -parser.add_argument("--keepLogs", help="Don't delete tn_data_* folders upon test completion", +parser.add_argument("--keep-logs", help="Don't delete tn_data_* folders upon test completion", action='store_true') args = parser.parse_args() @@ -55,11 +55,11 @@ delay=args.d chainSyncStrategyStr=args.c debug=args.v total_nodes = pnodes -killCount=args.killCount if args.killCount > 0 else int(round((DefaultKillPercent/100.0)*total_nodes)) -killSignal=args.killSig -killEosInstances= not args.dontKill -dumpErrorDetails=args.dumpErrorDetails -keepLogs=args.keepLogs +killCount=args.kill-count if args.kill-count > 0 else int(round((DefaultKillPercent/100.0)*total_nodes)) +killSignal=args.kill-sig +killEosInstances= not args.dont-kill +dumpErrorDetails=args.dump_error_details +keepLogs=args.keep-logs amINoon=not args.not_noon testUtils.Utils.Debug=debug