aboutsummaryrefslogtreecommitdiff
path: root/src/test/torcontrol_tests.cpp
AgeCommit message (Collapse)Author
2021-05-28test: remove BasicTestingSetup from torcontrol unit testsfanquake
2019-11-06scripted-diff: test: Move setup_common to test libraryMarcoFalke
-BEGIN VERIFY SCRIPT- # Move files for f in $(git ls-files src/test/lib/); do git mv $f src/test/util/; done git mv src/test/setup_common.cpp src/test/util/ git mv src/test/setup_common.h src/test/util/ # Replace Windows paths sed -i -e 's|\\setup_common|\\util\\setup_common|g' $(git grep -l '\\setup_common') sed -i -e 's|src\\test\\lib\\|src\\test\\util\\|g' build_msvc/test_bitcoin/test_bitcoin.vcxproj # Everything else sed -i -e 's|/setup_common|/util/setup_common|g' $(git grep -l 'setup_common') sed -i -e 's|test/lib/|test/util/|g' $(git grep -l 'test/lib/') # Fix include guard sed -i -e 's|BITCOIN_TEST_SETUP_COMMON_H|BITCOIN_TEST_UTIL_SETUP_COMMON_H|g' ./src/test/util/setup_common.h sed -i -e 's|BITCOIN_TEST_LIB_|BITCOIN_TEST_UTIL_|g' $(git grep -l 'BITCOIN_TEST_LIB_') -END VERIFY SCRIPT-
2019-06-02Make reasoning about dependencies easier by not including unused dependenciespracticalswift
2019-04-16Merge #15352: tests: Reduce noise level in test_bitcoin outputMarcoFalke
0aef39d067 Silence "Test case [...] did not check any assertions" warnings when running "test_bitcoin --log_level=test_suite" (practicalswift) 5fd73c8694 Avoid repeated log messages in tests by connecting to signal handlers (ThreadSafeMessageBox, etc.) only once (practicalswift) e502c3c515 tests: Reduce noise level in test_bitcoin output (practicalswift) Pull request description: Reduce noise level in `test_bitcoin` output. Context: When working on the non-determinism issues in the unit tests (see #15296) I got a bit tired of the amount of noise in the `test_bitcoin` output :-) Before: ``` $ src/test/test_bitcoin --log_level=test_suite 2>&1 | grep -vE '(Entering|Leaving)' | uniq -c 1 Running 341 test cases... 1 Test case blockencodings_tests/TransactionsRequestDeserializationOverflowTest did not check any assertions 1 CheckSplitTorReplyLine(PROTOCOLINFO PIVERSION) 1 CheckSplitTorReplyLine(AUTH METHODS=COOKIE,SAFECOOKIE COOKIEFILE="/home/x/.tor/control_auth_cookie") 1 CheckSplitTorReplyLine(AUTH METHODS=NULL) 1 CheckSplitTorReplyLine(AUTH METHODS=HASHEDPASSWORD) 1 CheckSplitTorReplyLine(VERSION Tor="0.2.9.8 (git-a0df013ea241b026)") 1 CheckSplitTorReplyLine(AUTHCHALLENGE SERVERHASH=aaaa SERVERNONCE=bbbb) 1 CheckSplitTorReplyLine(COMMAND) 1 CheckSplitTorReplyLine(COMMAND SOME ARGS) 1 CheckSplitTorReplyLine(COMMAND ARGS) 1 CheckSplitTorReplyLine(COMMAND EVEN+more ARGS) 1 CheckParseTorReplyMapping(METHODS=COOKIE,SAFECOOKIE COOKIEFILE="/home/x/.tor/control_auth_cookie") 1 CheckParseTorReplyMapping(METHODS=NULL) 1 CheckParseTorReplyMapping(METHODS=HASHEDPASSWORD) 1 CheckParseTorReplyMapping(Tor="0.2.9.8 (git-a0df013ea241b026)") 1 CheckParseTorReplyMapping(SERVERHASH=aaaa SERVERNONCE=bbbb) 1 CheckParseTorReplyMapping(ServiceID=exampleonion1234) 1 CheckParseTorReplyMapping(PrivateKey=RSA1024:BLOB) 1 CheckParseTorReplyMapping(ClientAuth=bob:BLOB) 1 CheckParseTorReplyMapping(Foo=Bar=Baz Spam=Eggs) 1 CheckParseTorReplyMapping(Foo="Bar=Baz") 1 CheckParseTorReplyMapping(Foo="Bar Baz") 1 CheckParseTorReplyMapping(Foo="Bar\ Baz") 1 CheckParseTorReplyMapping(Foo="Bar\Baz") 1 CheckParseTorReplyMapping(Foo="Bar\@Baz") 1 CheckParseTorReplyMapping(Foo="Bar\"Baz" Spam="\"Eggs\"") 1 CheckParseTorReplyMapping(Foo="Bar\\Baz") 1 CheckParseTorReplyMapping(Foo="Bar\nBaz\t" Spam="\rEggs" Octals="\1a\11\17\18\81\377\378\400\2222" Final=Check) 1 CheckParseTorReplyMapping(Valid=Mapping Escaped="Escape\\") 1 CheckParseTorReplyMapping(Valid=Mapping Bare="Escape\") 1 CheckParseTorReplyMapping(OneOctal="OneEnd\1" TwoOctal="TwoEnd\11") 1 CheckParseTorReplyMapping(Null="\0") 1 CheckParseTorReplyMapping(SOME=args,here MORE optional=arguments here) 1 CheckParseTorReplyMapping(ARGS) 1 CheckParseTorReplyMapping(MORE ARGS) 1 CheckParseTorReplyMapping(MORE ARGS) 1 CheckParseTorReplyMapping(EVEN more=ARGS) 1 CheckParseTorReplyMapping(EVEN+more ARGS) 1 Test case util_tests/util_criticalsection did not check any assertions 1 Testing known outcomes 326 Error: Specified -walletdir "/tmp/test_bitcoin/1553850209_943311758/tempdir/path_does_not_exist" does not exist 327 Error: Specified -walletdir "/tmp/test_bitcoin/1553850209_643733972/tempdir/not_a_directory.dat" is not a directory 328 Error: Specified -walletdir "wallets" is a relative path 1 1 *** No errors detected ``` After: ``` $ src/test/test_bitcoin --log_level=test_suite 2>&1 | grep -vE '(Entering|Leaving)' | uniq -c 1 Running 341 test cases... 1 Error: Specified -walletdir "/tmp/test_bitcoin/1553850026_943311758/tempdir/path_does_not_exist" does not exist 1 Error: Specified -walletdir "/tmp/test_bitcoin/1553850026_643733972/tempdir/not_a_directory.dat" is not a directory 1 Error: Specified -walletdir "wallets" is a relative path 1 1 *** No errors detected ``` ACKs for commit 0aef39: MarcoFalke: utACK 0aef39d0678ec2f26633028d44eea0ba0087e7c0 Tree-SHA512: 9cc22f64aa5c875861bae6533d18675ad978c623f053754deef6a8e271ea70bda3f72fb4ec5c8fd19b841757f21380639051d5f5b44301b9d2464b57655e9c05
2019-04-11scripted-diff: Rename test_bitcoin to test/setup_commonMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i --regexp-extended -e 's/test_bitcoin\.(h|cpp)/setup_common.\1/g' $(git grep -l test_bitcoin) git mv ./src/test/test_bitcoin.h ./src/test/setup_common.h git mv ./src/test/test_bitcoin.cpp ./src/test/setup_common.cpp sed -i -e 's/BITCOIN_TEST_TEST_BITCOIN_H/BITCOIN_TEST_SETUP_COMMON_H/g' ./src/test/setup_common.h -END VERIFY SCRIPT-
2019-03-29tests: Reduce noise level in test_bitcoin outputpracticalswift
2018-05-21Declare TorReply parsing functions in torcontrol_testsBen Woosley
Rather than including the implementation file into the test, which is bad practice.
2018-05-03Make it clear which functions that are intended to be translation unit localpracticalswift
Do not share functions that are meant to be translation unit local with other translation units. Use internal linkage for those consistently.
2018-04-11test: Fix sign for expected valuesKarl-Johan Alm
A number of BOOST_CHECK_EQUAL calls would result in warnings about signs.
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
2017-05-16torcontrol: Handle escapes in Tor QuotedStringsJack Grigg
https://trac.torproject.org/projects/tor/ticket/14999 is tracking an encoding bug with the Tor control protocol, where many of the QuotedString instances that Tor outputs are in fact CStrings, but it is not documented which ones are which. https://spec.torproject.org/control-spec section 2.1.1 provides a future-proofed rule for handing QuotedStrings, which this commit implements. This commit merges all six commits from https://github.com/zcash/zcash/pull/2251
2017-05-16torcontrol: Add unit tests for Tor reply parsersJack Grigg