Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_includeconf.py
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert subversion.endswith("main; relative)/") | assert subversion.endswith("main; relative)/") | ||||
self.stop_node( | self.stop_node( | ||||
0, expected_stderr="warning: -includeconf cannot be used from commandline; ignoring -includeconf=relative2.conf") | 0, expected_stderr="warning: -includeconf cannot be used from commandline; ignoring -includeconf=relative2.conf") | ||||
self.log.info( | self.log.info( | ||||
"-includeconf cannot be used recursively. subversion should end with 'main; relative)/'") | "-includeconf cannot be used recursively. subversion should end with 'main; relative)/'") | ||||
with open(os.path.join(self.options.tmpdir, "node0", "relative.conf"), "a", encoding="utf8") as f: | with open(os.path.join(self.options.tmpdir, "node0", "relative.conf"), "a", encoding="utf8") as f: | ||||
f.write("includeconf=relative2.conf\n") | f.write("includeconf=relative2.conf\n") | ||||
self.start_node(0) | self.start_node(0) | ||||
subversion = self.nodes[0].getnetworkinfo()["subversion"] | subversion = self.nodes[0].getnetworkinfo()["subversion"] | ||||
assert subversion.endswith("main; relative)/") | assert subversion.endswith("main; relative)/") | ||||
self.stop_node( | |||||
0, expected_stderr="warning: -includeconf cannot be used from included files; ignoring -includeconf=relative2.conf") | |||||
self.log.info( | self.log.info( | ||||
"multiple -includeconf args can be used from the base config file. subversion should end with 'main; relative; relative2)/'") | "multiple -includeconf args can be used from the base config file. subversion should end with 'main; relative; relative2)/'") | ||||
with open(os.path.join(self.options.tmpdir, "node0", "relative.conf"), "w", encoding="utf8") as f: | with open(os.path.join(self.options.tmpdir, "node0", "relative.conf"), "w", encoding="utf8") as f: | ||||
f.write("uacomment=relative\n") | f.write("uacomment=relative\n") | ||||
with open(os.path.join(self.options.tmpdir, "node0", "bitcoin.conf"), "a", encoding='utf8') as f: | with open(os.path.join(self.options.tmpdir, "node0", "bitcoin.conf"), "a", encoding='utf8') as f: | ||||
f.write("includeconf=relative2.conf\n") | f.write("includeconf=relative2.conf\n") | ||||
self.restart_node(0) | self.start_node(0) | ||||
subversion = self.nodes[0].getnetworkinfo()["subversion"] | subversion = self.nodes[0].getnetworkinfo()["subversion"] | ||||
assert subversion.endswith("main; relative; relative2)/") | assert subversion.endswith("main; relative; relative2)/") | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
IncludeConfTest().main() | IncludeConfTest().main() |