| 15 | |
| 16 | |
| 17 | class LightningNode(utils.LightningNode): |
| 18 | def __init__(self, *args, **kwargs): |
| 19 | utils.LightningNode.__init__(self, *args, **kwargs) |
| 20 | |
| 21 | # We have some valgrind suppressions in the `tests/` |
| 22 | # directory, so we can add these to the valgrind configuration |
| 23 | # (not generally true when running pyln-testing, hence why |
| 24 | # it's being done in this specialization, and not in the |
| 25 | # library). |
| 26 | if self.daemon.cmd_line[0] == 'valgrind': |
| 27 | suppressions_path = Path(__file__).parent / "valgrind-suppressions.txt" |
| 28 | self.daemon.cmd_prefix += [ |
| 29 | f"--suppressions={suppressions_path}", |
| 30 | "--gen-suppressions=all" |
| 31 | ] |
| 32 | |
| 33 | # If we opted into checking the DB statements we will attach the dblog |
| 34 | # plugin before starting the node |
| 35 | check_dblog = os.environ.get("TEST_CHECK_DBSTMTS", None) == "1" |
| 36 | db_type = os.environ.get("TEST_DB_PROVIDER", "sqlite3") |
| 37 | if db_type == 'sqlite3' and check_dblog: |
| 38 | dblog = os.path.join(os.path.dirname(__file__), 'plugins', 'dblog.py') |
| 39 | has_dblog = len([o for o in self.daemon.cmd_line if 'dblog.py' in o]) > 0 |
| 40 | if not has_dblog: |
| 41 | # Add as an expanded option so we don't clobber other options. |
| 42 | self.daemon.opts['plugin={}'.format(dblog)] = None |
| 43 | self.daemon.opts['dblog-file'] = 'dblog.sqlite3' |
| 44 | |
| 45 | # FIXME: make sure bookkeeper is not disabled |
| 46 | if db_type == 'postgres': |
| 47 | accts_db = self.db.provider.get_db('', 'accounts', 0) |
| 48 | self.daemon.opts['bookkeeper-db'] = accts_db.get_dsn() |
| 49 | |
| 50 | # Yes, we really want to test the local development version, not |
| 51 | # something in out path. |
| 52 | self.daemon.executable = 'lightningd/lightningd' |
| 53 | |
| 54 | |
| 55 | class CompatLevel(object): |
no outgoing calls