Fix environment variable setting in RunawayProcessKiller test

This way the check can be reenabled as well.
pull/277/head
Gabor Garancsi 2018-05-31 10:12:20 +02:00
parent d98bb9e9ad
commit 56ab348652
1 changed files with 2 additions and 3 deletions

View File

@ -75,7 +75,7 @@ namespace winswTests.Extensions
// Prepare the env var
String varName = WinSWSystem.ENVVAR_NAME_SERVICE_ID;
var env = new Dictionary<string, string>();
env.Add("varName", winswId);
env.Add(varName, winswId);
// Spawn the test process
var scriptFile = Path.Combine(tmpDir, "dosleep.bat");
@ -89,10 +89,9 @@ namespace winswTests.Extensions
try
{
// Generate extension and ensure that the roundtrip is correct
//TODO: checkWinSWEnvironmentVariable should be true, but it does not work due to proc.StartInfo.EnvironmentVariables
var pidfile = Path.Combine(tmpDir, "process.pid");
var sd = ConfigXmlBuilder.create(id: winswId)
.WithRunawayProcessKiller(new RunawayProcessKillerExtension(pidfile, checkWinSWEnvironmentVariable: false), extensionId)
.WithRunawayProcessKiller(new RunawayProcessKillerExtension(pidfile), extensionId)
.ToServiceDescriptor();
WinSWExtensionManager manager = new WinSWExtensionManager(sd);
manager.LoadExtensions();