mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
refactor: introduce default pid file name constant in tests
This commit is contained in:
parent
33adc7521c
commit
b832ffe044
2 changed files with 6 additions and 2 deletions
|
@ -7,7 +7,10 @@ import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
from test_framework.test_framework import BitcoinTestFramework
|
from test_framework.test_framework import BitcoinTestFramework
|
||||||
from test_framework.test_node import ErrorMatch
|
from test_framework.test_node import (
|
||||||
|
BITCOIN_PID_FILENAME_DEFAULT,
|
||||||
|
ErrorMatch,
|
||||||
|
)
|
||||||
|
|
||||||
class FilelockTest(BitcoinTestFramework):
|
class FilelockTest(BitcoinTestFramework):
|
||||||
def add_options(self, parser):
|
def add_options(self, parser):
|
||||||
|
@ -33,7 +36,7 @@ class FilelockTest(BitcoinTestFramework):
|
||||||
self.log.info("Check that cookie and PID file are not deleted when attempting to start a second bitcoind using the same datadir")
|
self.log.info("Check that cookie and PID file are not deleted when attempting to start a second bitcoind using the same datadir")
|
||||||
cookie_file = datadir / ".cookie"
|
cookie_file = datadir / ".cookie"
|
||||||
assert cookie_file.exists() # should not be deleted during the second bitcoind instance shutdown
|
assert cookie_file.exists() # should not be deleted during the second bitcoind instance shutdown
|
||||||
pid_file = datadir / "bitcoind.pid"
|
pid_file = datadir / BITCOIN_PID_FILENAME_DEFAULT
|
||||||
assert pid_file.exists()
|
assert pid_file.exists()
|
||||||
|
|
||||||
if self.is_wallet_compiled():
|
if self.is_wallet_compiled():
|
||||||
|
|
|
@ -48,6 +48,7 @@ BITCOIND_PROC_WAIT_TIMEOUT = 60
|
||||||
NUM_XOR_BYTES = 8
|
NUM_XOR_BYTES = 8
|
||||||
# The null blocks key (all 0s)
|
# The null blocks key (all 0s)
|
||||||
NULL_BLK_XOR_KEY = bytes([0] * NUM_XOR_BYTES)
|
NULL_BLK_XOR_KEY = bytes([0] * NUM_XOR_BYTES)
|
||||||
|
BITCOIN_PID_FILENAME_DEFAULT = "bitcoind.pid"
|
||||||
|
|
||||||
|
|
||||||
class FailedToStartError(Exception):
|
class FailedToStartError(Exception):
|
||||||
|
|
Loading…
Add table
Reference in a new issue