.. | ||
config | ||
test_framework | ||
utility | ||
cache_test.py | ||
ccov.sh | ||
cli_submission_test.py | ||
crash_test.py | ||
dep_pip3.sh | ||
example_test.py | ||
fuzz_test.py | ||
mine_test.py | ||
parallel_submission_test.py | ||
partial_submission_test.py | ||
random_test.py | ||
readme.md | ||
recovery_test.py | ||
revert_test.py | ||
rpc_test.py | ||
same_root_test.py | ||
submission_test.py | ||
sync_test.py | ||
test_all.py |
Python Tests for Storage node
Prerequisites
-
Required python version: 3.8, 3.9, 3.10, higher version is not guaranteed (e.g. failed to install
pysha3
). -
Install dependencies under root folder:
pip3 install -r requirements.txt
Dependent Binaries
Python test framework will launch blockchain fullnodes at local for storage node to interact with. There are 2 kinds of fullnodes supported:
- Conflux eSpace node (by default).
- BSC node (geth).
For Conflux eSpace node, the test framework will automatically compile the binary at runtime, and copy the binary to tests/tmp
folder. For BSC node, the test framework will automatically download the latest version binary from github to tests/tmp
folder.
Alternatively, you could also manually copy specific versoin binaries (conflux or geth) to the tests/tmp
folder. Note, do NOT copy released conflux binary on github, since block height of some CIPs are hardcoded.
Run Tests
Go to the tests
folder and run following command to run all tests:
python test_all.py
or, run any single test, e.g.
python sync_test.py
Troubleshootings
- Test failed due to blockchain fullnode rpc inaccessible.
- Traceback:
node.wait_for_rpc_connection()
- Solution: unset the
http_proxy
andhttps_proxy
environment variables if configured.