mirror of
https://github.com/corda/corda.git
synced 2025-04-07 11:27:01 +00:00
EG-1557 - Configuration data from "include" section ignored while command line contains the path to config file without leading ./ (#6354)
Configuration data from "include" section ignored while command line contains the path to config file without leading ./
This commit is contained in:
parent
71b2a43221
commit
d6cab0e131
@ -34,7 +34,7 @@ open class SharedNodeCmdLineOptions {
|
||||
description = ["The path to the config file. By default this is node.conf in the base directory."]
|
||||
)
|
||||
private var _configFile: Path? = null
|
||||
val configFile: Path get() = _configFile ?: (baseDirectory / "node.conf")
|
||||
val configFile: Path get() = if (_configFile != null) baseDirectory.resolve(_configFile) else (baseDirectory / "node.conf")
|
||||
|
||||
@Option(
|
||||
names = ["--on-unknown-config-keys"],
|
||||
|
@ -22,7 +22,7 @@ class NodeStartupCliTest {
|
||||
|
||||
companion object {
|
||||
private lateinit var workingDirectory: Path
|
||||
|
||||
private var customNodeConf = "custom_node.conf"
|
||||
@BeforeClass
|
||||
@JvmStatic
|
||||
fun initDirectories() {
|
||||
@ -56,6 +56,18 @@ class NodeStartupCliTest {
|
||||
Assertions.assertThat(startup.cmdLineOptions.networkRootTrustStorePathParameter).isEqualTo(null)
|
||||
}
|
||||
|
||||
@Test(timeout=300_000)
|
||||
fun `--nodeconf using relative path will be changed to absolute path`() {
|
||||
CommandLine.populateCommand(startup, CommonCliConstants.CONFIG_FILE, customNodeConf)
|
||||
Assertions.assertThat(startup.cmdLineOptions.configFile).isEqualTo(workingDirectory / customNodeConf)
|
||||
}
|
||||
|
||||
@Test(timeout=300_000)
|
||||
fun `--nodeconf using absolute path will not be changed`() {
|
||||
CommandLine.populateCommand(startup, CommonCliConstants.CONFIG_FILE, "/$customNodeConf")
|
||||
Assertions.assertThat(startup.cmdLineOptions.configFile).isEqualTo( "/" / customNodeConf)
|
||||
}
|
||||
|
||||
@Test(timeout=3_000)
|
||||
@Ignore
|
||||
fun `test logs are written to correct location correctly if verbose flag set`() {
|
||||
|
@ -211,6 +211,7 @@ fun printError(message: String) = System.err.println("${ShellConstants.RED}$mess
|
||||
*/
|
||||
object CommonCliConstants {
|
||||
const val BASE_DIR = "--base-directory"
|
||||
const val CONFIG_FILE = "--config-file"
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user