Skip to content

Commit

Permalink
scripted-diff: bitcoind-->pivxd in tests
Browse files Browse the repository at this point in the history
-BEGIN VERIFY SCRIPT-
sed -i 's/bitcoind/pivxd/' test/functional/*.py test/functional/*/*.py
-END VERIFY SCRIPT-
  • Loading branch information
random-zebra committed Jul 31, 2021
1 parent 38dae98 commit 84768b5
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions test/functional/feature_abortnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test bitcoind aborts if can't disconnect a block.
"""Test pivxd aborts if can't disconnect a block.
- Start a single node and generate 3 blocks.
- Delete the undo data.
- Mine a fork that requires disconnecting the tip.
- Verify that bitcoind AbortNode's.
- Verify that pivxd AbortNode's.
"""

import os
Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def run_test(self):
self.nodes[1].generate(51)
self.sync_all()

# Give bitcoind 10 seconds to write the alert notification
# Give pivxd 10 seconds to write the alert notification
wait_until(lambda: len(os.listdir(self.alertnotify_dir)), timeout=10)

for notify_file in os.listdir(self.alertnotify_dir):
Expand Down
6 changes: 3 additions & 3 deletions test/functional/feature_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2015-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoind with different proxy configuration.
"""Test pivxd with different proxy configuration.
Test plan:
- Start pivxd's with different proxy configurations
Expand Down Expand Up @@ -96,7 +96,7 @@ def node_test(self, node, proxies, auth, test_onion=True):
node.addnode("15.61.23.23:1234", "onetry")
cmd = proxies[0].queue.get()
assert(isinstance(cmd, Socks5Command))
# Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
# Note: pivxd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
assert_equal(cmd.addr, b"15.61.23.23")
assert_equal(cmd.port, 1234)
Expand All @@ -110,7 +110,7 @@ def node_test(self, node, proxies, auth, test_onion=True):
node.addnode("[1233:3432:2434:2343:3234:2345:6546:4534]:5443", "onetry")
cmd = proxies[1].queue.get()
assert(isinstance(cmd, Socks5Command))
# Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
# Note: pivxd's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6
assert_equal(cmd.atyp, AddressType.DOMAINNAME)
assert_equal(cmd.addr, b"1233:3432:2434:2343:3234:2345:6546:4534")
assert_equal(cmd.port, 5443)
Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_reindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running bitcoind with -reindex and -reindex-chainstate options.
"""Test running pivxd with -reindex and -reindex-chainstate options.
- Start a single node and generate 3 blocks.
- Stop the node and restart it with -reindex. Verify that the node has reindexed up to block 3.
Expand Down
4 changes: 2 additions & 2 deletions test/functional/mempool_persist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# file COPYING or https://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, bitcoind will dump mempool on shutdown and
By default, pivxd will dump mempool on shutdown and
then reload it on startup. This can be overridden with
the -persistmempool=false command line option.
Expand Down Expand Up @@ -106,7 +106,7 @@ def run_test(self):
assert self.nodes[0].getmempoolinfo()["loaded"]
assert_equal(len(self.nodes[1].getrawmempool()), 5)
self.log.debug("Prevent bitcoind from writing mempool.dat to disk. Verify that `savemempool` fails")
self.log.debug("Prevent pivxd from writing mempool.dat to disk. Verify that `savemempool` fails")
# to test the exception we are creating a tmp folder called mempool.dat.new
# which is an implementation detail that could change and break this test
mempooldotnew1 = mempooldat1 + '.new'
Expand Down
4 changes: 2 additions & 2 deletions test/functional/p2p_leak.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
This test connects to a node and sends it a few messages, trying to intice it
into sending us something it shouldn't.
Also test that nodes that send unsupported service bits to bitcoind are disconnected
Also test that nodes that send unsupported service bits to pivxd are disconnected
and don't receive a VERACK. Unsupported service bits are currently 1 << 5 and
1 << 7 (until August 1st 2018).
"""
Expand Down Expand Up @@ -64,7 +64,7 @@ def on_blocktxn(self, message): self.bad_message(message)
# anyway, and eventually get disconnected.
class CNodeNoVersionBan(CLazyNode):
# send a bunch of veracks without sending a message. This should get us disconnected.
# NOTE: implementation-specific check here. Remove if bitcoind ban behavior changes
# NOTE: implementation-specific check here. Remove if pivxd ban behavior changes
def on_open(self):
super().on_open()
for i in range(banscore):
Expand Down
2 changes: 1 addition & 1 deletion test/functional/rpc_bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running bitcoind with the -rpcbind and -rpcallowip options."""
"""Test running pivxd with the -rpcbind and -rpcallowip options."""

