From 61b8f7f273022d3163f998ff5d66d53ca0460c8b Mon Sep 17 00:00:00 2001
From: Anthony Towns <aj@erisian.com.au>
Date: Thu, 25 Jan 2018 09:44:29 +1000
Subject: [PATCH] [tests] Rename p2p_* functional tests.

---
 test/functional/README.md                     |  4 +--
 ...-compactblocks.py => p2p_compactblocks.py} |  0
 ...isconnect_ban.py => p2p_disconnect_ban.py} |  0
 .../{p2p-feefilter.py => p2p_feefilter.py}    |  0
 ...{p2p-fingerprint.py => p2p_fingerprint.py} |  0
 ...idblockrequest.py => p2p_invalid_block.py} |  0
 ...{invalidtxrequest.py => p2p_invalid_tx.py} |  0
 .../{p2p-leaktests.py => p2p_leak.py}         |  0
 .../{p2p-mempool.py => p2p_mempool.py}        |  0
 ...limited.py => p2p_node_network_limited.py} |  0
 .../{p2p-segwit.py => p2p_segwit.py}          |  0
 .../{sendheaders.py => p2p_sendheaders.py}    |  0
 .../{p2p-timeouts.py => p2p_timeouts.py}      |  0
 ...ceptblock.py => p2p_unrequested_blocks.py} |  0
 test/functional/test_runner.py                | 28 +++++++++----------
 15 files changed, 16 insertions(+), 16 deletions(-)
 rename test/functional/{p2p-compactblocks.py => p2p_compactblocks.py} (100%)
 rename test/functional/{disconnect_ban.py => p2p_disconnect_ban.py} (100%)
 rename test/functional/{p2p-feefilter.py => p2p_feefilter.py} (100%)
 rename test/functional/{p2p-fingerprint.py => p2p_fingerprint.py} (100%)
 rename test/functional/{invalidblockrequest.py => p2p_invalid_block.py} (100%)
 rename test/functional/{invalidtxrequest.py => p2p_invalid_tx.py} (100%)
 rename test/functional/{p2p-leaktests.py => p2p_leak.py} (100%)
 rename test/functional/{p2p-mempool.py => p2p_mempool.py} (100%)
 rename test/functional/{node_network_limited.py => p2p_node_network_limited.py} (100%)
 rename test/functional/{p2p-segwit.py => p2p_segwit.py} (100%)
 rename test/functional/{sendheaders.py => p2p_sendheaders.py} (100%)
 rename test/functional/{p2p-timeouts.py => p2p_timeouts.py} (100%)
 rename test/functional/{p2p-acceptblock.py => p2p_unrequested_blocks.py} (100%)

diff --git a/test/functional/README.md b/test/functional/README.md
index b3d34c72f..662b4b44d 100644
--- a/test/functional/README.md
+++ b/test/functional/README.md
@@ -87,7 +87,7 @@ start the networking thread.  (Continue with the test logic in your existing
 thread.)
 
 - Can be used to write tests where specific P2P protocol behavior is tested.
-Examples tests are `p2p-acceptblock.py`, `p2p-compactblocks.py`.
+Examples tests are `p2p_unrequested_blocks.py`, `p2p_compactblocks.py`.
 
 #### Comptool
 
@@ -133,7 +133,7 @@ Each `TestInstance` consists of:
     acceptance is tested against the given outcome.
 
 - For examples of tests written in this framework, see
-  `invalidblockrequest.py` and `feature_block.py`.
+  `p2p_invalid_block.py` and `feature_block.py`.
 
 ### test-framework modules
 
