Fix yaml `logPath` case

pull/1039/head
Guillaume CHAUVEL 2023-06-12 15:31:38 +02:00
parent 6cf303c1d3
commit bbf09132e7
3 changed files with 15 additions and 7 deletions

View File

@ -96,14 +96,14 @@ depend:
### log ### log
Optionally set a different logging directory with `logpath` and startup `mode`: append (default), reset (clear log), ignore, roll (move to `\*.old`). Optionally set a different logging directory with `logPath` and startup `mode`: append (default), reset (clear log), ignore, roll (move to `\*.old`).
User can specify all log configurations as a single YAML dictionary User can specify all log configurations as a single YAML dictionary
```yaml ```yaml
log: log:
mode: roll-by-size mode: roll-by-size
logpath: '%BASE%\log' logPath: '%BASE%\log'
sizeThreshold: 10240 sizeThreshold: 10240
keepFiles: 8 keepFiles: 8
``` ```

View File

@ -38,7 +38,7 @@ waitHint: 15 sec
sleepTime: 1 sec sleepTime: 1 sec
#interactive: true #interactive: true
log: log:
# logpath: '%BASE%\logs' # logPath: '%BASE%\logs'
mode: append mode: append
#env: #env:
# - # -

View File

@ -12,6 +12,7 @@ namespace winswTests
private IServiceConfig _extendedServiceDescriptor; private IServiceConfig _extendedServiceDescriptor;
private const string ExpectedWorkingDirectory = @"Z:\Path\SubPath"; private const string ExpectedWorkingDirectory = @"Z:\Path\SubPath";
private const string ExpectedLogDirectory = @"c:\logs";
private const string Username = "User"; private const string Username = "User";
private const string Password = "Password"; private const string Password = "Password";
private const string Domain = "Domain"; private const string Domain = "Domain";
@ -29,7 +30,7 @@ executable: node.exe
arguments: My Arguments arguments: My Arguments
log: log:
mode: roll mode: roll
logpath: c:\logs logPath: {ExpectedLogDirectory}
serviceAccount: serviceAccount:
domain: {Domain} domain: {Domain}
user: {Username} user: {Username}
@ -82,6 +83,13 @@ startMode: manual";
Assert.That(this._extendedServiceDescriptor.WorkingDirectory, Is.EqualTo(ExpectedWorkingDirectory)); Assert.That(this._extendedServiceDescriptor.WorkingDirectory, Is.EqualTo(ExpectedWorkingDirectory));
} }
[Test]
public void VerifyLogPath()
{
Assert.That(this._extendedServiceDescriptor.Log.Directory, Is.EqualTo(ExpectedLogDirectory));
Assert.That(this._extendedServiceDescriptor.LogDirectory, Is.EqualTo(ExpectedLogDirectory));
}
[Test] [Test]
public void VerifyServiceLogonRight() public void VerifyServiceLogonRight()
{ {
@ -265,7 +273,7 @@ name: Service
description: The Service. description: The Service.
executable: node.exe executable: node.exe
log: log:
logpath: 'c:\\' logPath: 'c:\\'
mode: roll-by-size mode: roll-by-size
sizeThreshold: 112 sizeThreshold: 112
keepFiles: 113"; keepFiles: 113";
@ -289,7 +297,7 @@ name: Service
description: The Service. description: The Service.
executable: node.exe executable: node.exe
log: log:
logpath: c:\\ logPath: c:\\
mode: roll-by-time mode: roll-by-time
period: 7 period: 7
pattern: log pattern"; pattern: log pattern";
@ -313,7 +321,7 @@ name: Service
description: The Service. description: The Service.
executable: node.exe executable: node.exe
log: log:
logpath: c:\\ logPath: c:\\
mode: roll-by-size-time mode: roll-by-size-time
sizeThreshold: 10240 sizeThreshold: 10240
pattern: yyyy-MM-dd pattern: yyyy-MM-dd