Skip to content

Commit 7ea248a

Browse files
committed
test: Disable several (sub)tests with cli
Reason for each test: rpc_whitelist.py: Relies on direct RPC calls wallet_encryption.py: Null characters cannot be passed to suprocess.Popen wallet_fundrawtransaction.py: multiple checks for wrong types, which have different error messages with cli wallet_send.py: multiple checks for wrong types
1 parent f420b63 commit 7ea248a

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

test/functional/rpc_whitelist.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class RPCWhitelistTest(BitcoinTestFramework):
3333

3434
def set_test_params(self):
3535
self.num_nodes = 1
36+
self.supports_cli = False
3637

3738
def run_test(self):
3839
# 0 => Username

test/functional/wallet_encryption.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,18 @@ def run_test(self):
9090
assert_equal(actual_time, expected_time)
9191
self.nodes[0].walletlock()
9292

93-
# Test passphrase with null characters
94-
passphrase_with_nulls = "Phrase\0With\0Nulls"
95-
self.nodes[0].walletpassphrasechange(passphrase2, passphrase_with_nulls)
96-
# walletpassphrasechange should not stop at null characters
97-
assert_raises_rpc_error(-14, "wallet passphrase entered was incorrect", self.nodes[0].walletpassphrase, passphrase_with_nulls.partition("\0")[0], 10)
98-
assert_raises_rpc_error(-14, "The wallet passphrase entered was incorrect", self.nodes[0].walletpassphrasechange, passphrase_with_nulls.partition("\0")[0], "abc")
99-
assert_raises_rpc_error(-14, "wallet passphrase entered is incorrect. It contains a null character (ie - a zero byte)", self.nodes[0].walletpassphrase, passphrase_with_nulls + "\0", 10)
100-
assert_raises_rpc_error(-14, "The old wallet passphrase entered is incorrect. It contains a null character (ie - a zero byte)", self.nodes[0].walletpassphrasechange, passphrase_with_nulls + "\0", "abc")
101-
with WalletUnlock(self.nodes[0], passphrase_with_nulls):
102-
sig = self.nodes[0].signmessage(address, msg)
103-
assert self.nodes[0].verifymessage(address, sig, msg)
93+
if not self.options.usecli: # can't be done with the test framework for cli since subprocess.Popen doesn't allow null characters
94+
# Test passphrase with null characters
95+
passphrase_with_nulls = "Phrase\0With\0Nulls"
96+
self.nodes[0].walletpassphrasechange(passphrase2, passphrase_with_nulls)
97+
# walletpassphrasechange should not stop at null characters
98+
assert_raises_rpc_error(-14, "wallet passphrase entered was incorrect", self.nodes[0].walletpassphrase, passphrase_with_nulls.partition("\0")[0], 10)
99+
assert_raises_rpc_error(-14, "The wallet passphrase entered was incorrect", self.nodes[0].walletpassphrasechange, passphrase_with_nulls.partition("\0")[0], "abc")
100+
assert_raises_rpc_error(-14, "wallet passphrase entered is incorrect. It contains a null character (ie - a zero byte)", self.nodes[0].walletpassphrase, passphrase_with_nulls + "\0", 10)
101+
assert_raises_rpc_error(-14, "The old wallet passphrase entered is incorrect. It contains a null character (ie - a zero byte)", self.nodes[0].walletpassphrasechange, passphrase_with_nulls + "\0", "abc")
102+
with WalletUnlock(self.nodes[0], passphrase_with_nulls):
103+
sig = self.nodes[0].signmessage(address, msg)
104+
assert self.nodes[0].verifymessage(address, sig, msg)
104105

105106
self.log.info("Test that wallets without private keys cannot be encrypted")
106107
self.nodes[0].createwallet(wallet_name="noprivs", disable_private_keys=True)

test/functional/wallet_fundrawtransaction.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def set_test_params(self):
4949
# whitelist peers to speed up tx relay / mempool sync
5050
self.noban_tx_relay = True
5151
self.rpc_timeout = 90 # to prevent timeouts in `test_transaction_too_large`
52+
self.supports_cli = False
5253

5354
def skip_test_if_missing_module(self):
5455
self.skip_if_no_wallet()

test/functional/wallet_send.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def set_test_params(self):
2929
self.num_nodes = 2
3030
# whitelist peers to speed up tx relay / mempool sync
3131
self.noban_tx_relay = True
32+
self.supports_cli = False
3233
self.extra_args = [
3334
["-walletrbf=1"],
3435
["-walletrbf=1"]

0 commit comments

Comments
 (0)