diff --git a/test/functional/p2p-compactblocks.py b/test/functional/p2p_compactblocks.py
similarity index 100%
rename from test/functional/p2p-compactblocks.py
rename to test/functional/p2p_compactblocks.py
diff --git a/test/functional/disconnect_ban.py b/test/functional/p2p_disconnect_ban.py
similarity index 100%
rename from test/functional/disconnect_ban.py
rename to test/functional/p2p_disconnect_ban.py
diff --git a/test/functional/p2p-feefilter.py b/test/functional/p2p_feefilter.py
similarity index 100%
rename from test/functional/p2p-feefilter.py
rename to test/functional/p2p_feefilter.py
diff --git a/test/functional/p2p-fingerprint.py b/test/functional/p2p_fingerprint.py
similarity index 100%
rename from test/functional/p2p-fingerprint.py
rename to test/functional/p2p_fingerprint.py
diff --git a/test/functional/invalidblockrequest.py b/test/functional/p2p_invalid_block.py
similarity index 100%
rename from test/functional/invalidblockrequest.py
rename to test/functional/p2p_invalid_block.py
diff --git a/test/functional/invalidtxrequest.py b/test/functional/p2p_invalid_tx.py
similarity index 100%
rename from test/functional/invalidtxrequest.py
rename to test/functional/p2p_invalid_tx.py
diff --git a/test/functional/p2p-leaktests.py b/test/functional/p2p_leak.py
similarity index 100%
rename from test/functional/p2p-leaktests.py
rename to test/functional/p2p_leak.py
diff --git a/test/functional/p2p-mempool.py b/test/functional/p2p_mempool.py
similarity index 100%
rename from test/functional/p2p-mempool.py
rename to test/functional/p2p_mempool.py
diff --git a/test/functional/node_network_limited.py b/test/functional/p2p_node_network_limited.py
similarity index 100%
rename from test/functional/node_network_limited.py
rename to test/functional/p2p_node_network_limited.py
diff --git a/test/functional/p2p-segwit.py b/test/functional/p2p_segwit.py
similarity index 100%
rename from test/functional/p2p-segwit.py
rename to test/functional/p2p_segwit.py
diff --git a/test/functional/sendheaders.py b/test/functional/p2p_sendheaders.py
similarity index 100%
rename from test/functional/sendheaders.py
rename to test/functional/p2p_sendheaders.py
diff --git a/test/functional/p2p-timeouts.py b/test/functional/p2p_timeouts.py
similarity index 100%
rename from test/functional/p2p-timeouts.py
rename to test/functional/p2p_timeouts.py
diff --git a/test/functional/p2p-acceptblock.py b/test/functional/p2p_unrequested_blocks.py
similarity index 100%
rename from test/functional/p2p-acceptblock.py
rename to test/functional/p2p_unrequested_blocks.py
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index edc1fed8c..26beef5a5 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -60,16 +60,16 @@ BASE_SCRIPTS= [
     # vv Tests less than 5m vv
     'feature_block.py',
     'fundrawtransaction.py',
-    'p2p-compactblocks.py',
+    'p2p_compactblocks.py',
     'feature_segwit.py',
     # vv Tests less than 2m vv
     'wallet_basic.py',
     'wallet_accounts.py',
-    'p2p-segwit.py',
+    'p2p_segwit.py',
     'wallet_dump.py',
     'listtransactions.py',
     # vv Tests less than 60s vv
-    'sendheaders.py',
+    'p2p_sendheaders.py',
     'wallet_zapwallettxes.py',
     'wallet_importmulti.py',
     'mempool_limit.py',
@@ -99,17 +99,17 @@ BASE_SCRIPTS= [
     'multi_rpc.py',
     'feature_proxy.py',
     'signrawtransactions.py',
-    'disconnect_ban.py',
+    'p2p_disconnect_ban.py',
     'decodescript.py',
     'blockchain.py',
     'deprecated_rpc.py',
     'wallet_disable.py',
     'net.py',
     'wallet_keypool.py',
-    'p2p-mempool.py',
+    'p2p_mempool.py',
     'prioritise_transaction.py',
-    'invalidblockrequest.py',
-    'invalidtxrequest.py',
+    'p2p_invalid_block.py',
+    'p2p_invalid_tx.py',
     'feature_versionbits_warning.py',
     'preciousblock.py',
     'wallet_importprunedfunds.py',
@@ -120,18 +120,18 @@ BASE_SCRIPTS= [
     'wallet_bumpfee.py',
     'rpcnamedargs.py',
     'wallet_listsinceblock.py',
-    'p2p-leaktests.py',
+    'p2p_leak.py',
     'wallet_encryption.py',
     'feature_dersig.py',
     'feature_cltv.py',
     'uptime.py',
     'wallet_resendwallettransactions.py',
     'feature_minchainwork.py',
-    'p2p-fingerprint.py',
+    'p2p_fingerprint.py',
     'feature_uacomment.py',
-    'p2p-acceptblock.py',
+    'p2p_unrequested_blocks.py',
     'feature_logging.py',
-    'node_network_limited.py',
+    'p2p_node_network_limited.py',
     'feature_config_args.py',
     # Don't append tests at the end to avoid merge conflicts
     # Put them in a random line within the section that fits their approximate run-time
@@ -150,10 +150,10 @@ EXTENDED_SCRIPTS = [
     # vv Tests less than 2m vv
     'feature_bip68_sequence.py',
     'getblocktemplate_longpoll.py',
-    'p2p-timeouts.py',
+    'p2p_timeouts.py',
     # vv Tests less than 60s vv
     'feature_bip9_softforks.py',
-    'p2p-feefilter.py',
+    'p2p_feefilter.py',
     'rpcbind_test.py',
     # vv Tests less than 30s vv
     'feature_assumevalid.py',
@@ -474,7 +474,7 @@ class TestResult():
 def check_script_prefixes():
     """Check that no more than `EXPECTED_VIOLATION_COUNT` of the
        test scripts don't start with one of the allowed name prefixes."""
-    EXPECTED_VIOLATION_COUNT = 37
+    EXPECTED_VIOLATION_COUNT = 24
 
     # LEEWAY is provided as a transition measure, so that pull-requests
     # that introduce new tests that don't conform with the naming