import socket
import sys
Expand Down
4 changes: 2 additions & 2 deletions test/functional/test_framework/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def FromHex(obj, hex_string):
def ToHex(obj):
return bytes_to_hex_str(obj.serialize())

# Objects that map to bitcoind objects, which can be serialized/deserialized
# Objects that map to pivxd objects, which can be serialized/deserialized

class CAddress():
def __init__(self):
Expand Down Expand Up @@ -1237,7 +1237,7 @@ def __init__(self, headers=None):
self.headers = headers if headers is not None else []

def deserialize(self, f):
# comment in bitcoind indicates these should be deserialized as blocks
# comment in pivxd indicates these should be deserialized as blocks
blocks = deser_vector(f, CBlock)
for x in blocks:
self.headers.append(CBlockHeader(x))
Expand Down
10 changes: 5 additions & 5 deletions test/functional/test_framework/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self, i, dirname, extra_args, rpchost, timewait, binary, stderr, mo
self.p2ps = []

def __del__(self):
# Ensure that we don't leave any bitcoind processes lying around after
# Ensure that we don't leave any pivxd processes lying around after
# the test ends
if self.process and self.cleanup_on_exit:
# Should only happen on test failure
Expand All @@ -115,7 +115,7 @@ def start(self, extra_args=None, stderr=None, *args, **kwargs):
if stderr is None:
stderr = self.stderr
# Delete any existing cookie file -- if such a file exists (eg due to
# unclean shutdown), it will get overwritten anyway by bitcoind, and
# unclean shutdown), it will get overwritten anyway by pivxd, and
# potentially interfere with our attempt to authenticate
delete_cookie_file(self.datadir)
self.process = subprocess.Popen(self.args + extra_args, stderr=stderr, *args, **kwargs)
Expand Down Expand Up @@ -167,7 +167,7 @@ def wait_for_rpc_connection(self):
except JSONRPCException as e: # Initialization phase
if e.error['code'] != -28: # RPC in warmup?
raise # unknown JSON RPC exception
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. pivxd still starting
if "No RPC credentials" not in str(e):
raise
time.sleep(1.0 / poll_per_s)
Expand Down Expand Up @@ -220,8 +220,8 @@ def wait_until_stopped(self, timeout=BITCOIND_PROC_WAIT_TIMEOUT):
def assert_start_raises_init_error(self, extra_args=None, expected_msg=None, match=ErrorMatch.FULL_TEXT, *args, **kwargs):
"""Attempt to start the node and expect it to raise an error.
extra_args: extra arguments to pass through to bitcoind
expected_msg: regex that stderr should match when bitcoind fails
extra_args: extra arguments to pass through to pivxd
expected_msg: regex that stderr should match when pivxd fails
Will throw if pivxd starts without an error.
Will throw if an expected_msg is provided and it does not match pivxd's stdout."""
Expand Down
4 changes: 2 additions & 2 deletions test/functional/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,15 @@ def main():

enable_wallet = config["components"].getboolean("ENABLE_WALLET")
enable_utils = config["components"].getboolean("ENABLE_UTILS")
enable_bitcoind = config["components"].getboolean("ENABLE_BITCOIND")
enable_pivxd = config["components"].getboolean("ENABLE_BITCOIND")

if config["environment"]["EXEEXT"] == ".exe" and not args.force:
# https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9
# https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964
print("Tests currently disabled on Windows by default. Use --force option to enable")
sys.exit(0)

if not (enable_wallet and enable_utils and enable_bitcoind):
if not (enable_wallet and enable_utils and enable_pivxd):
print("No functional tests to run. Wallet, utils, and pivxd must all be enabled")
print("Rerun `configure` with -enable-wallet, -with-utils and -with-daemon and rerun make")
sys.exit(0)
Expand Down

0 comments on commit 84768b5

Please sign in to comment.