Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -668,26 +668,26 @@ jobs:
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: zebrad-${{ matrix.name }}
path: ./src
path: ./bin

- name: Download zainod artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: zainod-${{ matrix.name }}
path: ./src
path: ./bin

- name: Download zallet artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: zallet-${{ matrix.name }}
path: ./src
path: ./bin

- name: Make artifact executable
if: runner.os != 'Windows'
run: |
chmod +x ${{ format('./src/zebrad{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zainod{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zallet{0}', matrix.file_ext) }}
chmod +x ${{ format('./bin/zebrad{0}', matrix.file_ext) }}
chmod +x ${{ format('./bin/zainod{0}', matrix.file_ext) }}
chmod +x ${{ format('./bin/zallet{0}', matrix.file_ext) }}

- name: Run sec-hard test
shell: bash
Expand Down Expand Up @@ -802,26 +802,26 @@ jobs:
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: zebrad-${{ matrix.name }}
path: ./src
path: ./bin

- name: Download zainod artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: zainod-${{ matrix.name }}
path: ./src
path: ./bin

- name: Download zallet artifact
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: zallet-${{ matrix.name }}
path: ./src
path: ./bin

- name: Make artifact executable
if: runner.os != 'Windows'
run: |
chmod +x ${{ format('./src/zebrad{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zainod{0}', matrix.file_ext) }}
chmod +x ${{ format('./src/zallet{0}', matrix.file_ext) }}
chmod +x ${{ format('./bin/zebrad{0}', matrix.file_ext) }}
chmod +x ${{ format('./bin/zainod{0}', matrix.file_ext) }}
chmod +x ${{ format('./bin/zallet{0}', matrix.file_ext) }}

- name: Get Sprout parameters
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
Expand Down Expand Up @@ -878,7 +878,7 @@ jobs:
sys.exit(1)
EOF
. ./venv/bin/activate
ZEBRAD=$(pwd)/${{ format('src/zebrad{0}', matrix.file_ext) }} ZAINOD=$(pwd)/${{ format('src/zainod{0}', matrix.file_ext) }} ZALLET=$(pwd)/${{ format('src/zallet{0}', matrix.file_ext) }} SRC_DIR=$(pwd) python3 ./subclass.py
ZEBRAD=$(pwd)/${{ format('bin/zebrad{0}', matrix.file_ext) }} ZAINOD=$(pwd)/${{ format('bin/zainod{0}', matrix.file_ext) }} ZALLET=$(pwd)/${{ format('bin/zallet{0}', matrix.file_ext) }} SRC_DIR=$(pwd) python3 ./subclass.py

