Skip to content

Commit

Permalink
Add systests to CI and fix for rocksdb mode (issue nanocurrency#3447)…
Browse files Browse the repository at this point in the history
… (issue nanocurrency#3452)

Fix systests when running in rocksdb mode (different ledger files)
Fix for CI build of nano_node that default to dev network
Add systests into github per commit CI.
  • Loading branch information
dsiganos committed Sep 22, 2021
1 parent a15f239 commit f008c17
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
6 changes: 5 additions & 1 deletion ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ run_tests() {
xvfb_run_ ./qt_test
qt_test_res=${?}

(cd ../systest && export NANO_NODE_EXE=../build/nano_node && ${TIMEOUT_CMD} ${TIMEOUT_TIME_ARG} 300 ./RUNALL)
sys_test_res=${?}

echo "Core Test return code: ${core_test_res}"
echo "RPC Test return code: ${rpc_test_res}"
echo "QT Test return code: ${qt_test_res}"
if [[ ${core_test_res} != 0 || ${rpc_test_res} != 0 || ${qt_test_res} != 0 ]]; then
echo "Sys Test return code: ${sys_test_res}"
if [[ ${core_test_res} != 0 || ${rpc_test_res} != 0 || ${qt_test_res} != 0 || ${sys_test_res} != 0 ]]; then
return 1
else
return 0
Expand Down
5 changes: 4 additions & 1 deletion systest/RUNALL
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

set -e

failed=0

for script in *.sh; do
echo Running script: $script
./$script;
done

echo All systest passed.
echo All systests passed.
9 changes: 5 additions & 4 deletions systest/cli_wallet_create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ SEED=CEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEEDCEED
NANO_NODE_EXE=${NANO_NODE_EXE:-../../build/nano_node}

clean_data_dir() {
rm -f $DATADIR/log/log_*.log
rm -f $DATADIR/wallets.ldb*
rm -f $DATADIR/data.ldb*
rm -f $DATADIR/config-*.toml
rm -f $DATADIR/log/log_*.log
rm -f $DATADIR/wallets.ldb*
rm -f $DATADIR/data.ldb*
rm -f $DATADIR/config-*.toml
rm -rf "$DATADIR"/rocksdb/
}

mkdir -p $DATADIR/log
Expand Down
14 changes: 7 additions & 7 deletions systest/node_initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ DATADIR=data.systest
NANO_NODE_EXE=${NANO_NODE_EXE:-../../build/nano_node}

clean_data_dir() {
rm -f "$DATADIR"/log/log_*.log
rm -f "$DATADIR"/wallets.ldb*
rm -f "$DATADIR"/data.ldb*
rm -f "$DATADIR"/config-*.toml
rm -f "$DATADIR"/log/log_*.log
rm -f "$DATADIR"/wallets.ldb*
rm -f "$DATADIR"/data.ldb*
rm -f "$DATADIR"/config-*.toml
rm -rf "$DATADIR"/rocksdb/
}

test_initialize_cmd() {
Expand All @@ -29,8 +30,7 @@ test_initialize_cmd() {
# check that it is the live network
grep -q "Active network: $netmatch" "$DATADIR"/log/log_*.log

# check that the ledger file is created
test -e "$DATADIR/data.ldb"
# check that the ledger file is created and has one block, the genesis block
$NANO_NODE_EXE --debug_block_count --data_path "$DATADIR" "$netcmd" "$netarg" | grep -q 'Block count: 1'

# check the genesis block is correct
Expand All @@ -39,7 +39,7 @@ test_initialize_cmd() {

mkdir -p "$DATADIR/log"

test_initialize_cmd "live" "" "" "991CF190094C00F0B68E2E5F75F6BEE95A2E0BD93CEAA4A6734DB9F19B728948"
#test_initialize_cmd "live" "" "" "991CF190094C00F0B68E2E5F75F6BEE95A2E0BD93CEAA4A6734DB9F19B728948"
test_initialize_cmd "live" "--network" "live" "991CF190094C00F0B68E2E5F75F6BEE95A2E0BD93CEAA4A6734DB9F19B728948"
test_initialize_cmd "beta" "--network" "beta" "01A92459E69440D5C1088D3B31F4CA678BE944BAB3776C2E6B7665E9BD99BD5A"
test_initialize_cmd "test" "--network" "test" "B1D60C0B886B57401EF5A1DAA04340E53726AA6F4D706C085706F31BBD100CEE"
Expand Down
9 changes: 5 additions & 4 deletions systest/set_bandwidth_params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ set -e
DATADIR=data.systest

clean_data_dir() {
rm -f "$DATADIR"/log/log_*.log
rm -f "$DATADIR"/wallets.ldb*
rm -f "$DATADIR"/data.ldb*
rm -f "$DATADIR"/config-*.toml
rm -f "$DATADIR"/log/log_*.log
rm -f "$DATADIR"/wallets.ldb*
rm -f "$DATADIR"/data.ldb*
rm -f "$DATADIR"/config-*.toml
rm -rf "$DATADIR"/rocksdb/
}

msg() {
Expand Down

0 comments on commit f008c17

Please sign in to comment.