From c53c9831eedaf3b311bb942945268830f9ba3abc Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Mon, 5 Jun 2017 10:50:25 -0700 Subject: Replace cookie auth in tests Since rpcuser and rpcpassword are now deprecated, replace them with cookie auth. Fix test failures with cookie auth --- test/functional/p2p-segwit.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/functional/p2p-segwit.py') diff --git a/test/functional/p2p-segwit.py b/test/functional/p2p-segwit.py index ab97596ba3..1fa1c0710b 100755 --- a/test/functional/p2p-segwit.py +++ b/test/functional/p2p-segwit.py @@ -1486,7 +1486,7 @@ class SegWitTest(BitcoinTestFramework): # nodes would have stored, this requires special handling. # To enable this test, pass --oldbinary= to # the test. - def test_upgrade_after_activation(self, node, node_id): + def test_upgrade_after_activation(self, node_id): self.log.info("Testing software upgrade after softfork activation") assert(node_id != 0) # node0 is assumed to be a segwit-active bitcoind @@ -1502,14 +1502,14 @@ class SegWitTest(BitcoinTestFramework): sync_blocks(self.nodes) # Make sure that this peer thinks segwit has activated. - assert(get_bip9_status(node, 'segwit')['status'] == "active") + assert(get_bip9_status(self.nodes[node_id], 'segwit')['status'] == "active") # Make sure this peers blocks match those of node0. - height = node.getblockcount() + height = self.nodes[node_id].getblockcount() while height >= 0: - block_hash = node.getblockhash(height) + block_hash = self.nodes[node_id].getblockhash(height) assert_equal(block_hash, self.nodes[0].getblockhash(height)) - assert_equal(self.nodes[0].getblock(block_hash), node.getblock(block_hash)) + assert_equal(self.nodes[0].getblock(block_hash), self.nodes[node_id].getblock(block_hash)) height -= 1 @@ -1944,7 +1944,7 @@ class SegWitTest(BitcoinTestFramework): self.test_signature_version_1() self.test_non_standard_witness() sync_blocks(self.nodes) - self.test_upgrade_after_activation(self.nodes[2], 2) + self.test_upgrade_after_activation(2) self.test_witness_sigops() -- cgit v1.2.3 From 279fde58e39fe96b86a68586d5a857a31d3c81cd Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Sun, 18 Jun 2017 10:05:33 -0700 Subject: Check for rpcuser/rpcpassword first then for cookie Better to check that rpcuser and rpcpassword exist then to check for the cookie in the test framework. Name an argument for consistency in p2p-segwit.py --- test/functional/p2p-segwit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/p2p-segwit.py') diff --git a/test/functional/p2p-segwit.py b/test/functional/p2p-segwit.py index 1fa1c0710b..c332a47710 100755 --- a/test/functional/p2p-segwit.py +++ b/test/functional/p2p-segwit.py @@ -1944,7 +1944,7 @@ class SegWitTest(BitcoinTestFramework): self.test_signature_version_1() self.test_non_standard_witness() sync_blocks(self.nodes) - self.test_upgrade_after_activation(2) + self.test_upgrade_after_activation(node_id=2) self.test_witness_sigops() -- cgit v1.2.3