Merge pull request #3164 from TheBlueMatt/master

Re-enable BitcoindComparisonTool on pull-tester
This commit is contained in:
Gavin Andresen 2013-10-27 22:42:44 -07:00
commit cd1fc2434c
7 changed files with 44 additions and 15 deletions

View File

@ -118,7 +118,8 @@ test_bitcoin_filtered.info: test_bitcoin.info
$(LCOV) -r $< "/usr/include/*" -o $@ $(LCOV) -r $< "/usr/include/*" -o $@
block_test.info: test_bitcoin_filtered.info block_test.info: test_bitcoin_filtered.info
-@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -Xmx2G -jar $(JAVA_COMPARISON_TOOL) 1 18444 $(MKDIR_P) qa/tmp
-@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0 18444
$(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@ $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
$(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src
$(LCOV) -z -d $(abs_builddir)/src/leveldb $(LCOV) -z -d $(abs_builddir)/src/leveldb
@ -146,7 +147,8 @@ endif
if USE_COMPARISON_TOOL if USE_COMPARISON_TOOL
check-local: check-local:
@qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -Xmx2G -jar $(JAVA_COMPARISON_TOOL) 1 18444 $(MKDIR_P) qa/tmp
@qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 18444
endif endif
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh $(WINDOWS_PACKAGING) $(OSX_PACKAGING) EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh $(WINDOWS_PACKAGING) $(OSX_PACKAGING)

View File

@ -69,10 +69,15 @@ AC_ARG_ENABLE(tests,
[use_tests=yes]) [use_tests=yes])
AC_ARG_WITH([comparison-tool], AC_ARG_WITH([comparison-tool],
AS_HELP_STRING([with-comparison-tool],[path to java comparison tool (requires --enable-tests)]), AS_HELP_STRING([--with-comparison-tool],[path to java comparison tool (requires --enable-tests)]),
[use_comparison_tool=$withval], [use_comparison_tool=$withval],
[use_comparison_tool=no]) [use_comparison_tool=no])
AC_ARG_ENABLE([comparison-tool-reorg-tests],
AS_HELP_STRING([--enable-comparison-tool-reorg-tests],[enable expensive reorg tests in the comparison tool (default no)]),
[use_comparison_tool_reorg_tests=$enableval],
[use_comparison_tool_reorg_tests=no])
AC_ARG_WITH([qrencode], AC_ARG_WITH([qrencode],
[AS_HELP_STRING([--with-qrencode], [AS_HELP_STRING([--with-qrencode],
[enable QR code support (default is yes if qt is enabled and libqrencode is found)])], [enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
@ -235,6 +240,15 @@ if test x$use_comparison_tool != xno; then
AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool) AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
fi fi
if test x$use_comparison_tool_reorg_tests != xno; then
if test x$use_comparison_tool == x; then
AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified")
fi
AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1)
else
AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0)
fi
if test x$use_lcov == xyes; then if test x$use_lcov == xyes; then
if test x$LCOV == x; then if test x$LCOV == x; then
AC_MSG_ERROR("lcov testing requested but lcov not found") AC_MSG_ERROR("lcov testing requested but lcov not found")
@ -678,6 +692,7 @@ AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes]) AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes])
AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version]) AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version]) AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])

View File

