Merge pull request #277 from corebonts/fix-test

Fix environment variable setting in RunawayProcessKiller test
pull/280/head
Oleg Nenashev 2018-06-19 18:37:09 +02:00 committed by GitHub
commit 4415c62c1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();