- uses: ./.github/actions/finish-interop
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
qa/pull-tester/tests_config.py
qa/pull-tester/tests_config.ini
qa/cache/*
src/*
bin/*

poetry.lock
.venv
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ codebase, with the Python test framework (and some of the tests) inherited from
### Running the tests locally

- Clone the repository.
- Build `zebrad`, `zainod`, and `zallet` binaries, and place them in a folder
`./src/` under the repository root.
- Build `zebrad`, `zainod`, and `zallet` binaries, and place them in a directory
`./bin/` under the repository root.

#### With uv (recommended)

Expand Down
1 change: 1 addition & 0 deletions bin/.gitinclude
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory is "INTENTIONALLY LEFT BLANK". Its purpose is to hold binaries for users that prefer to keep those references in the working directory. The contents of this directory are not intended to be tracked by git.
6 changes: 3 additions & 3 deletions qa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pip3 install pyzmq base58 toml
Setup
=====

By default, binaries must exist in the `../src ` folder. All tests require the `zebrad`
By default, binaries must exist in the `../bin` directory. All tests require the `zebrad`
binary; most tests require the `zallet` binary; some tests require the `zainod` binary.

Alternatively, you can set the binary paths with:
Expand Down Expand Up @@ -61,8 +61,8 @@ Possible options, which apply to each individual test run:
-h, --help show this help message and exit
--nocleanup Leave zcashds and test.* datadir on exit or error
--noshutdown Don't stop zcashds after the test execution
--srcdir=SRCDIR Source directory containing zcashd/zcash-cli
(default: ../../src)
--bindir=BINDIR Directory containing zallet/zainod/zebrad
(default: ../../bin)
--tmpdir=TMPDIR Root directory for datadirs
--tracerpc Print out all RPC calls as they are made
--coveragedir=COVERAGEDIR
Expand Down
8 changes: 4 additions & 4 deletions qa/pull-tester/rpc-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ def run_tests(test_handler, test_list, src_dir, build_dir, exeext, jobs=1, enabl

#Set env vars
if "ZEBRAD" not in os.environ:
os.environ["ZEBRAD"] = os.path.join(build_dir, "src", "zebrad" + exeext)
os.environ["ZEBRAD"] = os.path.join(build_dir, "bin", "zebrad" + exeext)
if "ZAINOD" not in os.environ:
os.environ["ZAINOD"] = os.path.join(build_dir, "src", "zainod" + exeext)
os.environ["ZAINOD"] = os.path.join(build_dir, "bin", "zainod" + exeext)
if "ZALLET" not in os.environ:
os.environ["ZALLET"] = os.path.join(build_dir, "src", "zallet" + exeext)
os.environ["ZALLET"] = os.path.join(build_dir, "bin", "zallet" + exeext)

tests_dir = src_dir + '/qa/rpc-tests/'

flags = ["--srcdir={}/src".format(build_dir)] + args
flags = ["--bindir={}/bin".format(build_dir)] + args
flags.append("--cachedir=%s/qa/cache" % build_dir)

if enable_coverage:
Expand Down
6 changes: 3 additions & 3 deletions qa/rpc-tests/test_framework/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def main(self):
help="Leave bitcoinds and test.* datadir on exit or error")
parser.add_option("--noshutdown", dest="noshutdown", default=False, action="store_true",
help="Don't stop bitcoinds after the test execution")
parser.add_option("--srcdir", dest="srcdir", default="../../src",
help="Source directory containing bitcoind/bitcoin-cli (default: %default)")
parser.add_option("--bindir", dest="bindir", default="../../bin",
help="Directory containing zebrad/zainod/zallet (default: %default)")
parser.add_option("--cachedir", dest="cachedir", default=os.path.normpath(os.path.dirname(os.path.realpath(__file__))+"/../../cache"),
help="Directory for caching pregenerated datadirs")
parser.add_option("--tmpdir", dest="tmpdir", default=tempfile.mkdtemp(prefix="test"),
Expand All @@ -191,7 +191,7 @@ def main(self):

PortSeed.n = self.options.port_seed

os.environ['PATH'] = self.options.srcdir+":"+os.environ['PATH']
os.environ['PATH'] = self.options.bindir+":"+os.environ['PATH']

check_json_precision()

Expand Down
6 changes: 3 additions & 3 deletions qa/rpc-tests/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
PORT_RANGE = 5000

def zcashd_binary():
return os.getenv("ZEBRAD", os.path.join("src", "zebrad"))
return os.getenv("ZEBRAD", os.path.join("bin", "zebrad"))

def zaino_binary():
return os.getenv("ZAINOD", os.path.join("src", "zainod"))
return os.getenv("ZAINOD", os.path.join("bin", "zainod"))

def zallet_binary():
return os.getenv("ZALLET", os.path.join("src", "zallet"))
return os.getenv("ZALLET", os.path.join("bin", "zallet"))

def zebrad_config(datadir):
base_location = os.path.join('qa', 'defaults', 'zebrad', 'config.toml')
Expand Down
2 changes: 1 addition & 1 deletion qa/zcash/create_benchmark_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import tarfile
import time

ZCASH_CLI = './src/zcash-cli'
ZCASH_CLI = './bin/zcash-cli'
Comment thread
zancas marked this conversation as resolved.
USAGE = """
Requirements:
- find
Expand Down
10 changes: 5 additions & 5 deletions qa/zcash/full_test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def get_arch_dir():
CXX_BINARIES = [
]
RUST_BINARIES = [
'src/zebrad',
'src/zainod',
'src/zallet',
'bin/zebrad',
'bin/zainod',
'bin/zallet',
]

def test_rpath_runpath(filename):
Expand Down Expand Up @@ -91,7 +91,7 @@ def check_security_hardening():
ret = True

# PIE, RELRO, Canary, and NX are tested by `contrib/devtools/security-check.py`.
bin_programs = ['src/zebrad', 'src/zainod', 'src/zallet']
bin_programs = ['bin/zebrad', 'bin/zainod', 'bin/zallet']
bin_scripts = []

print(f"Checking binary security of {bin_programs + bin_scripts}...")
Expand All @@ -106,7 +106,7 @@ def check_security_hardening():

# The remaining checks are only for ELF binaries
# Assume that if zebrad is an ELF binary, they all are
with open(repofile('src/zebrad'), 'rb') as f:
with open(repofile('bin/zebrad'), 'rb') as f:
magic = f.read(4)
if not magic.startswith(b'\x7fELF'):
return ret
Expand Down
12 changes: 6 additions & 6 deletions qa/zcash/smoke_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
# Usage:
#
# ZCASHD=./src/zcashd ZCASHCLI=./src/zcash-cli ./qa/zcash/smoke_tests.py --wallet=wallet.smoketest.dat "$HOME/.zcash"
#
# ZCASHD=./src/zcashd ZCASHCLI=./src/zcash-cli ./qa/zcash/smoke_tests.py --wallet=wallet.smoketest.dat "$HOME/.zcash" --automate --use-faucet
# ZCASHD=./bin/zcashd ZCASHCLI=./bin/zcash-cli ./qa/zcash/smoke_tests.py --wallet=wallet.smoketest.dat "$HOME/.zcash"
#
# ZCASHD=./bin/zcashd ZCASHCLI=./bin/zcash-cli ./qa/zcash/smoke_tests.py --wallet=wallet.smoketest.dat "$HOME/.zcash" --automate --use-faucet
#

import argparse
Expand Down Expand Up @@ -438,21 +438,21 @@ def transaction_chain(zcash):
results, '4w', zcash, sapling_zaddr_2,[
(taddr_3, starting_balance / Decimal('10')),
(sapling_zaddr_1, starting_balance / Decimal('10'))], "AllowRevealedRecipients")[0]

sapling_balance -= (starting_balance / Decimal('10')) + LEGACY_DEFAULT_FEE
taddr_balance += starting_balance / Decimal('10')

# taddr and Sapling -> Sapling
check_z_mergetoaddress(results, '4ee', zcash, [taddr_3, sapling_zaddr_1], sapling_zaddr_2, sapling_balance + (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE, "AllowRevealedSenders")

sapling_balance += (starting_balance / Decimal('10')) - LEGACY_DEFAULT_FEE
taddr_balance -= starting_balance / Decimal('10')

# Sapling -> multiple taddr
check_z_sendmany(results, '4v', zcash, sapling_zaddr_2, [
(taddr_4, (starting_balance / Decimal('10'))),
(taddr_5, (starting_balance / Decimal('10')))], "AllowRevealedRecipients")[0]

sapling_balance -= ((starting_balance / Decimal('10')) * Decimal('2')) + LEGACY_DEFAULT_FEE
taddr_balance += (starting_balance / Decimal('10')) * Decimal('2')

Expand Down