diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/feature_config_args.py | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | test/functional/p2p_permissions.py | 66 | ||||
-rwxr-xr-x[-rw-r--r--] | test/functional/rpc_setban.py | 0 | ||||
-rw-r--r-- | test/functional/test_framework/util.py | 1 |
4 files changed, 43 insertions, 38 deletions
diff --git a/test/functional/feature_config_args.py b/test/functional/feature_config_args.py index 70a824b863..b997c76025 100755 --- a/test/functional/feature_config_args.py +++ b/test/functional/feature_config_args.py @@ -109,17 +109,15 @@ class ConfArgsTest(BitcoinTestFramework): f.write("datadir=" + new_data_dir + "\n") f.write(conf_file_contents) - # Temporarily disabled, because this test would access the user's home dir (~/.bitcoin) - #self.nodes[0].assert_start_raises_init_error(['-conf=' + conf_file], 'Error reading configuration file: specified data directory "' + new_data_dir + '" does not exist.') + self.nodes[0].assert_start_raises_init_error(['-conf=' + conf_file], 'Error: Error reading configuration file: specified data directory "' + new_data_dir + '" does not exist.') # Create the directory and ensure the config file now works os.mkdir(new_data_dir) - # Temporarily disabled, because this test would access the user's home dir (~/.bitcoin) - #self.start_node(0, ['-conf='+conf_file, '-wallet=w1']) - #self.stop_node(0) - #assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'blocks')) - #if self.is_wallet_compiled(): - #assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'wallets', 'w1')) + self.start_node(0, ['-conf='+conf_file, '-wallet=w1']) + self.stop_node(0) + assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'blocks')) + if self.is_wallet_compiled(): + assert os.path.exists(os.path.join(new_data_dir, 'regtest', 'wallets', 'w1')) # Ensure command line argument overrides datadir in conf os.mkdir(new_data_dir_2) diff --git a/test/functional/p2p_permissions.py b/test/functional/p2p_permissions.py index 1013055420..40b28d7533 100644..100755 --- a/test/functional/p2p_permissions.py +++ b/test/functional/p2p_permissions.py @@ -23,18 +23,24 @@ class P2PPermissionsTests(BitcoinTestFramework): def run_test(self): self.checkpermission( - # relay permission added - ["-whitelist=127.0.0.1", "-whitelistrelay"], - ["relay", "noban", "mempool"], - True) + # default permissions (no specific permissions) + ["-whitelist=127.0.0.1"], + ["relay", "noban", "mempool"], + True) self.checkpermission( - # forcerelay and relay permission added - # Legacy parameter interaction which set whitelistrelay to true - # if whitelistforcerelay is true - ["-whitelist=127.0.0.1", "-whitelistforcerelay"], - ["forcerelay", "relay", "noban", "mempool"], - True) + # relay permission removed (no specific permissions) + ["-whitelist=127.0.0.1", "-whitelistrelay=0"], + ["noban", "mempool"], + True) + + self.checkpermission( + # forcerelay and relay permission added + # Legacy parameter interaction which set whitelistrelay to true + # if whitelistforcerelay is true + ["-whitelist=127.0.0.1", "-whitelistforcerelay"], + ["forcerelay", "relay", "noban", "mempool"], + True) # Let's make sure permissions are merged correctly # For this, we need to use whitebind instead of bind @@ -42,35 +48,35 @@ class P2PPermissionsTests(BitcoinTestFramework): ip_port = "127.0.0.1:{}".format(p2p_port(1)) self.replaceinconfig(1, "bind=127.0.0.1", "whitebind=bloomfilter,forcerelay@" + ip_port) self.checkpermission( - ["-whitelist=noban@127.0.0.1" ], - # Check parameter interaction forcerelay should activate relay - ["noban", "bloomfilter", "forcerelay", "relay" ], - False) + ["-whitelist=noban@127.0.0.1" ], + # Check parameter interaction forcerelay should activate relay + ["noban", "bloomfilter", "forcerelay", "relay" ], + False) self.replaceinconfig(1, "whitebind=bloomfilter,forcerelay@" + ip_port, "bind=127.0.0.1") self.checkpermission( - # legacy whitelistrelay should be ignored - ["-whitelist=noban,mempool@127.0.0.1", "-whitelistrelay"], - ["noban", "mempool"], - False) + # legacy whitelistrelay should be ignored + ["-whitelist=noban,mempool@127.0.0.1", "-whitelistrelay"], + ["noban", "mempool"], + False) self.checkpermission( - # legacy whitelistforcerelay should be ignored - ["-whitelist=noban,mempool@127.0.0.1", "-whitelistforcerelay"], - ["noban", "mempool"], - False) + # legacy whitelistforcerelay should be ignored + ["-whitelist=noban,mempool@127.0.0.1", "-whitelistforcerelay"], + ["noban", "mempool"], + False) self.checkpermission( - # missing mempool permission to be considered legacy whitelisted - ["-whitelist=noban@127.0.0.1"], - ["noban"], - False) + # missing mempool permission to be considered legacy whitelisted + ["-whitelist=noban@127.0.0.1"], + ["noban"], + False) self.checkpermission( - # all permission added - ["-whitelist=all@127.0.0.1"], - ["forcerelay", "noban", "mempool", "bloomfilter", "relay"], - False) + # all permission added + ["-whitelist=all@127.0.0.1"], + ["forcerelay", "noban", "mempool", "bloomfilter", "relay"], + False) self.stop_node(1) self.nodes[1].assert_start_raises_init_error(["-whitelist=oopsie@127.0.0.1"], "Invalid P2P permission", match=ErrorMatch.PARTIAL_REGEX) diff --git a/test/functional/rpc_setban.py b/test/functional/rpc_setban.py index a1a8196557..a1a8196557 100644..100755 --- a/test/functional/rpc_setban.py +++ b/test/functional/rpc_setban.py diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 3d9be0d0a6..821e1cd3c5 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -293,6 +293,7 @@ def initialize_datadir(dirname, n, chain): f.write("discover=0\n") f.write("listenonion=0\n") f.write("printtoconsole=0\n") + f.write("upnp=0\n") os.makedirs(os.path.join(datadir, 'stderr'), exist_ok=True) os.makedirs(os.path.join(datadir, 'stdout'), exist_ok=True) return datadir |