@ -9,8 +9,9 @@ set -o xtrace
MINGWPREFIX=$1 MINGWPREFIX=$1
JAVA_COMPARISON_TOOL=$2 JAVA_COMPARISON_TOOL=$2
JOBS=${3-1} RUN_LARGE_REORGS=$3
OUT_DIR=${4-} JOBS=${4-1}
OUT_DIR=${5-}
if [ $# -lt 2 ]; then if [ $# -lt 2 ]; then
echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs> <save output dir>" echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs> <save output dir>"
@ -32,10 +33,11 @@ cd @abs_top_srcdir@
make distdir make distdir
mv $DISTDIR linux-build mv $DISTDIR linux-build
cd linux-build cd linux-build
# TODO: re-enable blockchain tester tool, as of 11 Oct 2013 is it not working properly if [ $RUN_LARGE_REORGS = 1 ]; then
# on the pull-tester machine. ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" --enable-comparison-tool-reorg-tests
#./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" else
./configure --disable-silent-rules --disable-ccache ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
fi
make -j$JOBS make -j$JOBS
# link interesting binaries to parent out/ directory, if it exists. Do this before # link interesting binaries to parent out/ directory, if it exists. Do this before

View File

@ -67,7 +67,12 @@ Contact BlueMatt on freenode if something looks broken."""
auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"])) auth=(os.environ['GITHUB_USER'], os.environ["GITHUB_AUTH_TOKEN"]))
if success == True: if success == True:
post_data = { "body" : "Automatic sanity-testing: PASSED, see " + linkUrl + " for binaries and test log." + common_message} if needTests:
message = "Automatic sanity-testing: PLEASE ADD TEST-CASES, though technically passed. See " + linkUrl + " for binaries and test log."
else:
message = "Automatic sanity-testing: PASSED, see " + linkUrl + " for binaries and test log."
post_data = { "body" : message + common_message}
elif inMerge: elif inMerge:
post_data = { "body" : "Automatic sanity-testing: FAILED MERGE, see " + linkUrl + " for test log." + """ post_data = { "body" : "Automatic sanity-testing: FAILED MERGE, see " + linkUrl + " for test log." + """
@ -113,7 +118,7 @@ def testpull(number, comment_url, clone_url, commit):
run("chown -R ${BUILD_USER}:${BUILD_GROUP} ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False) run("chown -R ${BUILD_USER}:${BUILD_GROUP} ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False)
script = os.environ["BUILD_PATH"]+"/qa/pull-tester/pull-tester.sh" script = os.environ["BUILD_PATH"]+"/qa/pull-tester/pull-tester.sh"
script += " ${BUILD_PATH} ${MINGW_DEPS_DIR} ${SCRIPTS_DIR}/BitcoindComparisonTool.jar 6 ${OUT_DIR}" script += " ${BUILD_PATH} ${MINGW_DEPS_DIR} ${SCRIPTS_DIR}/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar 0 6 ${OUT_DIR}"
returncode = run("chroot ${CHROOT_COPY} sudo -u ${BUILD_USER} -H timeout ${TEST_TIMEOUT} "+script, returncode = run("chroot ${CHROOT_COPY} sudo -u ${BUILD_USER} -H timeout ${TEST_TIMEOUT} "+script,
fail_hard=False, stdout=out, stderr=out) fail_hard=False, stdout=out, stderr=out)

View File

@ -5,7 +5,7 @@ mkdir -p "$DATADIR"/regtest
touch "$DATADIR/regtest/debug.log" touch "$DATADIR/regtest/debug.log"
tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" &
WAITER=$! WAITER=$!
"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -logtimestamps -port=18444 -regtest & "@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=18444 -regtest &
BITCOIND=$! BITCOIND=$!
#Install a watchdog. #Install a watchdog.

View File

@ -2355,7 +2355,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo
uniqueTx.insert(block.GetTxHash(i)); uniqueTx.insert(block.GetTxHash(i));
} }
if (uniqueTx.size() != block.vtx.size()) if (uniqueTx.size() != block.vtx.size())
return state.DoS(100, error("CheckBlock() : duplicate transaction")); return state.DoS(100, error("CheckBlock() : duplicate transaction"), true);
unsigned int nSigOps = 0; unsigned int nSigOps = 0;
BOOST_FOREACH(const CTransaction& tx, block.vtx) BOOST_FOREACH(const CTransaction& tx, block.vtx)
@ -3783,7 +3783,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
LOCK(cs_main); LOCK(cs_main);
CValidationState state; CValidationState state;
if (ProcessBlock(state, pfrom, &block)) if (ProcessBlock(state, pfrom, &block) || state.CorruptionPossible())
mapAlreadyAskedFor.erase(inv); mapAlreadyAskedFor.erase(inv);
int nDoS = 0; int nDoS = 0;
if (state.IsInvalid(nDoS)) if (state.IsInvalid(nDoS))

View File

@ -946,13 +946,15 @@ private:
MODE_ERROR, // run-time error MODE_ERROR, // run-time error
} mode; } mode;
int nDoS; int nDoS;
bool corruptionPossible;
public: public:
CValidationState() : mode(MODE_VALID), nDoS(0) {} CValidationState() : mode(MODE_VALID), nDoS(0) {}
bool DoS(int level, bool ret = false) { bool DoS(int level, bool ret = false, bool corruptionIn = false) {
if (mode == MODE_ERROR) if (mode == MODE_ERROR)
return ret; return ret;
nDoS += level; nDoS += level;
mode = MODE_INVALID; mode = MODE_INVALID;
corruptionPossible = corruptionIn;
return ret; return ret;
} }
bool Invalid(bool ret = false) { bool Invalid(bool ret = false) {
@ -982,6 +984,9 @@ public:
} }
return false; return false;
} }
bool CorruptionPossible() {
return corruptionPossible;
}
}; };
/** An in-memory indexed chain of blocks. */ /** An in-memory indexed chain of blocks. */