From 4d7875c55500368336992d66b296ba5ee01c0932 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Wed, 11 Dec 2019 17:11:20 -0500 Subject: rpc: require second argument only for scantxoutset start action The second argument of scanobjects is only required for the start action. Stop and abort actions do not need this. Github-Pull: #17728 Rebased-From: 7d263571bee8c36fbe3c854b69c6f31cf1ee3b9b --- test/functional/rpc_scantxoutset.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/functional/rpc_scantxoutset.py b/test/functional/rpc_scantxoutset.py index 9f94d11a93..f31e4f43bd 100755 --- a/test/functional/rpc_scantxoutset.py +++ b/test/functional/rpc_scantxoutset.py @@ -116,5 +116,12 @@ class ScantxoutsetTest(BitcoinTestFramework): assert_equal(descriptors(self.nodes[0].scantxoutset("start", [ "combo(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/1/1/0)"])), ["pkh([0c5f9a1e/1/1/0]03e1c5b6e650966971d7e71ef2674f80222752740fc1dfd63bbbd220d2da9bd0fb)#cxmct4w8"]) assert_equal(descriptors(self.nodes[0].scantxoutset("start", [ {"desc": "combo(tpubD6NzVbkrYhZ4WaWSyoBvQwbpLkojyoTZPRsgXELWz3Popb3qkjcJyJUGLnL4qHHoQvao8ESaAstxYSnhyswJ76uZPStJRJCTKvosUCJZL5B/1/1/*)", "range": 1500}])), ['pkh([0c5f9a1e/1/1/0]03e1c5b6e650966971d7e71ef2674f80222752740fc1dfd63bbbd220d2da9bd0fb)#cxmct4w8', 'pkh([0c5f9a1e/1/1/1500]03832901c250025da2aebae2bfb38d5c703a57ab66ad477f9c578bfbcd78abca6f)#vchwd07g', 'pkh([0c5f9a1e/1/1/1]030d820fc9e8211c4169be8530efbc632775d8286167afd178caaf1089b77daba7)#z2t3ypsa']) + # Check that status and abort don't need second arg + assert_equal(self.nodes[0].scantxoutset("status"), None) + assert_equal(self.nodes[0].scantxoutset("abort"), False) + + # Check that second arg is needed for start + assert_raises_rpc_error(-1, "scanobjects argument is required for the start action", self.nodes[0].scantxoutset, "start") + if __name__ == '__main__': ScantxoutsetTest().main() -- cgit v1.2.3 From c0dc7282068b370591e89c630c44bc43bbae38a5 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 15 Nov 2019 11:38:27 -0500 Subject: test: fix bitcoind already running warnings on macOS On macOS, pidof installed via brew returns b'' rather than None. Account for this, to remove spurious warnings from the test_runner. Github-Pull: #17488 Rebased-From: 1c23ea5fe67b88fd72a1ff640dd1bbb21a34fbf4 --- test/functional/test_runner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 9c92091f1d..2f8279bc21 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -361,9 +361,10 @@ def main(): def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, enable_coverage=False, args=None, combined_logs_len=0, failfast=False, runs_ci, use_term_control): args = args or [] - # Warn if bitcoind is already running (unix only) + # Warn if bitcoind is already running + # pidof might fail or return an empty string if bitcoind is not running try: - if subprocess.check_output(["pidof", "bitcoind"]) is not None: + if subprocess.check_output(["pidof", "bitcoind"]) not in [b'']: print("%sWARNING!%s There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!" % (BOLD[1], BOLD[0])) except (OSError, subprocess.SubprocessError): pass -- cgit v1.2.3